/* ====================================================================
   GELIR GIDER - APPLE LIQUID GLASS UI
   iOS PWA Design System - iPhone Optimized
   ==================================================================== */

:root {
    /* ========== COLOR SYSTEM ========== */
    /* Primary Colors - iOS Blue */
    --gg-primary: #007AFF;
    --gg-primary-hover: #0051D5;
    --gg-primary-light: rgba(0, 122, 255, 0.1);
    --gg-primary-dark: #0040A3;
    
    /* Semantic Colors */
    --gg-success: #34C759;
    --gg-success-light: rgba(52, 199, 89, 0.15);
    --gg-danger: #FF3B30;
    --gg-danger-light: rgba(255, 59, 48, 0.15);
    --gg-warning: #FF9500;
    --gg-warning-light: rgba(255, 149, 0, 0.15);
    --gg-info: #5AC8FA;
    
    /* Glass Background Colors - Enhanced for iOS */
    --gg-glass-bg: rgba(255, 255, 255, 0.07);
    --gg-glass-bg-strong: rgba(255, 255, 255, 0.12);
    --gg-glass-border: rgba(255, 255, 255, 0.1);
    --gg-glass-border-strong: rgba(255, 255, 255, 0.18);
    --gg-glass-hover: rgba(255, 255, 255, 0.1);
    --gg-glass-active: rgba(255, 255, 255, 0.15);
    
    /* Background Gradients - iOS Dark Mode */
    --gg-bg-primary: #000000;
    --gg-bg-secondary: #1C1C1E;
    --gg-bg-tertiary: #2C2C2E;
    --gg-bg-elevated: #1C1C1E;
    
    /* Text Colors - iOS System Colors */
    --gg-text-primary: #FFFFFF;
    --gg-text-secondary: #EBEBF5;
    --gg-text-tertiary: #8E8E93;
    --gg-text-quaternary: #636366;
    --gg-text-placeholder: rgba(142, 142, 147, 0.6);
    
    /* ========== TYPOGRAPHY SCALE ========== */
    --font-size-xs: 0.6875rem;    /* 11px - Caption */
    --font-size-sm: 0.8125rem;    /* 13px - Footnote */
    --font-size-md: 0.9375rem;    /* 15px - Body */
    --font-size-lg: 1.0625rem;    /* 17px - Callout */
    --font-size-xl: 1.25rem;      /* 20px - Title 3 */
    --font-size-2xl: 1.5rem;      /* 24px - Title 2 */
    --font-size-3xl: 1.75rem;     /* 28px - Title 1 */
    --font-size-4xl: 2rem;        /* 32px - Large Title */
    
    /* Font Weights */
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line Heights */
    --line-height-tight: 1.2;
    --line-height-normal: 1.4;
    --line-height-relaxed: 1.6;
    
    /* ========== SPACING SYSTEM ========== */
    --spacing-xxs: 0.125rem;   /* 2px */
    --spacing-xs: 0.25rem;     /* 4px */
    --spacing-sm: 0.5rem;      /* 8px */
    --spacing-md: 1rem;        /* 16px */
    --spacing-lg: 1.5rem;      /* 24px */
    --spacing-xl: 2rem;        /* 32px */
    --spacing-2xl: 3rem;       /* 48px */
    --spacing-3xl: 4rem;       /* 64px */
    
    /* Legacy support */
    --gg-spacing-xs: var(--spacing-xs);
    --gg-spacing-sm: var(--spacing-sm);
    --gg-spacing-md: var(--spacing-md);
    --gg-spacing-lg: var(--spacing-lg);
    --gg-spacing-xl: var(--spacing-xl);
    
    /* ========== BORDER RADIUS ========== */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Legacy support */
    --gg-radius-sm: var(--radius-sm);
    --gg-radius-md: var(--radius-md);
    --gg-radius-lg: var(--radius-lg);
    --gg-radius-xl: var(--radius-xl);
    --gg-radius-full: var(--radius-full);
    
    /* ========== SHADOWS ========== */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(0, 122, 255, 0.25);
    --shadow-glow-strong: 0 0 30px rgba(0, 122, 255, 0.4);
    
    /* Legacy support */
    --gg-shadow-sm: var(--shadow-sm);
    --gg-shadow-md: var(--shadow-md);
    --gg-shadow-lg: var(--shadow-lg);
    --gg-shadow-glow: var(--shadow-glow);
    
    /* ========== TRANSITIONS & ANIMATIONS ========== */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Legacy support */
    --gg-transition: var(--transition-base);
    
    /* ========== iOS SAFE AREAS ========== */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    
    /* ========== Z-INDEX SCALE ========== */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-overlay: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;
}

