/* ============================================
   SPENDNOTE - APPLICATION LAYOUT STYLES
   Shared styles for app pages (dashboard, etc.)
   ============================================ */

/* SCROLLBAR FIX - Prevent layout shift when scrollbar appears */
html {
    scrollbar-gutter: stable;
}

/* APP-SPECIFIC OVERRIDES */
body {
    font-size: 11px; /* App uses smaller base font - reduced for more compact layout */
}

/* ============================================
   NAVIGATION OVERRIDES FOR APP PAGES
   ============================================ */

/* Site Nav - Override for App Pages */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0; /* match main.css */
    box-shadow: 0 2px 8px var(--shadow);
}

/* Nav Container - Consistent padding */
.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--page-gutter); /* same gutter as main.css */
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Logo - Consistent styling */
.site-nav .logo {
    display: flex;
    align-items: center;
    gap: 4px; /* Space between SVG and text */
    text-decoration: none;
    transition: transform 0.2s ease;
}

.site-nav .logo:hover {
    transform: scale(1.02);
}

.site-nav .logo svg {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    margin-left: var(--logo-optical-offset);
}

.site-nav .logo span {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* Top Nav Container (dashboard specific - if used) */
.top-nav {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    box-shadow: 0 2px 16px var(--shadow);
}

/* Navigation Links - App Style */
.site-nav .nav-links {
    display: flex;
    gap: 1.5rem; /* match main.css */
    list-style: none;
    align-items: center;
}

.site-nav .nav-links a {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 12px;
    transition: color 0.2s ease;
    font-size: var(--font-base);
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    text-decoration: none;
    position: relative;
}

.site-nav .nav-links a:hover {
    color: var(--active);
}

/* Active menu item indicator */
.site-nav .nav-links a.active {
    color: var(--active);
    position: relative;
    box-shadow: none;
}

.site-nav .nav-links a.active::after {
    content: '';
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 6px;
    height: 2px;
    background: var(--active);
    border-radius: 999px;
}

/* Cash-related nav items (Dashboard, Cash Boxes, Transactions) - only color, not active state */
.nav-links a.nav-cash-item:not(.active) {
    color: var(--text-muted);
    font-weight: 600;
}

.site-nav .nav-links a.nav-cash-item:hover {
    opacity: 0.8;
}

/* New Transaction button in nav */
.nav-new-transaction-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--active);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(var(--active-rgb), 0.25);
}

.nav-new-transaction-btn:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--active-rgb), 0.35);
}

.nav-new-transaction-btn i {
    font-size: 12px;
}

/* APP CONTAINER OVERRIDE (if needed) */
.app-container {
    padding: 16px var(--page-gutter); /* match nav gutter */
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
    width: 100%;
}

.main-content {
    padding-top: 16px; /* Further reduced */
    display: flex;
    flex-direction: column;
    gap: 12px; /* Further reduced */
}

/* ============================================
   PAGE HEADER - Modern "Quiet Header" Style
   ============================================ */
.page-header {
    margin-bottom: 12px; /* Further reduced for more compact layout */
}

.page-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px; /* Tight spacing between title and subtitle */
}

.page-title,
.page-title-group h1 {
    font-size: 24px !important; /* Smaller, less imposing */
    font-weight: 700 !important; /* Semi-bold, not extra bold */
    letter-spacing: -0.01em !important;
    margin: 0 !important;
    color: var(--text) !important;
}

.page-subtitle {
    color: var(--text-muted) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.5;
    margin: 0 !important;
}

/* COMMON APP CARD STYLES */
.card-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 24px 32px;
}

.card-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
}

/* TABLE STYLES (if not in main.css) */
.table-wrapper {
    overflow-x: auto;
}

/* USER AVATAR / PROFILE PICTURES */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar-large {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.user-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Avatar with name (in tables, etc.) */
.avatar-with-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-with-name span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* User avatar wrapper (in nav) */
.user-avatar-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 12px;
    transition: background 0.2s;
    position: relative !important;
}

.user-avatar-wrapper:hover {
    background: var(--surface-elevated);
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: block;
    max-width: 140px;
    min-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* USER DROPDOWN MENU */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu {
    padding: 8px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.user-dropdown-item:hover {
    background: rgba(var(--active-rgb), 0.1);
    color: var(--active);
}

.user-dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
    color: inherit;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .app-container {
        padding: 20px 16px;
    }
    
    .page-title-group h1 {
        font-size: 24px !important;
    }
}
