/* ==================== GLOBAL STYLES ==================== */
:root {
    --primary-color: #1e40af;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --sidebar-width: 280px;
    --topbar-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--light-color);
    line-height: 1.6;
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    display: flex;
    width: 90%;
    max-width: 1200px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-box {
    flex: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.login-header .logo i {
    font-size: 48px;
    color: var(--primary-color);
}

.login-header h1 {
    font-size: 32px;
    color: var(--primary-color);
    margin: 0;
}

.login-header .tagline {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    flex: 1;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn-primary, .btn-secondary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    margin-bottom: 20px;
}

.btn-primary:hover {
    background: #1e3a8a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    margin-bottom: 12px;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: white;
    padding: 0 16px;
    position: relative;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-footer {
    margin-top: 40px;
    text-align: center;
}

.language-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.lang-btn.active,
.lang-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.copyright {
    font-size: 12px;
    color: var(--text-secondary);
}

.login-info {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px;
    color: white;
    display: flex;
    align-items: center;
}

.info-content h2 {
    font-size: 32px;
    margin-bottom: 40px;
}

.feature-list {
    display: grid;
    gap: 30px;
}

.feature-item {
    display: flex;
    gap: 20px;
}

.feature-item i {
    font-size: 36px;
    opacity: 0.9;
}

.feature-item h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.5;
}

/* ==================== DASHBOARD LAYOUT ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--dark-color);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
}

.sidebar-header .logo i {
    color: var(--secondary-color);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item a:hover,
.nav-item.active a {
    background: rgba(59, 130, 246, 0.1);
    color: white;
    border-left: 3px solid var(--secondary-color);
}

.nav-item i {
    font-size: 18px;
    width: 24px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--light-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 250px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--light-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--border-color);
}

.btn-icon .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* ==================== CONTENT WRAPPER ==================== */
.content-wrapper {
    padding: 30px;
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.stat-card.blue .stat-icon { background: var(--primary-color); }
.stat-card.green .stat-icon { background: var(--success-color); }
.stat-card.orange .stat-icon { background: var(--warning-color); }
.stat-card.purple .stat-icon { background: #8b5cf6; }

.stat-info h3 {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

.card-body {
    padding: 24px;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.activity-item {
    display: flex;
    gap: 16px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.activity-icon.blue { background: var(--primary-color); }
.activity-icon.green { background: var(--success-color); }
.activity-icon.orange { background: var(--warning-color); }
.activity-icon.purple { background: #8b5cf6; }

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.activity-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 4px;
}

.activity-time {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Task List */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s;
}

.task-item:hover {
    background: var(--light-color);
}

.task-item input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.task-item label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.task-priority {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.task-priority.high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.task-priority.medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.task-priority.low {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.action-btn {
    padding: 20px;
    background: var(--light-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.action-btn:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-btn i {
    font-size: 32px;
}

.action-btn span {
    font-weight: 500;
    font-size: 14px;
}

/* ==================== TABLE STYLES ==================== */
.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table th,
.transactions-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.transactions-table th {
    background: var(--light-color);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transactions-table tbody tr {
    transition: background-color 0.2s;
}

.transactions-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.transactions-table td {
    font-size: 14px;
    color: var(--text-primary);
}

.transactions-table code {
    background: var(--light-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.transactions-table strong {
    font-weight: 700;
    color: var(--text-primary);
}

/* Amount styling */
.transactions-table td[style*="color: var(--success-color)"],
.transactions-table td[style*="color: var(--danger-color)"] {
    font-weight: 600;
}

/* Filter Bar */
.filter-bar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-bar select,
.filter-bar input[type="date"],
.filter-bar input[type="text"] {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Budget Cards */
.budget-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.budget-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.budget-card h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.budget-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.budget-card small {
    font-size: 12px;
    font-weight: 600;
}

.budget-card.income {
    border-left-color: var(--success-color);
}

.budget-card.expense {
    border-left-color: var(--danger-color);
}

.budget-card.balance {
    border-left-color: var(--primary-color);
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

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

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-row label .required {
    color: var(--danger-color);
    margin-left: 4px;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-row textarea {
    resize: vertical;
    min-height: 80px;
}

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

.btn-cancel {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: var(--light-color);
}

.btn-submit {
    padding: 10px 20px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: var(--primary-dark);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .login-container {
        flex-direction: column;
    }

    .login-info {
        display: none;
    }
}

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

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

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
}