/* ========== RESET & BASE ========== */
* {
    box-sizing: border-box;
}

.gg-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0A0A0A 0%, #1A1A1A 50%, #0A0A0A 100%);
    background-attachment: fixed;
    background-color: #0A0A0A;
    color: var(--gg-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

.gg-app {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.gg-sidebar,
.gg-sidebar-mobile {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--gg-glass-border);
    padding: var(--gg-spacing-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: var(--z-modal); /* Higher than bottom nav */
    box-sizing: border-box;
}

.gg-sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--gg-spacing-sm);
    margin-bottom: var(--gg-spacing-xl);
    padding-bottom: var(--gg-spacing-lg);
    border-bottom: 1px solid var(--gg-glass-border);
}

.gg-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--gg-radius-md);
    background: linear-gradient(135deg, #4A90E2 0%, #7B68EE 50%, #9370DB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.gg-logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: gg-shine 3s infinite;
}

@keyframes gg-shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.gg-logo {
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
    color: var(--gg-text-primary);
}

.gg-nav-section {
    margin-bottom: var(--gg-spacing-lg);
}

.gg-nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gg-text-tertiary);
    margin-bottom: var(--gg-spacing-sm);
    padding: 0 var(--gg-spacing-sm);
}

.gg-nav-link {
    display: flex;
    align-items: center;
    gap: var(--gg-spacing-sm);
    padding: var(--gg-spacing-sm) var(--gg-spacing-md);
    border-radius: var(--gg-radius-md);
    color: var(--gg-text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: var(--gg-transition);
    margin-bottom: var(--gg-spacing-xs);
    position: relative;
}

.gg-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gg-primary);
    border-radius: 0 2px 2px 0;
    transition: var(--gg-transition);
}

.gg-nav-link:hover {
    background: var(--gg-glass-hover);
    color: var(--gg-text-primary);
    transform: translateX(4px);
}

.gg-nav-link.gg-active {
    background: rgba(0, 122, 255, 0.15);
    color: var(--gg-primary);
    font-weight: 500;
}

.gg-nav-link.gg-active::before {
    height: 60%;
}

.gg-nav-link i {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
}

.gg-sidebar-footer {
    margin-top: auto;
    padding-top: var(--gg-spacing-lg);
    border-top: 1px solid var(--gg-glass-border);
    font-size: 0.8125rem;
    color: var(--gg-text-tertiary);
    text-align: center;
}

/* Mobile Sidebar */
@media (max-width: 1023px) {
    .gg-sidebar-mobile {
        left: -280px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: var(--z-modal); /* Higher than bottom nav */
    }

    .gg-sidebar-mobile.gg-open {
        left: 0;
        z-index: var(--z-modal); /* Ensure it's above bottom nav when open */
    }
}

.gg-menu-toggle {
    position: fixed;
    top: var(--gg-spacing-lg);
    right: var(--gg-spacing-lg);
    width: 56px;
    height: 56px;
    border-radius: var(--gg-radius-full);
    background: var(--gg-primary);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--gg-shadow-lg), var(--gg-shadow-glow);
    transition: var(--gg-transition);
    z-index: 1500;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.gg-menu-toggle i {
    display: block;
    line-height: 1;
    font-size: 1.5rem;
}

