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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Auth Page */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 40px;
    padding: 50px 40px;
    width: 100%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.logo-icon i {
    font-size: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-card h1 {
    font-size: 32px;
    margin-top: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 30px;
}

.tab-bar {
    display: flex;
    gap: 10px;
    background: #f0f0f0;
    padding: 5px;
    border-radius: 50px;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-radius: 40px;
    transition: 0.3s;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-container {
    display: none;
}

.form-container.active {
    display: block;
}

.form-container input {
    width: 100%;
    padding: 15px 18px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 15px;
}

.form-container input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.error-msg {
    background: #fee;
    color: #e74c3c;
    padding: 12px;
    border-radius: 15px;
    margin-top: 20px;
    display: none;
}

/* Navbar */
.navbar {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.role-tag {
    background: #e0e7ff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
}

.logout-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
}

.logout-btn:hover {
    background: #fee;
    color: #e74c3c;
}

/* Main Container */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Stat Card */
.stat-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 30px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    color: white;
    margin-bottom: 25px;
}

.stat-card i {
    font-size: 50px;
}

.stat-card h3 {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 5px;
}

.total-sum {
    font-size: 38px;
    font-weight: 800;
}

/* Add Card */
.add-card,
.list-card,
.users-card,
.admin-header {
    background: white;
    border-radius: 25px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.add-card h3,
.list-card h3,
.users-card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

.add-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.add-row input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 14px;
}

.add-row input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-add {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
}

.small-error {
    background: #fee;
    color: #e74c3c;
    padding: 10px;
    border-radius: 12px;
    margin-top: 15px;
    display: none;
    font-size: 13px;
}

/* Expenses List */
.expenses-list {
    max-height: 400px;
    overflow-y: auto;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
    margin-bottom: 10px;
    transition: 0.2s;
}

.expense-item:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.expense-title {
    font-weight: 600;
    color: #333;
}

.expense-date {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

.expense-sum {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

.expense-btns {
    display: flex;
    gap: 8px;
}

.expense-btns button {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
}

.edit-expense {
    color: #10b981;
}

.edit-expense:hover {
    background: #d1fae5;
}

.delete-expense {
    color: #ccc;
}

.delete-expense:hover {
    color: #e74c3c;
    background: #fee;
}

.empty {
    text-align: center;
    padding: 50px;
    color: #999;
}

.empty i {
    font-size: 50px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Admin */
.admin-header {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-header i {
    font-size: 48px;
    color: #d97706;
}

.admin-header h2 {
    color: #92400e;
    margin-bottom: 5px;
}

.admin-header p {
    color: #b45309;
    font-size: 13px;
}

.table-wrapper {
    overflow-x: auto;
}

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

.users-table th {
    text-align: left;
    padding: 15px 12px;
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
}

.users-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.users-table tr:hover {
    background: #f8f9fa;
}

.role-admin {
    background: #fed7aa;
    color: #9b2c2c;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.role-user {
    background: #e0e7ff;
    color: #3730a3;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.protected {
    color: #999;
    font-size: 12px;
}

.delete-user {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
}

.delete-user:hover {
    background: #c0392b;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 30px;
    width: 90%;
    max-width: 400px;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.modal-head h3 {
    text-align: center;
}

.modal-head i {
    font-size: 24px;
    color: #f59e0b;
}

.modal-body {
    padding: 25px;
    text-align: center;
}

.modal-body input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    margin-bottom: 15px;
}

.modal-body input:focus {
    outline: none;
    border-color: #667eea;
}

.modal-foot {
    display: flex;
    gap: 12px;
    padding: 20px 25px;
    border-top: 1px solid #eee;
}

.btn-cancel {
    flex: 1;
    padding: 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 500;
}

.btn-save {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 500;
}

.btn-confirm {
    flex: 1;
    padding: 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 500;
}

.close-modal {
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.close-modal:hover {
    color: #e74c3c;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1100;
    animation: slideIn 0.3s;
}

.success-toast {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.error-toast {
    background: #fee2e2;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 35px 25px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .add-row {
        flex-direction: column;
    }

    .btn-add {
        padding: 14px;
    }

    .total-sum {
        font-size: 28px;
    }

    .navbar {
        padding: 12px 20px;
    }

    .logo {
        font-size: 18px;
    }
}
/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 30px;
    width: 90%;
    max-width: 400px;
}

/* Tasdiqlash modal uchun maxsus - markaz */
.confirm .modal-head {
    justify-content: center;
    gap: 12px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.modal-head i { 
    font-size: 28px; 
    color: #f59e0b; 
}

.modal-head h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.modal-body { 
    padding: 25px; 
    text-align: center;
}

.modal-body p { 
    text-align: center;
    font-size: 16px;
    color: #555;
    line-height: 1.5;
}

.modal-body input { 
    width: 100%; 
    padding: 14px; 
    border: 2px solid #e0e0e0; 
    border-radius: 15px; 
    margin-bottom: 15px;
    text-align: left;
}

.modal-body input:focus { 
    outline: none; 
    border-color: #667eea; 
}

.modal-foot { 
    display: flex; 
    gap: 12px; 
    padding: 20px 25px; 
    border-top: 1px solid #eee; 
}

.btn-cancel {
    flex: 1;
    padding: 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 500;
}

.btn-save {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 500;
}

.btn-confirm {
    flex: 1;
    padding: 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 500;
}

.close-modal {
    font-size: 28px;
    cursor: pointer;
    color: #999;
}
.close-modal:hover { color: #e74c3c; }