/* ===========================
   ProfitGrid - Luxury Dark Streetwear
   Premium, Brutalist, High-Fashion Design
   
   Color Palette:
   - Primary BG: #070604 (Deepest Black)
   - Secondary BG: #24201c (Warm Dark Charcoal)
   - Accent: #654d2d (Muted Bronze/Gold)
   - Primary Text: #dadada (Off-White)
   - Secondary Text: #969695 (Medium Gray)
   =========================== */

/* Import Fonts - Premium Typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

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

:root {
    /* === LUXURY DARK STREETWEAR PALETTE === */
    --bg-primary: #070604;
    --bg-secondary: #24201c;
    --bg-elevated: #1a1815;
    --bg-card: #2a2520;
    --bg-hover: #332e28;
    
    /* Accent - Muted Bronze/Gold */
    --accent-primary: #654d2d;
    --accent-secondary: #8a6b42;
    --accent-light: #b8956a;
    --accent-glow: rgba(101, 77, 45, 0.4);
    
    /* Text */
    --text-primary: #dadada;
    --text-secondary: #969695;
    --text-tertiary: #6a6a69;
    --text-muted: #4a4a49;
    
    /* Semantic Colors */
    --profit: #4ade80;
    --profit-glow: rgba(74, 222, 128, 0.2);
    --profit-bg: rgba(74, 222, 128, 0.1);
    --loss: #f87171;
    --loss-glow: rgba(248, 113, 113, 0.2);
    --loss-bg: rgba(248, 113, 113, 0.1);
    --warning: #fbbf24;
    --info: #60a5fa;
    
    /* Borders */
    --border-subtle: rgba(218, 218, 218, 0.06);
    --border-normal: rgba(218, 218, 218, 0.1);
    --border-strong: rgba(218, 218, 218, 0.2);
    --border-accent: rgba(101, 77, 45, 0.5);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --shadow-accent: 0 4px 30px rgba(101, 77, 45, 0.3);
    --shadow-glow: 0 0 60px rgba(101, 77, 45, 0.15);
    
    /* Transitions - Smooth & Premium */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Border Radius - Brutalist */
    --radius-none: 0px;
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 6px;
}

/* === BASE STYLES === */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(101, 77, 45, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(101, 77, 45, 0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* === TYPOGRAPHY - UPPERCASE HYPE === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
}

h1 { 
    font-size: clamp(2rem, 6vw, 3.5rem); 
    letter-spacing: 0.1em;
}
h2 { 
    font-size: clamp(1.5rem, 4vw, 2.25rem); 
    letter-spacing: 0.08em;
}
h3 { 
    font-size: clamp(1.125rem, 3vw, 1.5rem); 
    letter-spacing: 0.06em;
}
h4 {
    font-size: 1rem;
    letter-spacing: 0.05em;
}

p {
    color: var(--text-secondary);
    font-weight: 400;
}

/* === SELECTION === */
::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* === SCROLLBAR - Minimal === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* === FOCUS STATES === */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Hide shooting stars */
.night {
    display: none;
}

/* ===========================
   PERSISTENT SIDEBAR NAVIGATION
   =========================== */

/* Hide old header (kept for backwards compat) */
.main-header { display: none !important; }
.mobile-sidebar { display: none !important; }

/* App Layout: sidebar + main content */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.25s ease, transform var(--transition-base);
}

/* Collapsed sidebar */
.app-sidebar.collapsed {
    width: 56px;
}

.app-sidebar.collapsed .sidebar-logo-text,
.app-sidebar.collapsed .sidebar-nav-item span,
.app-sidebar.collapsed .sidebar-collapse-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.15s ease;
}

.app-sidebar.collapsed .sidebar-logo-section {
    padding: 20px 14px 16px;
    justify-content: center;
}

.app-sidebar.collapsed .sidebar-logo-link {
    justify-content: center;
}

.app-sidebar.collapsed .sidebar-nav-item {
    justify-content: center;
    padding: 10px;
    gap: 0;
}

.app-sidebar.collapsed .sidebar-nav-item.active::before {
    left: 0;
}

.app-sidebar.collapsed .sidebar-collapse-btn {
    justify-content: center;
    padding: 10px;
    gap: 0;
}

.app-sidebar.collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

.app-sidebar.collapsed + .app-main {
    margin-left: 56px;
}