.gg-menu-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--gg-shadow-lg), 0 0 30px rgba(0, 122, 255, 0.5);
}

/* Hide top menu toggle on mobile - hamburger is now in bottom nav */
@media (max-width: 1023px) {
    .gg-menu-toggle {
        display: none !important;
    }
}

.gg-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998; /* Just below sidebar */
}

.gg-overlay.gg-open {
    display: block;
}

/* ========== MAIN CONTENT ========== */
.gg-main {
    flex: 1;
    margin-left: 280px;
    padding: var(--spacing-lg);
    padding-top: calc(var(--spacing-lg) + var(--safe-area-top));
    padding-bottom: calc(var(--spacing-lg) + var(--safe-area-bottom));
    min-height: 100vh;
    min-height: -webkit-fill-available;
    width: calc(100% - 280px);
    box-sizing: border-box;
    overflow-x: hidden;
    /* Smooth scrolling */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: var(--z-base); /* Lower than bottom nav */
}

/* ========== PAGE HEADER - iOS Style ========== */
.gg-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
    gap: var(--spacing-md);
    flex-wrap: wrap;
    padding-top: var(--spacing-sm);
}

.gg-page-title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.03em;
    color: var(--gg-text-primary);
    margin: 0;
    line-height: var(--line-height-tight);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.gg-page-title i {
    font-size: var(--font-size-2xl);
    opacity: 0.8;
}

.gg-page-subtitle {
    font-size: var(--font-size-md);
    color: var(--gg-text-secondary);
    margin-top: var(--spacing-xs);
    line-height: var(--line-height-relaxed);
    font-weight: var(--font-weight-regular);
}

.gg-toggle-visibility {
    width: 44px;
    height: 38px;
    border-radius: var(--gg-radius-md);
    background: var(--gg-glass-bg);
    border: 1px solid var(--gg-glass-border);
    color: var(--gg-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem; /* 20px - same as select chevron */
    transition: var(--gg-transition);
    backdrop-filter: blur(10px);
}

.gg-toggle-visibility i {
    font-size: 1.25rem; /* Ensure icon is exactly 1.25rem */
    line-height: 1;
}

.gg-toggle-visibility:hover {
    background: var(--gg-glass-hover);
    transform: scale(1.05);
}

/* ========== GRID SYSTEM ========== */
.gg-grid {
    display: grid;
    gap: var(--spacing-sm); /* Compact spacing */
    margin-bottom: var(--spacing-sm); /* Compact spacing */
}

.gg-grid-1 { grid-template-columns: 1fr; }
.gg-grid-2 { grid-template-columns: repeat(2, 1fr); }
.gg-grid-3 { grid-template-columns: repeat(3, 1fr); }
.gg-grid-4 { grid-template-columns: repeat(4, 1fr); }
.gg-grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1024px) {
    .gg-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== CARDS - iOS Liquid Glass ========== */
.gg-card {
    background: var(--gg-glass-bg);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--gg-glass-border);
    border-radius: var(--radius-xl);
    padding: 0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    overflow: hidden;
    position: relative;
    /* iOS-style subtle gradient overlay */
    background-image: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        var(--gg-glass-bg);
}

.gg-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
    pointer-events: none;
}

.gg-card:hover {
    border-color: var(--gg-glass-border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    background: var(--gg-glass-bg-strong);
}

.gg-card-body {
    padding: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

/* Remove bottom padding for nested cards - only top-level cards get bottom padding */
.gg-card .gg-card .gg-card-body {
    padding-bottom: 0;
}

.gg-card-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gg-text-tertiary);
    margin-bottom: var(--spacing-sm);
    line-height: var(--line-height-tight);
}

.gg-card-value {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.03em;
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: var(--line-height-tight);
    color: var(--gg-text-primary);
}

