/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Premium Dark Theme Palette */
    --bg-body: #0f172a;
    /* Deep Slate */
    --bg-sidebar: #1e293b;
    /* Lighter Slate */
    --bg-card: #1e293b;
    --bg-input: #334155;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --primary-color: #6366f1;
    /* Indigo */
    --primary-hover: #4f46e5;
    --accent-color: #8b5cf6;
    /* Violet */

    --border-color: #334155;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: transform 0.3s ease;
    z-index: 50;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    display: none;
}

.sidebar-logo-img {
    max-width: 100%;
    height: auto;
    max-height: 50px;
    /* Adjust based on preference */
    object-fit: contain;
}

.auth-logo-img {
    max-width: 150px;
    /* Adjust based on preference */
    height: auto;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.user-mini-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-primary);
    border: 2px solid var(--primary-color);
}

.user-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    width: calc(100% - 260px);
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.page-title p {
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-info .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Tables */
.table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-secondary);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-completed {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-pending {
    background-color: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.status-processing {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .mobile-toggle {
        display: block;
    }
}

/* Authentication Pages */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-body);
    padding: 1rem;
}

.auth-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto 1rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--primary-color);
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Payment Page */
.payment-grid {
    display: grid;
    gap: 2rem;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.payment-method {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-method:hover,
.payment-method.active {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.1);
}

.payment-method i {
    font-size: 1.5rem;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Tables */
.table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-secondary);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-completed {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-pending {
    background-color: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.status-processing {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .mobile-toggle {
        display: block;
    }
}

/* Authentication Pages */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-body);
    padding: 1rem;
}

.auth-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto 1rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--primary-color);
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Payment Page */
.payment-grid {
    display: grid;
    gap: 2rem;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.payment-method {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-method:hover,
.payment-method.active {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.1);
}

.payment-method i {
    font-size: 1.5rem;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Tables */
.table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-secondary);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-completed {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-pending {
    background-color: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.status-processing {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .mobile-toggle {
        display: block;
    }
}

/* Authentication Pages */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-body);
    padding: 1rem;
}

.auth-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto 1rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--primary-color);
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Payment Page */
.payment-grid {
    display: grid;
    gap: 2rem;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.payment-method {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-method:hover,
.payment-method.active {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.1);
}

.payment-method i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    display: block;
}

.payment-method span {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Support Page */
.support-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.support-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.support-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.support-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.support-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.telegram-icon {
    background: rgba(0, 136, 204, 0.1);
    color: #0088cc;
}

.whatsapp-icon {
    background: rgba(37, 211, 102, 0.1);
    color: #25d366;
}

.btn-telegram {
    background-color: #0088cc;
    color: white;
    width: 100%;
}

.btn-telegram:hover {
    background-color: #0077b3;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-whatsapp {
    background-color: #25d366;
    color: white;
    width: 100%;
}

.btn-whatsapp:hover {
    background-color: #20bd5a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Layout Adjustments */
    .sidebar {
        transform: translateX(-100%);
        width: 260px; /* Ensure width is fixed */
        box-shadow: 2px 0 10px rgba(0,0,0,0.5); /* Add shadow when open */
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem; /* Reduce padding on mobile */
    }

    /* Header */
    .top-header {
        flex-direction: row; /* Keep row but adjust if needed */
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .page-title h1 {
        font-size: 1.5rem; /* Smaller heading */
    }

    .page-title p {
        font-size: 0.875rem;
    }

    .mobile-toggle {
        display: block;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        padding: 0.5rem;
        border-radius: 0.5rem;
        color: var(--text-primary);
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr; /* Stack cards */
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px; /* Touch target size */
    }

    .btn {
        width: 100%; /* Full width buttons on mobile usually look better */
        min-height: 44px;
    }

    /* Tables */
    .table-container {
        overflow-x: auto; /* Horizontal scroll for tables */
        -webkit-overflow-scrolling: touch;
    }
    
    .table th, .table td {
        white-space: nowrap; /* Prevent wrapping in tight spaces */
        padding: 0.75rem 1rem;
    }

    /* Auth Pages */
    .auth-card {
        padding: 1.5rem;
        margin: 1rem;
    }

    .auth-title {
        font-size: 1.25rem;
    }

    /* Payment Grid */
    .payment-methods {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
    }
}

@media (max-width: 480px) {
    .payment-methods {
        grid-template-columns: 1fr; /* 1 column on very small screens */
    }
    
    .header-actions {
        margin-left: auto; /* Push toggle to right */
    }
}
/* Custom Modal / Toast Notification */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Allow clicks through when not active */
}

.custom-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.custom-modal {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.custom-modal.active {
    transform: translateY(0) scale(1);
}

/* Modal Types */
.custom-modal.error {
    border-left: 4px solid #ef4444;
}

.custom-modal.success {
    border-left: 4px solid #22c55e;
}

.custom-modal.warning {
    border-left: 4px solid #eab308;
}

.modal-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.custom-modal.error .modal-icon {
    color: #ef4444;
}

.custom-modal.success .modal-icon {
    color: #22c55e;
}

.custom-modal.warning .modal-icon {
    color: #eab308;
}

.modal-content {
    flex: 1;
}

.modal-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.modal-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
    font-size: 1.1rem;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

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

/* Glow Effect for Premium Feel */
.custom-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    pointer-events: none;
}

