/* ============================================
   MAIN.CSS - Base & Root Styles
   These are global styles used across the site
   ============================================ */

/* ----- Reset & Base ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ----- Font Face Definitions ----- */
@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   ROOT VARIABLES - Complete Dashboard Palette
   ============================================ */
:root {
    /* Background - Clean & Readable Stone */
    --bg-primary: #e8e2da;
    --bg-secondary: #f0ebe5;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f5f0;
    
    /* Text Colors - Rich & High Contrast */
    --text-primary: #1a2e26;
    --text-secondary: #2d4d42;
    --text-muted: #5a7a6a;
    --text-light: #7a9a8a;
    --text-white: #f0f8f4;
    
    /* Borders - Clear & Defined */
    --border-light: #d5cdc4;
    --border-medium: #c0b6aa;
    --border-strong: #a89c90;
    
    /* Shadows - Clear & Crisp */
    --shadow-sm: 0 2px 12px rgba(40, 35, 30, 0.10);
    --shadow-md: 0 4px 24px rgba(40, 35, 30, 0.14);
    --shadow-lg: 0 8px 40px rgba(40, 35, 30, 0.18);
    --shadow-xl: 0 12px 56px rgba(40, 35, 30, 0.22);
    
    /* Radius */
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    
    /* ============================================
       TYPOGRAPHY SYSTEM - Comprehensive
       ============================================ */
    /* Base Sizes */
    --font-size-base: 16px;
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-md: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.75rem;   /* 28px */
    --font-size-4xl: 2rem;      /* 32px */
    
    /* Font Weights */
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* Line Heights */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Heading Sizes */
    --h1-size: var(--font-size-3xl);
    --h2-size: var(--font-size-2xl);
    --h3-size: var(--font-size-xl);
    --h4-size: var(--font-size-lg);
    --h5-size: var(--font-size-md);
    --h6-size: var(--font-size-sm);
    
    /* Body Text */
    --body-size: var(--font-size-md);
    --body-small: var(--font-size-sm);
    --body-xs: var(--font-size-xs);
    
    /* Label Sizes */
    --label-size: var(--font-size-sm);
    --label-small: var(--font-size-xs);
    
    /* Input Sizes */
    --input-size: var(--font-size-md);
    --input-small: var(--font-size-sm);
    
    /* Button Sizes */
    --btn-size: var(--font-size-md);
    --btn-small: var(--font-size-sm);
    
    /* Card Title Sizes */
    --card-title-size: var(--font-size-lg);
    --card-subtitle-size: var(--font-size-sm);
    --card-amount-size: var(--font-size-2xl);
    --card-amount-large: var(--font-size-3xl);
    
    /* List Item Sizes */
    --list-title-size: var(--font-size-md);
    --list-subtitle-size: var(--font-size-sm);
    --list-meta-size: var(--font-size-xs);
    
    /* Chart Sizes */
    --chart-title-size: var(--font-size-md);
    --chart-subtitle-size: var(--font-size-sm);
    
    /* Navigation */
    --nav-link-size: var(--font-size-sm);
    
    /* Primary Colors - Strong Green & Blue */
    --primary-green: #1a8a6a;
    --primary-green-dark: #0d6e52;
    --primary-green-light: #3aac88;
    --primary-green-bg: #d8f0e8;
    --primary-green-border: #80c8b0;
    
    --primary-blue: #3a8aaa;
    --primary-blue-dark: #25708e;
    --primary-blue-light: #5aaaca;
    --primary-blue-bg: #dcecf4;
    --primary-blue-border: #80bcd8;
    
    /* Card Colors - Strong Vibrant Variations */
    --income-color: #1a8a6a;
    --income-bg: #d8f0e8;
    --income-border: #70c0a8;
    --income-light: #b8e0d4;
    
    --expense-color: #d9604a;
    --expense-bg: #f8e4de;
    --expense-border: #e8b8aa;
    --expense-light: #f0d0c8;
    
    --saving-color: #2a7ab8;
    --saving-bg: #dcecf8;
    --saving-border: #80b8dc;
    --saving-light: #b8d8ec;
    
    --debt-color: #d48a3a;
    --debt-bg: #f8ecdc;
    --debt-border: #e8cc9a;
    --debt-light: #f0dcc8;
    
    --claim-color: #6a5ab8;
    --claim-bg: #ece8f8;
    --claim-border: #c0b4e8;
    --claim-light: #dcd4f0;
    
    /* Installment - Improved Contrast */
    --installment-color: #a0406a;
    --installment-bg: #fce8ee;
    --installment-border: #e8b4c8;
    --installment-light: #f0d0dc;
    --installment-text: #7a2a4a;
    
    --dollar-color: #1a8a72;
    --dollar-bg: #d8f4ec;
    --dollar-border: #78c8b4;
    --dollar-light: #b8e8dc;
    
    --nav-active: #1a8a6a;
    --nav-hover: #c8e8dc;
    --nav-text: #f0f8f4;
    
    /* Legacy/Compatibility variables */
    --primary: #1a8a6a;
    --primary-dark: #0d6e52;
    --primary-gradient: linear-gradient(145deg, #1a8a6a, #0d6e52);
    --bg-color: #e8e2da;
    --border-color: #d5cdc4;
    --shadow: 0 2px 8px rgba(40, 35, 30, 0.08);
    --shadow-hover: 0 4px 16px rgba(40, 35, 30, 0.14);
    --radius: 12px;
    --font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    --direction: rtl;
    --transition: all 0.3s ease;
}

/* ============================================
   TYPOGRAPHY - Global Styles
   ============================================ */

/* Base Body */
body {
    font-family: var(--font-family);
    font-size: var(--body-size);
    font-weight: var(--font-weight-regular);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: var(--line-height-normal);
    direction: var(--direction);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1 { 
    font-size: var(--h1-size); 
    font-weight: var(--font-weight-extrabold);
    color: var(--text-primary);
    line-height: var(--line-height-tight);
}
h2 { 
    font-size: var(--h2-size); 
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    line-height: var(--line-height-tight);
}
h3 { 
    font-size: var(--h3-size); 
    font-weight: var(--font-weight-bold);
    color: var(--text-secondary);
    line-height: var(--line-height-tight);
}
h4 { 
    font-size: var(--h4-size); 
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    line-height: var(--line-height-tight);
}
h5 { 
    font-size: var(--h5-size); 
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    line-height: var(--line-height-tight);
}
h6 { 
    font-size: var(--h6-size); 
    font-weight: var(--font-weight-medium);
    color: var(--text-muted);
    line-height: var(--line-height-tight);
}

/* Paragraphs */
p { 
    font-size: var(--body-size);
    line-height: var(--line-height-relaxed);
    color: var(--text-secondary);
}

/* Small Text */
small { 
    font-size: var(--body-small);
    color: var(--text-muted);
}

/* Labels */
label {
    font-size: var(--label-size);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
}

/* Links */
a {
    color: var(--primary-green);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

/* Utility Text Classes */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

.text-regular { font-weight: var(--font-weight-regular); }
.text-medium { font-weight: var(--font-weight-medium); }
.text-semibold { font-weight: var(--font-weight-semibold); }
.text-bold { font-weight: var(--font-weight-bold); }
.text-extrabold { font-weight: var(--font-weight-extrabold); }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-white { color: var(--text-white); }

/* ============================================
   APP CONTAINER
   ============================================ */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 30px;
}

/* ============================================
   HEADER - Shared Across All Pages
   ============================================ */
.header {
    background: linear-gradient(145deg, #0d3328 0%, #1a6a50 50%, #0d5a42 100%);
    color: var(--text-white);
    padding: 0;
    margin: 0 -20px 5px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(13, 51, 40, 0.25);
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 50%;
    height: 200%;
    background: radial-gradient(circle, rgba(26, 138, 106, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.header-left h1 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.5px;
    margin: 0;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-left h1 .logo-icon {
    font-size: var(--font-size-2xl);
}

.header-date {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--body-small);
    opacity: 0.92;
    flex-wrap: wrap;
}

.header-date .date-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(240, 248, 244, 0.10);
    padding: 4px 14px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    font-weight: var(--font-weight-medium);
    border: 1px solid rgba(240, 248, 244, 0.08);
}

.header-date .separator {
    opacity: 0.2;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info .username {
    font-weight: var(--font-weight-medium);
    opacity: 0.95;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--body-small);
}

.user-info .username .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(240, 248, 244, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-md);
    border: 1px solid rgba(240, 248, 244, 0.08);
}

.logout-btn {
    background: rgba(240, 248, 244, 0.10);
    border: 1px solid rgba(240, 248, 244, 0.12);
    color: var(--text-white);
    padding: 8px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: var(--body-small);
    font-weight: var(--font-weight-medium);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 6px;
}

.logout-btn:hover {
    background: rgba(240, 248, 244, 0.22);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================
   NAVIGATION - Shared Across All Pages
   ============================================ */
.main-nav {
    background: var(--bg-card);
    padding: 8px 12px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border: 1px solid var(--border-light);
}

.main-nav::-webkit-scrollbar {
    height: 4px;
}

.main-nav::-webkit-scrollbar-track {
    background: transparent;
}

.main-nav::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 10px;
}

.nav-content {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    min-width: min-content;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: var(--font-weight-medium);
    font-size: var(--nav-link-size);
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    background: var(--nav-hover);
    color: var(--primary-green-dark);
    transform: translateY(-1px);
}

.nav-link.active {
    background: linear-gradient(145deg, var(--primary-green), var(--primary-green-dark));
    color: var(--nav-text);
    box-shadow: 0 4px 15px rgba(26, 138, 106, 0.30);
}

.nav-link.active:hover {
    box-shadow: 0 6px 25px rgba(26, 138, 106, 0.40);
    transform: translateY(-2px);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.flex { display: flex; }
.flex-center { 
    display: flex;
    justify-content: center;
    align-items: center;
}
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.flex-column {
    display: flex;
    flex-direction: column;
}
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.hidden { display: none !important; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ----- Scrollbar ----- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d5cdc4;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c0b6aa;
}

/* ----- Loading State ----- */
.loading {
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
    font-size: var(--body-small);
}

/* ----- Empty State ----- */
.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 30px 0;
    font-size: var(--body-small);
}

/* ============================================
   MESSAGES
   ============================================ */
.message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: none;
    font-size: var(--body-small);
    font-weight: var(--font-weight-semibold);
}

.message.success {
    display: block;
    background: var(--income-bg);
    color: var(--income-color);
    border: 1px solid var(--income-border);
}

.message.error {
    display: block;
    background: var(--expense-bg);
    color: var(--expense-color);
    border: 1px solid var(--expense-border);
}

.message.info {
    display: block;
    background: var(--saving-bg);
    color: var(--saving-color);
    border: 1px solid var(--saving-border);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--btn-size);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: var(--line-height-tight);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: 2px solid var(--primary-green-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 138, 106, 0.35);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--border-light);
}