/* Instant collapsed state from inline <head> script — prevents flash on navigation */
html.sidebar-is-collapsed .app-sidebar {
    width: 56px;
    transition: none;
}
html.sidebar-is-collapsed .app-main {
    margin-left: 56px;
    transition: none;
}
html.sidebar-is-collapsed .sidebar-logo-text,
html.sidebar-is-collapsed .sidebar-nav-item span,
html.sidebar-is-collapsed .sidebar-collapse-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}
html.sidebar-is-collapsed .sidebar-logo-section {
    padding: 20px 14px 16px;
    justify-content: center;
}
html.sidebar-is-collapsed .sidebar-logo-link {
    justify-content: center;
}
html.sidebar-is-collapsed .sidebar-nav-item {
    justify-content: center;
    padding: 10px;
    gap: 0;
}
html.sidebar-is-collapsed .sidebar-nav-item.active::before {
    left: 0;
}
html.sidebar-is-collapsed .sidebar-collapse-btn {
    justify-content: center;
    padding: 10px;
    gap: 0;
}
html.sidebar-is-collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

.app-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--accent-primary), transparent);
    opacity: 0.3;
}

/* Sidebar Logo */
.sidebar-logo-section {
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.sidebar-logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all var(--transition-base);
}

.sidebar-logo-link:hover {
    opacity: 0.85;
}

.sidebar-logo-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: brightness(0.9) contrast(1.1);
}

.sidebar-logo-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Sidebar Navigation */
.sidebar-nav-group {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.sidebar-nav-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 10px;
    flex-shrink: 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    position: relative;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.sidebar-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--transition-base);
}

.sidebar-nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sidebar-nav-item:hover svg {
    opacity: 1;
}

.sidebar-nav-item.active {
    color: var(--accent-light);
    background: rgba(101, 77, 45, 0.18);
}

.sidebar-nav-item.active svg {
    opacity: 1;
    color: var(--accent-light);
}

.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--accent-primary);
    border-radius: 0 2px 2px 0;
}

/* Sidebar Bottom Section */
.sidebar-bottom {
    padding: 12px 10px 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

/* Mobile sidebar toggle */
.sidebar-mobile-toggle {
    display: none;
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 12px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    padding: 0;
}

.sidebar-mobile-toggle svg {
    width: 20px;
    height: 20px;
}

.sidebar-mobile-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

/* Sidebar overlay for mobile */
.sidebar-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 6, 4, 0.85);
    backdrop-filter: blur(6px);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.sidebar-mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar collapse toggle */
.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.sidebar-collapse-btn svg {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.25s ease;
}

.sidebar-collapse-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sidebar-collapse-btn:hover svg {
    opacity: 1;
}

/* Main content area */
.app-main {
    flex: 1;
    transition: margin-left 0.25s ease;
    margin-left: 220px;
    min-height: 100vh;
    position: relative;
}

/* ===========================
   CONTAINER & LAYOUT
   =========================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 28px 60px;
    position: relative;
    z-index: 1;
}

/* Page Header */
.page-header {
    text-align: left;
    margin-bottom: var(--space-xl);
    position: relative;
}

.page-header h1 {
    margin-bottom: var(--space-sm);
    position: relative;
    display: inline-block;
}

.page-header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent-primary);
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin-top: var(--space-lg);
}

/* ===========================
   CARDS & SECTIONS
   =========================== */

.card,
.form-section,
.stats-card,
.strategy-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before,
.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card:hover::before,
.form-section:hover::before {
    opacity: 0.5;
}

.card:hover,
.form-section:hover {
    border-color: var(--border-normal);
    box-shadow: var(--shadow-md);
}

.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-light);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ===========================
   FORMS
   =========================== */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-tertiary);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--border-strong);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(7, 6, 4, 0.8);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23969695' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   BUTTONS
   =========================== */

.btn,
.submit-btn,
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 32px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn::before,
.submit-btn::before,
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn:hover::before,
.submit-btn:hover::before,
.btn-primary:hover::before {
    transform: translateX(100%);
}

.btn:hover,
.submit-btn:hover,
.btn-primary:hover {
    background: var(--accent-secondary);
    box-shadow: var(--shadow-accent);
    transform: translateY(-2px);
}

.btn:active,
.submit-btn:active,
.btn-primary:active {
    transform: translateY(0);
}

.btn:disabled,
.submit-btn:disabled,
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Secondary Button */
.btn-secondary,
.btn-cancel {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-normal);
}

.btn-secondary:hover,
.btn-cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
    box-shadow: none;
}

