* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e8eef7 0%, #d9e2f3 100%);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    z-index: -1;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    display: none;
}

.login-header h1 {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, #4a72b8 0%, #2e5a9e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.login-header p {
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form input {
    width: 100%;
    padding: 15px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    font-size: 16px;
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
}

.btn-login {
    padding: 15px;
    background: linear-gradient(135deg, #4a72b8, #2e5a9e);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(74, 114, 184, 0.3);
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 114, 184, 0.4);
}

.login-hint {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

/* Sidebar Layout */
.main-app-sidebar {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 25px 20px;
    background: linear-gradient(135deg, #4a72b8, #2e5a9e);
    color: white;
    text-align: center;
    border-bottom: 3px solid rgba(255, 255, 255, 0.3);
}

.sidebar-header i {
    display: none;
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
}

.sidebar-user {
    padding: 20px;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-user i {
    font-size: 40px;
    color: #6b7280;
}

.user-name {
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-change-password {
    background: transparent;
    color: #9ca3af;
    border: 1px solid #d1d5db;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-change-password:hover {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #9ca3af;
}

.sidebar-nav {
    flex: 1;
    padding: 10px;
}

.sidebar-btn {
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 5px;
    border: none;
    background: transparent;
    color: #374151;
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

.sidebar-btn i {
    width: 24px;
    font-size: 20px;
}

.sidebar-btn:hover {
    background: #f3f4f6;
}

.sidebar-btn.active {
    background: linear-gradient(135deg, #4a72b8, #2e5a9e);
    color: white;
}

.btn-logout-sidebar {
    margin: 20px;
    padding: 12px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.page-title {
    color: #1f2937;
    font-size: 28px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #4a72b8;
}

/* Compact Grid Layout */
.compact-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 15px;
    height: calc(100vh - 150px);
}

.compact-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.compact-card h3 {
    color: #1f2937;
    font-size: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.entries-scroll {
    overflow-y: auto;
}

/* Form Compact */
.form-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-compact {
    padding: 12px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
}

.input-income-compact {
    padding: 12px;
    border: 2px solid #10b981;
    border-radius: 8px;
    font-size: 15px;
}

.input-expense-compact {
    padding: 12px;
    border: 2px solid #ef4444;
    border-radius: 8px;
    font-size: 15px;
}

.btn-primary-compact {
    padding: 12px;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Entries Compact */
.entries-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.entry-item-compact {
    background: linear-gradient(135deg, #dbeafe, #e9d5ff);
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #93c5fd;
    font-size: 13px;
}

.entry-amounts-compact {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.entry-date-compact {
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    padding: 2px 6px;
    background: white;
    border-radius: 4px;
    white-space: nowrap;
}

.amount-income {
    color: #059669;
    font-weight: 700;
    font-size: 14px;
}

.amount-expense {
    color: #dc2626;
    font-weight: 700;
    font-size: 14px;
}

.entry-info-compact {
    font-size: 12px;
    color: #374151;
    margin-top: 3px;
}

.btn-edit-entry,
.btn-delete-entry {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.btn-edit-entry {
    background: #3b82f6;
    color: white;
}

.btn-edit-entry:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.btn-delete-entry {
    background: #ef4444;
    color: white;
}

.btn-delete-entry:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Month Selector Compact */
.month-selector-compact {
    background: rgba(255, 255, 255, 0.98);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.month-selector-compact label {
    color: #1f2937;
    font-weight: 600;
    font-size: 16px;
}

.live-indicator {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #10b981;
    font-size: 13px;
    font-weight: 600;
}

.live-indicator i {
    font-size: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Stats Grid Compact */
.stats-grid-compact {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.stat-card-compact {
    background: white;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid;
    min-height: 85px;
    transition: all 0.2s;
}

.stat-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-card-compact i {
    font-size: 20px;
    margin-bottom: 6px;
}

.stat-income {
    border-color: #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.stat-income i {
    color: #10b981;
}

.stat-expense {
    border-color: #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.stat-expense i {
    color: #ef4444;
}

.stat-fixed {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.stat-fixed i {
    color: #f59e0b;
}

.stat-profit {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.stat-profit i {
    color: #3b82f6;
}

.stat-year-profit {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
}

.stat-year-profit i {
    color: #8b5cf6;
}

.stat-label {
    font-size: 10px;
    color: #6b7280;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value-compact {
    font-size: 16px;
    font-weight: 800;
    color: #1f2937;
}

/* Suppliers Grid Compact */
.suppliers-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.supplier-card-compact {
    background: rgba(255, 255, 255, 0.98);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.supplier-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.supplier-actions {
    display: flex;
    gap: 6px;
}

.btn-edit, .btn-delete-small {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-edit {
    background: #3b82f6;
    color: white;
}

.btn-delete-small {
    background: #ef4444;
    color: white;
}

/* Fixed Expenses Grid */
.fixed-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.fixed-card-compact {
    background: rgba(255, 255, 255, 0.98);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fixed-info h4 {
    color: #1f2937;
    font-size: 14px;
    margin-bottom: 4px;
}

.fixed-amount {
    color: #f59e0b;
    font-weight: 700;
    font-size: 16px;
}

/* Users Grid */
.users-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.user-card-compact {
    background: rgba(255, 255, 255, 0.98);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info h4 {
    color: #1f2937;
    font-size: 14px;
    margin-bottom: 4px;
}

.user-role {
    color: #6b7280;
    font-size: 12px;
}

.btn-add-top {
    background: linear-gradient(135deg, #10b981, #3b82f6);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    cursor: pointer;
    color: #6b7280;
}

#modalTitle {
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 20px;
}

#modalBody input, #modalBody select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    font-size: 16px;
}

#modalBody button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}

.empty-state {
    text-align: center;
    color: #6b7280;
    padding: 20px;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 1400px) {
    .stats-grid-compact {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stat-card-compact:nth-child(4),
    .stat-card-compact:nth-child(5) {
        grid-column: span 1;
    }
}

@media (max-width: 1200px) {
    .compact-grid {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .stats-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-header h2,
    .sidebar-user div,
    .sidebar-btn span {
        display: none;
    }
    
    .sidebar-btn {
        justify-content: center;
    }
    
    .stats-grid-compact {
        grid-template-columns: 1fr;
    }
    
    .stat-card-compact {
        padding: 10px;
        min-height: 70px;
    }
    
    .stat-card-compact i {
        font-size: 16px;
    }
    
    .stat-value-compact {
        font-size: 14px;
    }
    
    .stat-label {
        font-size: 9px;
    }
    
    .month-selector-compact {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .live-indicator {
        margin-left: 0;
        justify-content: center;
    }
    
    .content-area {
        padding: 10px;
    }
}