/* ========== FORMS ========== */
.gg-form-group {
    margin-bottom: var(--gg-spacing-md);
}

.gg-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gg-text-secondary);
    margin-bottom: var(--gg-spacing-xs);
}

.gg-form-control,
.gg-form-select {
    width: 100%;
    height: 44px; /* Fixed height to match buttons */
    min-height: 44px; /* iOS minimum touch target */
    padding: var(--gg-spacing-sm) var(--gg-spacing-md);
    padding-right: 2.5rem; /* Space for custom chevron */
    background: var(--gg-glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gg-glass-border);
    border-radius: var(--gg-radius-md);
    color: var(--gg-text-primary);
    font-size: 0.9375rem;
    line-height: 1.5; /* Center text vertically */
    transition: var(--gg-transition);
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    position: relative;
    box-sizing: border-box;
}

/* Custom chevron icon for select - same size as eye icon */
.gg-select-wrapper {
    position: relative;
    display: inline-block;
}

.gg-select-wrapper::after {
    content: '\F282'; /* Bootstrap chevron-down icon */
    font-family: 'bootstrap-icons';
    position: absolute;
    right: var(--gg-spacing-md);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 1.25rem; /* Same as eye icon (1.25rem = 20px) */
    color: var(--gg-text-primary);
    z-index: 1;
    line-height: 1;
}

.gg-form-control:focus,
.gg-form-select:focus {
    outline: none;
    border-color: var(--gg-primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    background: rgba(255, 255, 255, 0.1);
}

.gg-form-control::placeholder {
    color: var(--gg-text-tertiary);
}

/* Field error styling */
.gg-field-error-input {
    border-color: var(--gg-danger) !important;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1) !important;
}

.gg-field-success-input {
    border-color: var(--gg-success) !important;
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.1) !important;
}

.gg-field-error {
    color: var(--gg-danger);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    animation: gg-fade-in 0.3s ease-out;
}

.gg-field-success {
    color: var(--gg-success);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    animation: gg-fade-in 0.3s ease-out;
}

.gg-field-checking {
    color: var(--gg-text-tertiary);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    animation: gg-fade-in 0.3s ease-out;
}

.gg-form-text {
    font-size: 0.8125rem;
    color: var(--gg-text-tertiary);
    margin-top: var(--gg-spacing-xs);
}

/* ========== BUTTONS - iOS Style ========== */
.gg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    height: 44px; /* Fixed height to match inputs */
    min-height: 44px; /* iOS minimum touch target */
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
    flex-shrink: 0; /* Prevent button from shrinking in flex containers */
}

/* Primary Button - iOS Blue */
.gg-btn-primary {
    background: linear-gradient(135deg, var(--gg-primary) 0%, var(--gg-primary-hover) 100%);
    color: white;
    box-shadow: 
        var(--shadow-sm),
        0 0 0 0 rgba(0, 122, 255, 0);
    position: relative;
}

.gg-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.gg-btn-primary:hover::before,
.gg-btn-primary:active::before {
    opacity: 1;
}

.gg-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 
        var(--shadow-md),
        0 0 20px rgba(0, 122, 255, 0.3);
}

.gg-btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 
        var(--shadow-xs),
        0 0 10px rgba(0, 122, 255, 0.2);
}

/* Secondary Button - Glass Style */
.gg-btn-secondary {
    background: var(--gg-glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--gg-glass-border);
    color: var(--gg-text-primary);
    box-shadow: var(--shadow-xs);
}