/* Create Strategy Button */
.btn-create-strategy {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-create-strategy:hover {
    background: var(--accent-secondary);
    box-shadow: var(--shadow-accent);
    transform: translateY(-2px);
}

/* ===========================
   CALENDAR STYLES
   =========================== */

.calendar-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.calendar-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.calendar-nav {
    display: flex;
    gap: var(--space-sm);
}

.calendar-nav button {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.calendar-nav button:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day-header {
    padding: var(--space-md);
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.calendar-day:hover {
    border-color: var(--border-normal);
    background: var(--bg-elevated);
    transform: scale(1.02);
}

.calendar-day.today {
    border-color: var(--accent-primary);
    box-shadow: inset 0 0 0 1px var(--accent-primary);
}

.calendar-day.has-trades {
    cursor: pointer;
}

.calendar-day.positive {
    background: var(--profit-bg);
    border-color: rgba(74, 222, 128, 0.3);
    box-shadow: 
        0 0 0 1px rgba(74, 222, 128, 0.1),
        0 4px 12px rgba(74, 222, 128, 0.15),
        inset 0 -20px 30px -10px rgba(74, 222, 128, 0.12);
    position: relative;
}

.calendar-day.positive::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(74, 222, 128, 0.15), transparent);
    pointer-events: none;
}

.calendar-day.positive:hover {
    box-shadow: 
        0 0 0 1px rgba(74, 222, 128, 0.4),
        0 6px 20px rgba(74, 222, 128, 0.3),
        inset 0 -25px 35px -10px rgba(74, 222, 128, 0.2);
    border-color: rgba(74, 222, 128, 0.5);
}

.calendar-day.negative {
    background: var(--loss-bg);
    border-color: rgba(248, 113, 113, 0.3);
    box-shadow: 
        0 0 0 1px rgba(248, 113, 113, 0.1),
        0 4px 12px rgba(248, 113, 113, 0.15),
        inset 0 -20px 30px -10px rgba(248, 113, 113, 0.12);
    position: relative;
}

.calendar-day.negative::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(248, 113, 113, 0.15), transparent);
    pointer-events: none;
}

.calendar-day.negative:hover {
    box-shadow: 
        0 0 0 1px rgba(248, 113, 113, 0.4),
        0 6px 20px rgba(248, 113, 113, 0.3),
        inset 0 -25px 35px -10px rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.5);
}

/* Legacy classes for backwards compatibility */
.calendar-day.profit {
    background: var(--profit-bg);
    border-color: rgba(74, 222, 128, 0.3);
}

.calendar-day.profit:hover {
    box-shadow: 0 0 20px var(--profit-glow);
}

.calendar-day.loss {
    background: var(--loss-bg);
    border-color: rgba(248, 113, 113, 0.3);
}

.calendar-day.loss:hover {
    box-shadow: 0 0 20px var(--loss-glow);
}

.day-number {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.day-pnl {
    font-size: 0.7rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 2px;
}

.day-pnl.positive {
    color: var(--profit);
}

.day-pnl.negative {
    color: var(--loss);
}

/* Monthly Stats */
.monthly-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-subtle);
}

.stat-item {
    text-align: center;
    padding: var(--space-lg);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.stat-item:hover {
    border-color: var(--border-normal);
}

.stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.stat-value.positive {
    color: var(--profit);
}

.stat-value.negative {
    color: var(--loss);
}

/* ===========================
   TABLES
   =========================== */

.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-normal);
}

th {
    padding: var(--space-lg) var(--space-md);
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--bg-hover);
}

td {
    padding: var(--space-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

td:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===========================
   MODALS
   =========================== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(7, 6, 4, 0.95);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: var(--space-xl);
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    position: relative;
    animation: modalIn var(--transition-base) ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-header h2 {
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-xl);
    border-top: 1px solid var(--border-subtle);
}

/* ===========================
   MESSAGES & ALERTS
   =========================== */

.success-message,
.error-message {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    border-radius: var(--radius-sm);
    animation: slideUp var(--transition-base) ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message {
    background: var(--profit-bg);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.error-message {
    background: var(--loss-bg);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.success-icon,
.error-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.success-icon {
    background: var(--profit);
    color: var(--bg-primary);
}

.error-icon {
    background: var(--loss);
    color: var(--bg-primary);
}

.success-content h4,
.error-content h4 {
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.success-content p,
.error-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===========================
   PROFILE PAGE
   =========================== */

.profile-container {
    max-width: 1200px;
    margin: 0 auto;
}

.profile-header {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-2xl);
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--bg-primary);
}

.profile-info h1 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.profile-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.strategies-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-2xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.strategies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.strategy-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: var(--space-xl);
    cursor: pointer;
    transition: all var(--transition-base);
}

.strategy-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-accent);
    transform: translateY(-4px);
}

.strategy-card h3 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
    color: var(--accent-light);
}

.strategy-meta {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    color: var(--text-tertiary);
}

.empty-state h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

/* ===========================
   LOG TRADE PAGE - ENHANCED STYLES
   =================================== */

