:root {
    --primary: #0A1F44;
    --primary-light: #1a3a6e;
    --secondary: #2D8CFF;
    --accent: #00B4D8;
    --light: #F8F9FA;
    --gray: #6C757D;
    --gray-light: #E9ECEF;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f7fb;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, #1a3a6e 100%);
}

.login-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    margin: 1rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary);
    font-size: 2.5rem;
    font-weight: 700;
}

.login-header p {
    color: var(--gray);
    font-size: 1rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray);
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--secondary);
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--gray);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-light);
}

.btn-secondary {
    background-color: var(--gray-light);
    color: var(--gray);
}

.btn-secondary:hover {
    background-color: #dde0e4;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Main Layout */
.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    color: var(--primary);
    font-size: 1.5rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray);
    cursor: pointer;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    padding: 1rem 0;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
    gap: 0.75rem;
}

.sidebar-menu a:hover {
    background-color: var(--gray-light);
    color: var(--primary);
}

.sidebar-menu .active a {
    background-color: var(--primary);
    color: white;
}

.sidebar-menu i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-light);
}

.agent-code {
    font-size: 0.875rem;
    color: var(--gray);
}

.agent-code strong {
    display: block;
    color: var(--primary);
    font-size: 1rem;
    margin-top: 0.25rem;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 1rem;
    transition: var(--transition);
}

.header {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    color: var(--primary);
    font-size: 1.75rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wallet-balance {
    text-align: right;
}

.wallet-balance small {
    color: var(--gray);
    font-size: 0.875rem;
}

.wallet-balance h2 {
    color: var(--primary);
    font-size: 1.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
}

.card-header h3 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.card-header p {
    color: var(--gray);
    font-size: 0.875rem;
}

.card-body {
    padding: 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background-color: var(--secondary);
}

.stat-icon.customers {
    background-color: var(--success);
}

.stat-icon.today {
    background-color: var(--accent);
}

.stat-icon.commission {
    background-color: var(--warning);
    color: #333;
}

.stat-info h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--gray);
    font-size: 0.875rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background-color: var(--gray-light);
    color: var(--primary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-light);
    color: #333;
}

.table tbody tr:hover {
    background-color: var(--gray-light);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary);
}

/* Loading States */
.loading,
.price-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--gray);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

/* Notification */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    box-shadow: var(--box-shadow);
    z-index: 10000;
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background-color: var(--success);
}

.notification.error {
    background-color: var(--danger);
}

.notification.info {
    background-color: var(--secondary);
}

/* Wallet Grid */
.wallet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.balance-display {
    text-align: center;
    margin-bottom: 2rem;
}

.balance-display h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.balance-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.balance-stat {
    background: var(--gray-light);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.balance-stat small {
    color: var(--gray);
    font-size: 0.875rem;
}

.balance-stat h4 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-top: 0.25rem;
}

.withdraw-note {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #e7f3ff;
    border-radius: var(--border-radius);
    color: var(--secondary);
    font-size: 0.875rem;
}

.withdraw-note i {
    margin-right: 0.5rem;
}

/* Profile */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-light);
}

.info-label {
    color: var(--gray);
    font-weight: 500;
}

.info-value {
    color: var(--primary);
    font-weight: 600;
}

.agent-code-display {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.profile-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: var(--border-radius);
}

.profile-stat .stat-icon {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
}

.profile-stat h4 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.profile-stat p {
    color: var(--gray);
    font-size: 0.875rem;
}

.account-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box input {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    width: 250px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--gray-light);
}

.empty-state h4 {
    color: var(--gray);
    margin-bottom: 0.5rem;
}

/* Price Items */
.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    background: white;
}

.price-item:hover {
    border-color: var(--secondary);
}

.price-info {
    flex: 1;
}

.price-info h4 {
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.price-info p {
    color: var(--gray);
    font-size: 0.875rem;
}

.price-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.price-display {
    background: var(--gray-light);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    min-width: 120px;
}

.price-display span {
    color: var(--primary);
    font-weight: 600;
}

.price-input {
    width: 100px;
    padding: 0.5rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }
}


@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .price-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .price-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }


    
}

/* Auth Page Styles */
.auth-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    margin: 1rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--primary);
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-header p {
    color: var(--gray);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-light);
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.auth-tab:hover {
    color: var(--primary);
}

.auth-tab.active {
    color: var(--primary);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-group {
    display: flex;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.input-prefix {
    padding: 0.75rem 1rem;
    background-color: var(--gray-light);
    color: var(--gray);
    font-weight: 500;
    border-right: 2px solid var(--gray-light);
}

.input-group input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
}

.input-group input:focus {
    outline: none;
}

.password-input {
    position: relative;
}

.password-input input {
    width: 100%;
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 0.25rem;
}

.password-toggle:hover {
    color: var(--primary);
}

.input-hint {
    display: block;
    margin-top: 0.25rem;
    color: var(--gray);
    font-size: 0.75rem;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--gray);
    font-size: 0.875rem;
}

.checkbox input {
    width: auto;
}

.forgot-password {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

.back-to-login {
    text-align: center;
    margin-top: 1.5rem;
}

.back-to-login a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-to-login a:hover {
    text-decoration: underline;
}

.terms-link {
    color: var(--secondary);
    text-decoration: none;
}

.terms-link:hover {
    text-decoration: underline;
}

.auth-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-light);
    text-align: center;
    color: var(--gray);
    font-size: 0.875rem;
}

.auth-footer a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-badge.processing {
    background-color: #cce5ff;
    color: #004085;
}

.status-badge.completed {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.failed,
.status-badge.rejected {
    background-color: #f8d7da;
    color: #721c24;
}

/* Spinner sizes */
.spinner.small {
    width: 20px;
    height: 20px;
    border-width: 2px;
    margin: 0;
}

.btn.success {
    background-color: var(--success);
}

/* Error state */
.error-state {
    text-align: center;
    padding: 2rem;
    color: var(--danger);
}

/* Responsive for auth forms */
@media (max-width: 480px) {
    .auth-container {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .auth-header h1 {
        font-size: 2rem;
    }
    
    .auth-tab {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Prevent background scroll when sidebar open */
body.sidebar-open {
    overflow: hidden;
}