.gg-btn-secondary:hover {
    background: var(--gg-glass-hover);
    border-color: var(--gg-glass-border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.gg-btn-secondary:active {
    transform: translateY(0) scale(0.98);
    background: var(--gg-glass-active);
}

/* Tertiary Button - Text Style */
.gg-btn-tertiary {
    background: transparent;
    color: var(--gg-primary);
    padding: var(--spacing-sm);
    min-height: auto;
}

.gg-btn-tertiary:hover {
    background: var(--gg-primary-light);
}

.gg-btn-tertiary:active {
    background: var(--gg-primary-light);
    transform: scale(0.96);
}

.gg-btn-block {
    width: 100%;
    display: flex;
}

.gg-btn-lg {
    min-height: 52px;
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

/* ========== TABLES - iOS Style List Cells ========== */
.gg-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-xl);
    background: var(--gg-glass-bg);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--gg-glass-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.gg-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: transparent;
}

.gg-table thead {
    background: rgba(255, 255, 255, 0.03);
    position: sticky;
    top: 0;
    z-index: 10;
}

.gg-table th {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gg-text-tertiary);
    border-bottom: 0.5px solid var(--gg-glass-border);
    vertical-align: middle;
    background: rgba(255, 255, 255, 0.02);
}

.gg-table th.gg-text-center {
    text-align: center;
}

.gg-table th.gg-text-end {
    text-align: right;
}

.gg-table td {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-md);
    color: var(--gg-text-primary);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    transition: var(--transition-fast);
}

.gg-table td.gg-text-center {
    text-align: center;
}

.gg-table td.gg-text-end {
    text-align: right;
}

.gg-table tbody tr {
    transition: var(--transition-fast);
    cursor: pointer;
}

.gg-table tbody tr:hover {
    background: var(--gg-glass-hover);
}

.gg-table tbody tr:active {
    background: var(--gg-glass-active);
    transform: scale(0.99);
}

.gg-table tbody tr:last-child td {
    border-bottom: none;
}

/* iOS-style list cells (alternative to tables) */
.gg-list-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--gg-glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-fast);
    min-height: 52px; /* iOS-friendly touch target */
    cursor: pointer;
}

.gg-list-cell:first-child {
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
}

.gg-list-cell:last-child {
    border-bottom: none;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
}

.gg-list-cell:hover {
    background: var(--gg-glass-hover);
}

.gg-list-cell:active {
    background: var(--gg-glass-active);
    transform: scale(0.98);
}

.gg-list-cell-content {
    flex: 1;
    min-width: 0;
}

.gg-list-cell-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--gg-text-primary);
    margin-bottom: var(--spacing-xxs);
    line-height: var(--line-height-normal);
}

.gg-list-cell-subtitle {
    font-size: var(--font-size-sm);
    color: var(--gg-text-secondary);
    line-height: var(--line-height-normal);
}

.gg-list-cell-accessory {
    margin-left: var(--spacing-md);
    color: var(--gg-text-tertiary);
    font-size: var(--font-size-lg);
}

