/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255,255,255,0.2);
}

/* Main Content */
.main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Features Section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.feature-card p {
    color: #666;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-full {
    width: 100%;
}

/* Auth Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
    font-size: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 3rem;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 3px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.password-toggle:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

.password-toggle:focus {
    outline: none;
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

.password-toggle i {
    font-size: 1rem;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: 250px;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 80px;
    width: 250px;
    height: calc(100vh - 80px);
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: #f8f9fa;
    color: #667eea;
    border-left-color: #667eea;
}

.sidebar-link i {
    margin-right: 1rem;
    width: 20px;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #666;
    font-size: 1.1rem;
}

/* News Section */
.news-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.news-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-item {
    padding: 1.5rem;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    transition: box-shadow 0.3s;
}

.news-item:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.news-date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.news-item h4 {
    color: #333;
    margin-bottom: 0.5rem;
}

.news-item p {
    color: #666;
    line-height: 1.6;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card i {
    font-size: 2.5rem;
    color: #667eea;
}

.stat-info h4 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

/* Affiliate Section */
.affiliate-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.affiliate-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.affiliate-card h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
}

.code-display,
.link-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.code-item,
.link-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.code-item label,
.link-item label {
    font-weight: 600;
    color: #333;
}

.code-value,
.link-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e1e5e9;
}

.code-value span,
.link-value span {
    flex: 1;
    font-family: monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

.btn-copy {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-copy:hover {
    background: #5a6fd8;
}

.coming-soon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    color: #856404;
    margin-top: 1rem;
}

.coming-soon i {
    color: #f39c12;
}

/* Instructions Section */
.instructions-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.instructions-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
}

.instruction-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.instruction-item i {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.instruction-item h4 {
    color: #333;
    margin-bottom: 0.5rem;
}

.instruction-item p {
    color: #666;
    line-height: 1.6;
}

/* Time Selector */
.time-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.time-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e1e5e9;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.time-btn:hover,
.time-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* Revenue Analysis Section */
.revenue-analysis-section {
    margin-bottom: 2rem;
}

.revenue-analysis-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.analysis-header:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.analysis-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.analysis-header i {
    margin-right: 0.5rem;
}

.analysis-toggle {
    transition: transform 0.3s ease;
}

.analysis-content {
    padding: 0;
    transition: all 0.3s ease;
}

.analysis-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem;
    color: #6c757d;
    font-size: 1.1rem;
}

.analysis-loading i {
    font-size: 1.5rem;
}

.analysis-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
    color: #dc3545;
    text-align: center;
}

.analysis-error i {
    font-size: 3rem;
    opacity: 0.5;
}

.analysis-data {
    padding: 2rem;
}

.analysis-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analysis-summary .summary-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.analysis-summary .summary-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.analysis-summary .summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 0.25rem;
}

.analysis-summary .summary-orders {
    font-size: 0.85rem;
    color: #6c757d;
}

.analysis-summary .summary-trend {
    margin-top: 0.5rem;
}

.analysis-summary .summary-trend i {
    font-size: 1.2rem;
}

.chart-container {
    position: relative;
    height: 400px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

/* Commission Stats */
.commission-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Chart Section */
.chart-section {
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.chart-card h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
}

.chart-card canvas {
    max-height: 400px;
}

/* Withdrawal Section */
.withdrawal-section {
    margin-bottom: 2rem;
}

.withdrawal-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.withdrawal-card h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
}

.withdrawal-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.available-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #e8f5e8;
    border-radius: 5px;
    border: 1px solid #c3e6c3;
}

.available-amount label {
    font-weight: 600;
    color: #333;
}

.amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #28a745;
}

.withdrawal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* History Section */
.history-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.history-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
}

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

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

.history-table th,
.history-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.history-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.history-table td {
    color: #666;
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status.completed {
    background: #d4edda;
    color: #155724;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

/* Setup Message */
.setup-message {
    margin-bottom: 2rem;
}

.message-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 2rem;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #f39c12;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.1);
}

.message-box i {
    font-size: 2rem;
    color: #f39c12;
    margin-top: 0.25rem;
}

.message-content h4 {
    color: #856404;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.message-content p {
    color: #856404;
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Affiliate Form */
.affiliate-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: monospace;
    text-transform: uppercase;
}

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

.btn-generate {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
    font-weight: 600;
}

.btn-generate:hover {
    background: #218838;
}

.form-help {
    margin-top: 0.5rem;
}

.form-help small {
    color: #666;
    font-style: italic;
}

.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Info Box */
.code-info {
    margin-bottom: 2rem;
}

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
}

.info-box i {
    font-size: 1.5rem;
    color: #2196f3;
    margin-top: 0.25rem;
}

.info-content h4 {
    color: #1565c0;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.info-content ul {
    color: #1565c0;
    margin: 0;
    padding-left: 1.5rem;
}