.page-header {
    text-align: left;
    margin-bottom: 40px;
}

.page-title {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-light);
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.trade-form {
    max-width: 1200px;
    margin: 0 auto;
}

.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .form-grid-2col {
        grid-template-columns: 1fr;
    }
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    padding: 28px;
    position: relative;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary) 0%, transparent 100%);
}

.form-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-light);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 500px) {
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'JetBrains Mono', monospace;
    transition: all var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--border-strong);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-tertiary);
}

.form-input-readonly {
    background: var(--bg-elevated);
    color: var(--accent-light);
    cursor: not-allowed;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

/* Rules Checklist */
.rules-checklist {
    background: var(--bg-primary);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-sm);
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 12px;
}

/* Rules Header for Total Points */
.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-sm);
    margin-top: 8px;
    margin-bottom: 12px;
}

.rules-header-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

#rule-points-display {
    font-size: 1.1rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--text-primary);
    transition: all var(--transition-base);
}

/* Daily Rules Checklist */
.daily-rules-checklist {
    background: var(--bg-primary);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-sm);
    padding: 12px;
    max-height: 280px;
    overflow-y: auto;
}

.daily-rule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all var(--transition-base);
    cursor: pointer;
}

.daily-rule-item:last-child {
    margin-bottom: 0;
}

.daily-rule-item:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.daily-rule-item.checked {
    border-color: var(--profit);
    background: var(--profit-bg);
}

.daily-rule-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--border-strong);
    border-radius: 4px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.daily-rule-checkbox input[type="checkbox"] {
    display: none;
}

.daily-rule-checkbox::after {
    content: '✓';
    font-size: 14px;
    font-weight: bold;
    color: var(--profit);
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-fast);
}

.daily-rule-item.checked .daily-rule-checkbox {
    background: var(--profit);
    border-color: var(--profit);
}

.daily-rule-item.checked .daily-rule-checkbox::after {
    opacity: 1;
    transform: scale(1);
    color: var(--bg-primary);
}

.daily-rule-text {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.daily-rule-item.checked .daily-rule-text {
    color: var(--profit);
}

/* Daily Rules Status */
.daily-rules-status {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.daily-rules-status.incomplete {
    border-color: var(--loss);
    background: var(--loss-bg);
}

.daily-rules-status.complete {
    border-color: var(--profit);
    background: var(--profit-bg);
}

.daily-rules-status-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.daily-rules-status.incomplete .daily-rules-status-text {
    color: var(--loss);
}

.daily-rules-status.complete .daily-rules-status-text {
    color: var(--profit);
}

.daily-rules-count {
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

/* Trade Rules Slider Styling - Enhanced */
.rule-slider-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-bottom: 10px;
    transition: all var(--transition-base);
    position: relative;
}

.rule-slider-container:last-child {
    margin-bottom: 0;
}

.rule-slider-container:hover {
    border-left-color: var(--accent-light);
    background: var(--bg-elevated);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rule-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rule-slider-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    flex: 1;
}

.rule-slider-score {
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-weight: 700;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    min-width: 65px;
    text-align: center;
    transition: all var(--transition-base);
}

.rule-slider-input {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-base);
}

.rule-slider-input::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--loss) 0%, var(--warning) 50%, var(--profit) 100%);
    border-radius: 3px;
    opacity: 0.25;
    transition: opacity var(--transition-base);
}

.rule-slider-input:hover::-webkit-slider-runnable-track {
    opacity: 0.4;
}

.rule-slider-input::-moz-range-track {
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--loss) 0%, var(--warning) 50%, var(--profit) 100%);
    border-radius: 3px;
    opacity: 0.25;
}

.rule-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border: 2px solid var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 2px 6px rgba(101, 77, 45, 0.4);
    position: relative;
    margin-top: -6px;
}

.rule-slider-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border: 2px solid var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 2px 6px rgba(101, 77, 45, 0.4);
}

.rule-slider-input::-webkit-slider-thumb:hover {
    background: var(--accent-light);
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(101, 77, 45, 0.6);
}

.rule-slider-input::-moz-range-thumb:hover {
    background: var(--accent-light);
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(101, 77, 45, 0.6);
}

.rule-slider-input:active::-webkit-slider-thumb {
    transform: scale(1.05);
}

.rule-slider-input:active::-moz-range-thumb {
    transform: scale(1.05);
}