.btn-secondary:hover {
    background: #e8e0d8;
    transform: translateY(-2px);
    border-color: var(--border-medium);
}

.btn-small {
    padding: 8px 16px;
    font-size: var(--btn-small);
}

.btn-danger {
    background: var(--expense-bg);
    color: var(--expense-color);
    border: 2px solid var(--expense-border);
}

.btn-danger:hover {
    background: #ffcdd2;
    border-color: var(--expense-color);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: var(--label-size);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    display: block;
}

.form-group label .required {
    color: var(--expense-color);
    font-weight: var(--font-weight-bold);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 11px 14px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: var(--input-size);
    font-family: inherit;
    font-weight: var(--font-weight-medium);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    line-height: var(--line-height-tight);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(58, 138, 170, 0.15);
    background: var(--bg-card);
}

.form-group input::placeholder {
    color: var(--text-light);
    font-weight: var(--font-weight-regular);
}

.form-group input[type="text"] {
    direction: ltr;
    text-align: right;
}

.form-group small {
    margin-top: 5px;
    font-size: var(--body-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-muted);
    display: block;
}

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

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    padding: 18px 0 4px 0;
    border-top: 2px solid var(--border-light);
    margin-top: 14px;
}

.pagination .page-btn {
    padding: 9px 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    font-size: var(--body-small);
    font-weight: var(--font-weight-semibold);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.pagination .page-btn:hover:not(:disabled) {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(58, 138, 170, 0.25);
}

.pagination .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

.pagination #pageInfo {
    font-size: var(--body-small);
    color: var(--text-secondary);
    font-weight: var(--font-weight-bold);
    padding: 0 8px;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.2px;
}

