* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f9fafb;
    --bg-dark: #1f2937;
    --text: #111827;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --white: #ffffff;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Login Screen */
#loginScreen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

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

.login-card {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-card h1 {
    font-size: 28px;
    margin-bottom: 8px;
    text-align: center;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
    color: var(--danger);
    margin-top: 12px;
    font-size: 14px;
    text-align: center;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    width: 100%;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

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

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

.btn-icon {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

/* Admin Panel */
.admin-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

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

.header-content h1 {
    font-size: 24px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-email {
    color: var(--text-light);
    font-size: 14px;
}

.admin-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 73px);
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    position: sticky;
    top: 73px;
    height: calc(100vh - 73px);
    overflow-y: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.nav-item:hover {
    background: var(--bg);
}

.nav-item.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    font-weight: 600;
    border-right: 3px solid var(--primary);
}

.nav-icon {
    font-size: 20px;
}

.badge {
    margin-left: auto;
    background: var(--danger);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
}

.section-subheader {
    margin-top: 32px;
    margin-bottom: 16px;
}

.section-subheader h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.header-filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.filter-select,
.search-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.search-input {
    min-width: 200px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.stat-card.warning {
    border-left-color: var(--warning);
}

.stat-card.danger {
    border-left-color: var(--danger);
}

.stat-icon {
    font-size: 32px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
}

/* Tables */
.table-container {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.data-table thead {
    background: var(--bg);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: var(--bg);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-approved {
    background: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.status-expired {
    background: #fee2e2;
    color: #991b1b;
}

.status-banned {
    background: #fee2e2;
    color: #991b1b;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.btn-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.btn-warning:hover {
    background: #fde68a;
}

.subscription-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.subscription-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.subscription-badge.expiring {
    background: #fef3c7;
    color: #92400e;
}

.subscription-badge.expired {
    background: #fee2e2;
    color: #991b1b;
}

.subscription-badge.none {
    background: #f3f4f6;
    color: #6b7280;
}

/* Retention Grid */
.retention-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.retention-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary);
}

.retention-label {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.retention-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.loading {
    text-align: center;
    padding: 40px !important;
    color: var(--text-light);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.modal-close:hover {
    background: var(--bg);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Activity List */
.activity-list {
    background: var(--white);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.activity-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-item:last-child {
    border-bottom: none;
}

/* Settings */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.settings-card h3 {
    margin-bottom: 8px;
}

.settings-card p {
    color: var(--text-light);
    margin-bottom: 16px;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-bottom: 16px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        height: auto;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .nav-item {
        white-space: nowrap;
    }

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