/* Star Rating in Trade Form */
.rule-star-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 10px;
    transition: all var(--transition-base);
}
.rule-star-container:last-child { margin-bottom: 0; }
.rule-star-container:hover {
    border-left-color: var(--accent-light);
    background: var(--bg-elevated);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.rule-star-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.rule-star-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    flex: 1;
}
.rule-star-score {
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-weight: 700;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    min-width: 55px;
    text-align: center;
    transition: all var(--transition-base);
}
.rule-star-row {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}
.rule-star-img {
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
    user-select: none;
    -webkit-user-drag: none;
}
.rule-star-img:hover {
    transform: scale(1.2);
    filter: brightness(1.3);
}

/* Star selector in strategy modal (profile) */
.star-selector {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 6px 0;
}
.star-selector img {
    cursor: pointer;
    transition: transform 0.15s ease;
    user-select: none;
    -webkit-user-drag: none;
}
.star-selector img:hover {
    transform: scale(1.2);
}

/* Compact star layout in log-trade redesign */
.lt-form .rule-star-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0 12px;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
}
.lt-form .rule-star-header {
    display: contents;
}
.lt-form .rule-star-name {
    order: 1;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lt-form .rule-star-row {
    order: 2;
}
.lt-form .rule-star-score {
    order: 3;
    font-size: 0.7rem;
    min-width: 48px;
}

/* Score Display Section - Enhanced */
.score-section {
    position: relative;
    overflow: visible;
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-elevated) 100%);
    border: 2px solid var(--border-normal);
    border-radius: var(--radius-md);
    position: relative;
}

.score-value {
    font-size: 3.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
    transition: all var(--transition-base);
}

.score-value.score-high {
    color: var(--profit);
    text-shadow: 0 0 20px var(--profit-glow);
}

.score-value.score-medium {
    color: var(--warning);
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.score-value.score-low {
    color: var(--loss);
    text-shadow: 0 0 20px var(--loss-glow);
}

.score-breakdown {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-align: center;
}

/* Grade Display - Beautiful Badge System */
.grade-display-container {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    display: none; /* Hidden by default, shown via JS */
}

.grade-badge-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.grade-badge {
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.grade-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.grade-letter {
    font-size: 2.5rem;
    font-weight: 900;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.02em;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.grade-info {
    flex: 1;
    text-align: left;
}

.grade-description {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.grade-threshold {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* Grade A+ - Elite (Brilliant Green) */
.grade-badge.grade-a-plus {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 2px solid #34d399;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.grade-badge.grade-a-plus .grade-letter {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.grade-badge.grade-a-plus:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.5);
}

/* Grade A - Excellent (Bright Green) */
.grade-badge.grade-a {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: 2px solid #4ade80;
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.4);
}

.grade-badge.grade-a .grade-letter {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.grade-badge.grade-a:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(34, 197, 94, 0.5);
}

/* Grade B - Good (Yellow/Gold) */
.grade-badge.grade-b {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 2px solid #fbbf24;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

.grade-badge.grade-b .grade-letter {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.grade-badge.grade-b:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(245, 158, 11, 0.5);
}

/* Grade C - Acceptable (Orange) */
.grade-badge.grade-c {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border: 2px solid #fb923c;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4);
}

.grade-badge.grade-c .grade-letter {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.grade-badge.grade-c:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(249, 115, 22, 0.5);
}

/* Grade D - Poor (Red-Orange) */
.grade-badge.grade-d {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: 2px solid #f87171;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

.grade-badge.grade-d .grade-letter {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.grade-badge.grade-d:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.5);
}

/* Grade F - Failed (Dark Red) */
.grade-badge.grade-f {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border: 2px solid #ef4444;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}

.grade-badge.grade-f .grade-letter {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.grade-badge.grade-f:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.5);
}

/* ===========================
   RESPONSIVE - SIDEBAR NAVIGATION
   =========================== */

@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
        width: 220px;
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-sidebar.collapsed {
        width: 220px;
    }

    .app-sidebar.collapsed .sidebar-logo-text,
    .app-sidebar.collapsed .sidebar-nav-item span,
    .app-sidebar.collapsed .sidebar-collapse-label {
        opacity: 1;
        width: auto;
    }

    .app-sidebar.collapsed .sidebar-nav-item,
    .app-sidebar.collapsed .sidebar-collapse-btn {
        justify-content: flex-start;
        padding: 10px 14px;
        gap: 12px;
    }

    .app-sidebar.collapsed .sidebar-collapse-btn svg {
        transform: none;
    }

    .app-main {
        margin-left: 0;
    }

    .app-sidebar.collapsed + .app-main {
        margin-left: 0;
    }

    .sidebar-mobile-toggle {
        display: flex;
    }

    .sidebar-collapse-btn {
        display: none;
    }

    .container {
        padding: calc(60px + env(safe-area-inset-top, 0px)) 14px 40px;
    }
}
