:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --dark-bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-main);
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 20%);
}

/* Utilities */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, opacity 0.2s;
    width: 100%;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Views */
.view {
    display: none;
    min-height: 100vh;
}

.view.active {
    display: flex;
}

/* Login/Register */
#login-view,
#register-view {
    justify-content: center;
    align-items: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    padding: 40px;
}

.login-card h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--primary);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-muted);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
}

.divider span {
    padding: 0 10px;
    font-size: 0.9rem;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* Dashboard Layout */
#dashboard-view {
    display: none;
    /* Hidden by default */
}

#dashboard-view.active {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 24px;
    display: flex;
    flex-direction: column;
    border-radius: 0 16px 16px 0;
    margin-right: 20px;
}

.logo h2 {
    font-size: 1.5rem;
    margin-bottom: 40px;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-links li {
    margin-bottom: 8px;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-links li.active a,
.nav-links a:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.nav-links .icon {
    margin-right: 12px;
}

.user-profile {
    display: flex;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
}

.user-info {
    flex: 1;
}

.user-info h4 {
    font-size: 0.9rem;
}

.user-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
}

.main-content {
    padding: 24px;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-bottom: 24px;
}

.content-area {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    align-items: center;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.form-alert {
    margin-bottom: 16px;
    width: 100%;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-small {
    background: var(--warning);
    color: black;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.stat-card {
    padding: 24px;
    display: flex;
    align-items: flex-start;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 16px;
}

.color-1 {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

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

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

.color-4 {
    background: rgba(236, 72, 153, 0.1);
    color: var(--secondary);
}

.stat-info h5 {
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-info h2 {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.trend {
    font-size: 0.8rem;
    font-weight: 500;
}

.trend.up {
    color: var(--success);
}

.trend.down {
    color: var(--danger);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.chart-container,
.recent-users {
    padding: 24px;
    min-height: 300px;
}

.recent-users h4,
.chart-container h4 {
    margin-bottom: 16px;
}

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

th {
    text-align: left;
    color: var(--text-muted);
    padding: 12px 0;
    font-weight: 500;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-paid {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-unpaid {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

@media (max-width: 768px) {
    #dashboard-view.active {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

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

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

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 30px;
    position: relative;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    flex: 1;
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.search-input {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    outline: none;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    margin-right: 6px;
}

.btn-view {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.btn-upg {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.btn-del {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}