/* ========== PILLS / BADGES ========== */
.gg-pill {
    display: inline-flex;
    align-items: center;
    padding: var(--gg-spacing-xs) var(--gg-spacing-sm);
    border-radius: var(--gg-radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    background: rgba(0, 122, 255, 0.15);
    color: var(--gg-primary);
    border: 1px solid rgba(0, 122, 255, 0.2);
}

/* ========== COLORS ========== */
.gg-text-success {
    color: var(--gg-success) !important;
}

.gg-text-danger {
    color: var(--gg-danger) !important;
}

.gg-text-warning {
    color: var(--gg-warning) !important;
}

.gg-text-muted {
    color: var(--gg-text-secondary) !important;
}

.gg-text-tertiary {
    color: var(--gg-text-tertiary) !important;
}

/* ========== UTILITIES ========== */
.gg-flex {
    display: flex;
    align-items: stretch; /* Ensure all children have same height */
}

.gg-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gg-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gg-gap-sm { gap: var(--gg-spacing-sm); }
.gg-gap-md { gap: var(--gg-spacing-md); }
.gg-gap-lg { gap: var(--gg-spacing-lg); }

.gg-mb-sm { margin-bottom: var(--gg-spacing-sm); }
.gg-mb-md { margin-bottom: var(--gg-spacing-md); }
.gg-mb-lg { margin-bottom: var(--gg-spacing-lg); }
.gg-mb-xl { margin-bottom: var(--gg-spacing-xl); }

.gg-text-end { text-align: right; }
.gg-text-center { text-align: center; }

.gg-fw-bold { font-weight: 700; }
.gg-fw-semibold { font-weight: 600; }
.gg-fw-medium { font-weight: 500; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .gg-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .gg-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .gg-sidebar-mobile {
        position: fixed;
        left: 0;
        display: block;
    }
    
    .gg-menu-toggle {
        display: none;
    }
    
    .gg-overlay {
        display: none !important;
    }
    
    .gg-main {
        margin-left: 280px;
        width: calc(100% - 280px);
        padding-bottom: 0;
    }
    
    /* Hide bottom nav on desktop */
    .gg-bottom-nav {
        display: none;
    }
}

@media (max-width: 1023px) {
    .gg-sidebar-mobile {
        position: fixed;
        left: -280px;
        z-index: 9999; /* Highest - always on top */
    }
    
    .gg-sidebar-mobile.gg-open {
        z-index: 9999; /* Highest - always on top when open */
    }
    
    .gg-menu-toggle {
        display: flex;
    }
    
    .gg-main {
        margin-left: 0;
        /* Padding will be set dynamically by JavaScript based on bottom nav height */
        padding-bottom: 0;
    }
    
    /* Bottom Navigation Bar - Mobile Only */
    .gg-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(28, 28, 30, 0.8);
        backdrop-filter: blur(40px) saturate(180%);
        -webkit-backdrop-filter: blur(40px) saturate(180%);
        border-top: 0.5px solid rgba(255, 255, 255, 0.1);
        padding: var(--spacing-sm) var(--spacing-xs);
        padding-bottom: calc(var(--spacing-sm) + var(--safe-area-bottom));
        z-index: var(--z-fixed); /* Lower than sidebar */
        box-shadow: 
            0 -1px 0 rgba(255, 255, 255, 0.05),
            0 -4px 24px rgba(0, 0, 0, 0.4);
        /* iOS-style separator */
        background-image: linear-gradient(to top, rgba(255, 255, 255, 0.05) 0%, transparent 1px);
    }
    
    .gg-bottom-nav-content {
        display: flex;
        align-items: center;
        justify-content: space-around;
        width: 100%;
        max-width: 100%;
        padding-bottom: var(--spacing-xs);
    }
    
    .gg-bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-xxs);
        padding: var(--spacing-xs) var(--spacing-sm);
        border-radius: var(--radius-md);
        text-decoration: none;
        color: var(--gg-text-tertiary);
        transition: var(--transition-fast);
        position: relative;
        flex: 1;
        min-width: 0;
        min-height: 60px; /* iOS-friendly touch target */
        -webkit-tap-highlight-color: transparent;
        border: none;
        background: transparent;
        cursor: pointer;
        font-family: inherit;
    }
    
    /* Hamburger menu button in center */
    .gg-bottom-nav-menu-toggle {
        /* Slightly larger for emphasis */
        min-height: 64px;
    }
    
    .gg-bottom-nav-item i {
        font-size: 1.375rem;
        line-height: 1;
        transition: var(--transition-fast);
        color: inherit;
    }
    
    .gg-bottom-nav-menu-toggle i {
        font-size: 1.5rem; /* Slightly larger hamburger icon */
    }
    
    .gg-bottom-nav-item span {
        font-size: var(--font-size-xs);
        font-weight: var(--font-weight-medium);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        transition: var(--transition-fast);
        color: inherit;
        line-height: var(--line-height-tight);
    }
    
    /* Active state - iOS style with rounded background */
    .gg-bottom-nav-item.gg-active {
        color: var(--gg-primary);
    }
    
    .gg-bottom-nav-item.gg-active i {
        font-size: 1.5rem;
        color: var(--gg-primary);
        font-weight: var(--font-weight-semibold);
    }
    
    .gg-bottom-nav-item.gg-active span {
        color: var(--gg-primary);
        font-weight: var(--font-weight-semibold);
    }
    
    /* Active background indicator - iOS-style rounded rectangle */
    .gg-bottom-nav-item.gg-active::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: calc(100% - 16px);
        height: calc(100% - 12px);
        background: rgba(0, 122, 255, 0.15);
        border-radius: var(--radius-md);
        z-index: -1;
        box-shadow: inset 0 0 0 0.5px rgba(0, 122, 255, 0.2);
    }
    
    /* Touch feedback */
    .gg-bottom-nav-item:active {
        transform: scale(0.92);
        opacity: 0.7;
    }
    
    .gg-bottom-nav-item:active.gg-active {
        background: rgba(0, 122, 255, 0.2);
    }
    
    /* Home indicator (iPhone) - iOS style */
    .gg-home-indicator {
        position: absolute;
        bottom: calc(var(--safe-area-bottom) + var(--spacing-xs));
        left: 50%;
        transform: translateX(-50%);
        width: 134px;
        height: 5px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: var(--radius-full);
        pointer-events: none;
    }
}