.info-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

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

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
    /* Hide scrollbar while keeping scroll functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.modal-content::-webkit-scrollbar {
    display: none; /* WebKit browsers */
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e1e5e9;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e1e5e9;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

/* Profile Section */
.profile-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.profile-card h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e1e5e9;
}

.info-item .status-badge {
    margin-left: auto;
    flex: none;
    text-align: center;
}

.info-item label {
    font-weight: 600;
    color: #333;
    min-width: 120px;
}

.info-item span {
    color: #666;
    text-align: right;
    flex: 1;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block !important;
    width: auto !important;
    flex: none !important;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Contractor Agreement Styles */
.agreement-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.agreement-notice p {
    color: #856404;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
    color: white;
    text-decoration: none;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .main {
        padding: 1rem;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .sidebar {
        display: none;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

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

    .affiliate-section {
        grid-template-columns: 1fr;
    }

    .profile-section {
        grid-template-columns: 1fr;
    }

    .quick-stats,
    .commission-stats {
        grid-template-columns: 1fr;
    }

    .time-selector {
        justify-content: center;
    }

    .available-amount {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .history-table {
        font-size: 0.9rem;
    }

    .input-group {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .message-box {
        flex-direction: column;
        text-align: center;
    }

    .info-box {
        flex-direction: column;
        text-align: center;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1rem;
    }

    .affiliate-card,
    .news-section,
    .chart-card,
    .withdrawal-card,
    .history-section,
    .profile-card {
        padding: 1rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }
}

/* Commission History Styles */
.date-filter {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.filter-header h4 {
    margin-bottom: 1rem;
    color: #495057;
    font-size: 1.1rem;
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    color: #495057;
}

.filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.filter-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

#customDateBtn {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    color: #495057;
}

#customDateBtn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

#customDateBtn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.date-range-filter {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.date-range-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.date-range-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
}

.date-input {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
}

.date-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.status-filter {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.status-filter-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.status-filter-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
}

.status-select {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    min-width: 150px;
}

.status-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.custom-date-range {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.date-input-group label {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.date-input {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.year-filter {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.year-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.year-input-group label {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.year-select {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    min-width: 120px;
}

.commission-summary {
    margin-bottom: 2rem;
}

.summary-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.summary-item i {
    font-size: 1.5rem;
    color: #007bff;
}

.summary-content h4 {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.summary-content span {
    font-size: 1.2rem;
    font-weight: 600;
    color: #495057;
}

.commission-table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.table-header h4 {
    margin: 0;
    color: #495057;
}

.table-controls select {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #6c757d;
}

.loading i {
    font-size: 1.2rem;
}

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

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

.commission-table-content th,
.commission-table-content td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.commission-table-content th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.commission-table-content td {
    font-size: 0.9rem;
}

.commission-table-content code {
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.amount {
    font-weight: 600;
    color: #28a745;
}

/* Status styles for commission table */
.commission-table-content .status {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.commission-table-content .status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.8;
}

.status {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: default;
    user-select: none;
}

.status:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.status:hover::before {
    transform: scale(1.2);
    opacity: 1;
}

.status.success {
    background: linear-gradient(135deg, #cce7ff 0%, #b3d9ff 100%);
    color: #004085;
    border: 1px solid #99ccff;
}

.status.success::before {
    background: #007bff;
    box-shadow: 0 0 6px rgba(0, 123, 255, 0.4);
}

.status.partial {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #f0d78c;
}

.status.partial::before {
    background: #ffc107;
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.4);
}

.status.pending {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f1b0b7;
}

.status.pending::before {
    background: #dc3545;
    box-shadow: 0 0 6px rgba(220, 53, 69, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 6px rgba(220, 53, 69, 0.4);
    }
    50% {
        box-shadow: 0 0 12px rgba(220, 53, 69, 0.6);
    }
    100% {
        box-shadow: 0 0 6px rgba(220, 53, 69, 0.4);
    }
}

.status.cancelled {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    color: #383d41;
    border: 1px solid #c6c8ca;
}

.status.cancelled::before {
    background: #6c757d;
    box-shadow: 0 0 6px rgba(108, 117, 125, 0.4);
}

.status.paid {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #b8dacc;
}

.status.paid::before {
    background: #28a745;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.4);
}

.status.unknown {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    border: 1px solid #dee2e6;
}

.status.unknown::before {
    background: #6c757d;
    box-shadow: 0 0 6px rgba(108, 117, 125, 0.4);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid #007bff;
    color: #007bff;
}

.btn-outline:hover {
    background: #007bff;
    color: white;
}

.pagination {
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #495057;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.pagination-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-color: #007bff;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pagination-btn:disabled:hover {
    background: white;
    border-color: #dee2e6;
    transform: none;
    box-shadow: none;
}

.pagination-info {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    color: #6c757d;
    font-weight: 600;
    user-select: none;
}

.empty-message,
.error-message {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-message i,
.error-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #adb5bd;
}

.error-message {
    color: #dc3545;
}

.error-message i {
    color: #dc3545;
}

/* Customer and Program Info Styles */
.customer-info {
    min-width: 150px;
}

.customer-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.customer-email {
    font-size: 0.8rem;
    color: #6c757d;
}

.program-info {
    min-width: 200px;
}

.program-item {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.program-item:last-child {
    margin-bottom: 0;
}

.program-name {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.program-details {
    font-size: 0.8rem;
    color: #007bff;
    font-weight: 600;
}

/* Order Details Modal Styles */
.order-details {
    padding: 0;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.order-header h3 {
    margin: 0;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-status {
    margin-left: auto;
}

.order-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    backdrop-filter: blur(10px);
}

.summary-item i {
    font-size: 1.5rem;
    opacity: 0.8;
}

.summary-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.summary-content span {
    font-size: 1.2rem;
    font-weight: 600;
}

.customer-section {
    margin-bottom: 2rem;
}

.customer-section h4 {
    margin: 0 0 1rem 0;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.customer-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.customer-avatar {
    font-size: 3rem;
    color: #6c757d;
}

.customer-details h5 {
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-size: 1.1rem;
}

.customer-details p {
    margin: 0.25rem 0;
    color: #6c757d;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rules-section {
    margin-bottom: 1rem;
}

.rules-section h4 {
    margin: 0 0 1rem 0;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rules-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rule-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.rule-header h4 {
    margin: 0;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rule-content {
    padding: 1.5rem;
}

.rule-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.info-row i {
    width: 20px;
    color: #6c757d;
    font-size: 0.9rem;
}

.info-row .label {
    min-width: 120px;
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.info-row .value {
    color: #6c757d;
    font-size: 0.9rem;
}

.info-row .value.amount {
    color: #28a745;
    font-weight: 600;
}

/* Status styles for order details modal */
.order-details .status {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.order-details .status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.8;
}

.order-details .status.success {
    background: linear-gradient(135deg, #cce7ff 0%, #b3d9ff 100%);
    color: #004085;
    border: 1px solid #99ccff;
}

.order-details .status.success::before {
    background: #007bff;
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.3);
}

.order-details .status.partial {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #f0d78c;
}

.order-details .status.partial::before {
    background: #ffc107;
    box-shadow: 0 0 4px rgba(255, 193, 7, 0.3);
}

.order-details .status.pending {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f1b0b7;
}

.order-details .status.pending::before {
    background: #dc3545;
    box-shadow: 0 0 4px rgba(220, 53, 69, 0.3);
}

.order-details .status.cancelled {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    color: #383d41;
    border: 1px solid #c6c8ca;
}

.order-details .status.cancelled::before {
    background: #6c757d;
    box-shadow: 0 0 4px rgba(108, 117, 125, 0.3);
}

.order-details .status.paid {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #b8dacc;
}

.order-details .status.paid::before {
    background: #28a745;
    box-shadow: 0 0 4px rgba(40, 167, 69, 0.3);
}

.order-details .status.unknown {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    border: 1px solid #dee2e6;
}

.order-details .status.unknown::before {
    background: #6c757d;
    box-shadow: 0 0 4px rgba(108, 117, 125, 0.3);
}

/* Responsive adjustments for commission section */
@media (max-width: 768px) {
    .filter-controls {
        gap: 1rem;
    }
    
    .quick-filters {
        justify-content: center;
    }
    
    .custom-date-range {
        flex-direction: column;
        align-items: stretch;
    }
    
    .year-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .summary-card {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .commission-table-content {
        font-size: 0.8rem;
    }
    
    .commission-table-content th,
    .commission-table-content td {
        padding: 0.75rem 0.5rem;
    }
    
    .status {
        padding: 0.3rem 0.7rem;
        font-size: 0.7rem;
        gap: 0.3rem;
    }
    
    .status::before {
        width: 6px;
        height: 6px;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .pagination-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 36px;
    }
    
    .pagination-ellipsis {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .customer-info,
    .program-info {
        min-width: 120px;
    }
    
    .customer-name,
    .program-name {
        font-size: 0.85rem;
    }
    
    .customer-email,
    .program-details {
        font-size: 0.75rem;
    }
    
    .program-item {
        padding: 0.4rem;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .customer-card {
        flex-direction: column;
        text-align: center;
    }
    
    .rule-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .info-row .label {
        min-width: auto;
    }
    
    /* Revenue Analysis Responsive */
    .analysis-header {
        padding: 1rem;
    }
    
    .analysis-header h3 {
        font-size: 1.1rem;
    }
    
    .analysis-data {
        padding: 1rem;
    }
    
    .analysis-summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-container {
        height: 300px;
        padding: 0.5rem;
    }
    
    .analysis-summary .summary-item {
        padding: 1rem;
    }
    
    .analysis-summary .summary-value {
        font-size: 1.2rem;
    }
}