.badge-success { 
    background: var(--income-bg); 
    color: var(--income-color); 
    border: 1px solid var(--income-border);
}
.badge-warning { 
    background: var(--debt-bg); 
    color: var(--debt-color); 
    border: 1px solid var(--debt-border);
}
.badge-info { 
    background: var(--claim-bg); 
    color: var(--claim-color); 
    border: 1px solid var(--claim-border);
}
.badge-danger { 
    background: var(--expense-bg); 
    color: var(--expense-color); 
    border: 1px solid var(--expense-border);
}

.badge-today {
    background: #fed7d7;
    color: #c53030;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}
.badge-soon {
    background: #fefcbf;
    color: #975a16;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}
.badge-week {
    background: #c6f6d5;
    color: #276749;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}
.badge-normal {
    background: #e2e8f0;
    color: #4a5568;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}
.badge-overdue {
    background: #fed7d7;
    color: #c53030;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}

/* ============================================
   INSTALLMENT SPECIFIC STYLES - Improved Contrast
   ============================================ */
.installment-card,
.installment-item {
    background: var(--bg-card);
    border: 1px solid var(--installment-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.installment-card:hover,
.installment-item:hover {
    background: var(--installment-bg);
    border-color: var(--installment-color);
    box-shadow: var(--shadow-sm);
}

.installment-title {
    color: var(--installment-color);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-md);
}

.installment-amount {
    color: var(--installment-text);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
}

.installment-date {
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

.installment-status {
    color: var(--installment-text);
    font-weight: var(--font-weight-semibold);
}

/* ============================================
   RESPONSIVE - Shared Components
   ============================================ */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 16px 18px;
        gap: 10px;
    }

    .header-left {
        align-items: center;
    }

    .header-left h1 {
        font-size: var(--font-size-lg);
    }

    .header-date {
        justify-content: center;
        font-size: var(--font-size-xs);
        gap: 8px;
    }

    .header-date .date-item {
        padding: 3px 10px;
    }

    .user-info {
        justify-content: center;
        gap: 10px;
    }

    .user-info .username {
        font-size: var(--body-xs);
    }

    .logout-btn {
        padding: 6px 16px;
        font-size: var(--body-xs);
    }

    .main-nav {
        padding: 6px 10px;
        border-radius: var(--radius-md);
    }

    .nav-link {
        padding: 8px 14px;
        font-size: var(--font-size-xs);
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 0 12px 20px;
    }
    
    .header {
        margin: 0 -12px 5px;
    }
    
    .header-content {
        padding: 12px 14px;
    }

    .header-left h1 {
        font-size: var(--font-size-md);
    }

    .header-date {
        font-size: var(--font-size-xs);
        gap: 4px;
    }

    .header-date .separator {
        display: none;
    }

    .header-date .date-item {
        padding: 2px 8px;
        font-size: var(--font-size-xs);
    }

    .main-nav {
        padding: 4px 6px;
        border-radius: var(--radius-sm);
    }

    .nav-content {
        gap: 2px;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: var(--font-size-xs);
        border-radius: var(--radius-sm);
    }
}

/* ============================================
   PRINT STYLES - Shared Components
   ============================================ */
@media print {
    .header {
        background: var(--primary-green) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .logout-btn,
    .main-nav {
        display: none !important;
    }
    
    .app-container {
        background: white !important;
    }

    .no-print { display: none !important; }
}

/* ============================================
   ADDITIONS FOR LOGIN PAGE
   ============================================ */

/* Ensure login page doesn't inherit unwanted styles */
.login-container,
.login-box,
.login-form {
    all: initial;
}

.login-container {
    all: revert;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #e8e2da 0%, #d5cdc4 100%);
    padding: 20px;
    font-family: var(--font-family);
}

.login-box {
    all: revert;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-light);
    font-family: var(--font-family);
}

.login-box * {
    box-sizing: border-box;
}

.login-header {
    all: revert;
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    all: revert;
    font-size: var(--h1-size);
    font-weight: var(--font-weight-extrabold);
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: var(--font-family);
}

.login-header p {
    all: revert;
    font-size: var(--body-small);
    color: var(--text-muted);
    margin: 0;
    font-family: var(--font-family);
}

.login-form {
    all: revert;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form .form-group {
    all: revert;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.login-form label {
    all: revert;
    font-size: var(--label-size);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    font-family: var(--font-family);
}

.login-form input {
    all: revert;
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: var(--input-size);
    font-family: var(--font-family);
    background: var(--bg-card);
    color: var(--text-primary);
    direction: ltr;
    text-align: right;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(26, 138, 106, 0.12);
}

.login-form input::placeholder {
    color: var(--text-light);
}

.login-btn {
    all: revert;
    width: 100%;
    padding: 14px;
    background: linear-gradient(145deg, var(--primary-green), var(--primary-green-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--btn-size);
    font-weight: var(--font-weight-bold);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(26, 138, 106, 0.25);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(26, 138, 106, 0.35);
}

.login-footer {
    all: revert;
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 2px solid var(--border-light);
}

.login-footer small {
    all: revert;
    font-size: var(--body-xs);
    color: var(--text-muted);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
}