@media (max-width: 768px) {
    .gg-main {
        padding: var(--gg-spacing-md);
        /* Padding-bottom will be set dynamically by JavaScript */
        padding-bottom: 0;
    }
    
    /* Remove card margins on mobile */
    .gg-card {
        margin-bottom: 0;
    }
    
    .gg-card + .gg-card {
        margin-top: var(--spacing-sm); /* Compact spacing */
    }
    
    .gg-grid + .gg-card {
        margin-top: 0; /* Grid already has margin-bottom */
    }
    
    .gg-grid-5,
    .gg-grid-4,
    .gg-grid-3,
    .gg-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .gg-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--gg-spacing-md);
    }
    
    /* Smaller icons and text on very small screens */
    .gg-bottom-nav-item span {
        font-size: 0.625rem;
    }
    
    .gg-bottom-nav-item i {
        font-size: 1.375rem;
    }
    
    .gg-bottom-nav-item.gg-active i {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .gg-grid-5 {
        grid-template-columns: 1fr;
    }
}

/* ========== ANIMATIONS - iOS Style ========== */
@keyframes gg-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gg-scale-in {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes gg-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gg-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.gg-fade-in {
    animation: gg-fade-in var(--transition-base) ease-out;
}

.gg-scale-in {
    animation: gg-scale-in var(--transition-base) cubic-bezier(0.4, 0, 0.2, 1);
}

.gg-slide-up {
    animation: gg-slide-up var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
}

.gg-pulse {
    animation: gg-pulse 2s ease-in-out infinite;
}

/* ========== CONFIRM DIALOG ========== */
.gg-confirm-dialog {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    animation: none !important;
    opacity: 1 !important;
}

/* Backdrop overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
}

body.gg-dialog-open::after {
    display: block;
}

/* ========== FINANCIAL VALUE BLUR ========== */
.gg-financial-value.gg-hidden {
    filter: blur(8px);
    user-select: none;
    pointer-events: none;
}

/* ========== CHART CONTAINER ========== */
.gg-chart-container {
    position: relative;
    padding: var(--gg-spacing-md);
    background: var(--gg-glass-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--gg-radius-lg);
}

canvas {
    max-width: 100%;
    height: auto !important;
}

/* ========== SORTABLE HANDLE ========== */
.gg-sort-handle {
    cursor: move;
    user-select: none;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.gg-sort-handle:hover {
    opacity: 1;
}

.gg-sort-handle i {
    font-size: 1.25rem;
}

/* Sortable dragging state */
.sortable-ghost {
    opacity: 0.4;
}

.sortable-drag {
    opacity: 0.8;
}

/* ========== AUTH PAGES ========== */
.gg-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gg-spacing-xl);
    background: var(--gg-bg-primary);
}

