:root {
    --bg-main: #f4f7fc;
    --surface: #ffffff;
    --border: #e2e8f0;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #10b981;
    --secondary-hover: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;

    --text-main: #1f2937;
    --text-muted: #6b7280;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);

    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Card Utility */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    margin: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.logo-card {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: white;
    margin-bottom: 2rem;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.logo-card h4 {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.logo-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.logo-card p {
    font-size: 0.75rem;
    opacity: 0.8;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-links li.active a,
.nav-links li a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-links li a i {
    width: 1.25rem;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.5rem 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    padding: 0.5rem;
    padding-right: 1.5rem;
    border-radius: 30px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-profile span {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Blue Gradient Balance Card */
.main-balance-card {
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    border-radius: var(--radius-xl);
    padding: 2rem;
    color: white;
    box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.4);
    position: relative;
    overflow: hidden;
}

.main-balance-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.main-balance-card .label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.main-balance-card .balance-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.main-balance-card .chip-icon {
    font-size: 2rem;
    color: #fcd34d;
}

.main-balance-card .amount {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.main-balance-card .sub-balance {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.main-balance-card .sub-balance strong {
    font-size: 1.1rem;
    display: block;
    margin-top: 0.25rem;
}

/* Quick Actions Grid */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.action-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-green {
    background: #dcfce7;
    color: #16a34a;
}

.icon-blue {
    background: #dbeafe;
    color: #2563eb;
}

.icon-purple {
    background: #f3e8ff;
    color: #9333ea;
}

.icon-gray {
    background: #f1f5f9;
    color: #475569;
}

/* Recent Activity List */
.recent-activity-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.activity-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.activity-header a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    gap: 1rem;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-details {
    flex: 1;
}

.activity-date {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.activity-amount-box {
    text-align: right;
}

.activity-amount {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
}

.activity-amount.positive {
    color: var(--secondary);
}

.activity-status {
    font-size: 0.75rem;
    font-weight: 600;
}

.activity-status.completed {
    color: var(--secondary);
}

.activity-status.pending {
    color: var(--warning);
}

.activity-status.failed {
    color: var(--danger);
}


/* Forms & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
}

input,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: white;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
}

.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-icon {
    width: auto;
    padding: 0.5rem;
    background: transparent;
    color: var(--text-muted);
}

.btn-icon:hover {
    color: var(--text-main);
    background: var(--bg-main);
}

/* Auth View */
.form-container {
    max-width: 450px;
    margin: 4rem auto;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--bg-main);
    padding: 0.3rem;
    border-radius: 10px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover td {
    background: var(--bg-main);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.completed {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.pending {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.failed {
    background: #fee2e2;
    color: #dc2626;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--text-main);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    color: #fff;
    transform: translateX(150%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    font-weight: 500;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: var(--danger);
}

.toast.success {
    background: var(--secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: auto;
        margin: 1rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
    }

    .logo-card {
        display: none;
    }

    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links li a span {
        display: none;
    }

    .nav-links li a {
        padding: 0.75rem;
    }
}