.gg-auth-container {
    width: 100%;
    max-width: 420px;
}

.gg-auth-card {
    background: var(--gg-glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--gg-glass-border);
    border-radius: var(--gg-radius-xl);
    padding: var(--gg-spacing-xl);
    box-shadow: var(--gg-shadow-lg);
}

.gg-auth-header {
    text-align: center;
    margin-bottom: var(--gg-spacing-xl);
}

.gg-auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gg-text-primary);
    margin: 0 0 var(--gg-spacing-sm) 0;
}

.gg-auth-subtitle {
    font-size: 0.9375rem;
    color: var(--gg-text-secondary);
    margin: 0;
}

.gg-auth-form {
    margin-bottom: var(--gg-spacing-lg);
}

.gg-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gg-text-primary);
    margin-bottom: var(--gg-spacing-xs);
}

.gg-form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--gg-spacing-sm);
    font-size: 0.875rem;
    color: var(--gg-text-secondary);
    cursor: pointer;
}

.gg-form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.gg-link {
    color: var(--gg-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.gg-link:hover {
    color: var(--gg-primary-hover);
}

.gg-btn-lg {
    padding: var(--gg-spacing-md) var(--gg-spacing-lg);
    font-size: 1rem;
}

/* ========== SIDEBAR USER ========== */
.gg-sidebar-user {
    padding: var(--gg-spacing-md);
    border-top: 1px solid var(--gg-glass-border);
    margin-top: auto;
}

.gg-user-info {
    display: flex;
    align-items: center;
    gap: var(--gg-spacing-sm);
    margin-bottom: var(--gg-spacing-sm);
}

.gg-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--gg-radius-full);
    background: linear-gradient(135deg, var(--gg-primary), #5856D6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
}

.gg-user-details {
    flex: 1;
    min-width: 0;
}

.gg-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gg-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gg-user-email {
    font-size: 0.75rem;
    color: var(--gg-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== MOBILE OPTIMIZATIONS ========== */
@media (max-width: 1023px) {
    .gg-sidebar {
        width: 280px;
        max-width: 85vw;
    }
    
.gg-main {
        padding: var(--gg-spacing-md);
    }
    
    .gg-page-header {
        margin-bottom: var(--gg-spacing-lg);
    }
    
    .gg-page-title {
        font-size: 1.5rem;
    }
    
    .gg-page-subtitle {
        font-size: 0.875rem;
    }
    
    .gg-card {
        /* margin-bottom: var(--gg-spacing-md); */
    }
    
    .gg-grid-4,
    .gg-grid-5 {
        grid-template-columns: 1fr;
        gap: var(--gg-spacing-md);
    }
    
    .gg-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .gg-table {
        min-width: 600px;
    }
    
    .gg-form-control,
    .gg-form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .gg-btn {
        min-height: 44px; /* iOS touch target */
        padding: var(--gg-spacing-sm) var(--gg-spacing-md);
    }
    
    .gg-auth-page {
        padding: var(--gg-spacing-md);
    }
    
    .gg-auth-card {
        padding: var(--gg-spacing-lg);
    }
}

@media (max-width: 480px) {
    .gg-main {
        padding: var(--gg-spacing-sm);
    }
    
    .gg-page-title {
        font-size: 1.25rem;
    }
    
    .gg-card-body {
        padding: var(--gg-spacing-md);
    }
    
    .gg-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .gg-sidebar-user {
        padding: var(--gg-spacing-sm);
    }
    
    .gg-user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.75rem;
    }
    
    .gg-user-name {
        font-size: 0.8125rem;
    }
    
    .gg-user-email {
        font-size: 0.6875rem;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .gg-form-control,
    .gg-form-select {
        font-size: 16px;
    }
    
    .gg-main {
        -webkit-overflow-scrolling: touch;
    }
    
    .gg-sidebar {
        -webkit-overflow-scrolling: touch;
    }
}
