/* ===== Admin Panel Styles ===== */

/* Header styles moved to common.css */
/* .header, .logo, .nav, .user-menu styles removed to ensure consistency */

/* Main */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 24px 60px;
}

/* Access Denied */
.access-denied {
    text-align: center;
    padding: 80px 20px;
}

.access-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.access-denied h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.access-denied p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.tab.active {
    background: var(--accent);
    color: white;
}

.tab-content {
    display: none;
}

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

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.search-box input,
.filter-row select,
.filter-row input {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.search-box input:focus,
.filter-row select:focus,
.filter-row input:focus {
    outline: none;
    border-color: var(--accent);
}

.filter-row {
    display: flex;
    gap: 12px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-input);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.data-table .loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

/* User Cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-cell img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-cell span {
    font-weight: 500;
}

/* Role Badge */
.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.role-badge.admin {
    background: rgba(139, 92, 246, 0.2);
    color: #A78BFA;
}

.role-badge.user {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* Provider Badge */
.provider-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    background: var(--bg-input);
    color: var(--text-secondary);
}

/* Usage Badge */
.usage-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.usage-badge.note {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.usage-badge.product {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

/* Action Button */
.action-btn {
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.action-btn.danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

#pageInfo {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Modal readonly input */
.form-group input.readonly {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Nav styling handled by common.css (bottom bar) */

    .main {
        padding: 100px 24px 100px;
    }

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

    .data-table {
        display: block;
        overflow-x: auto;
    }

    .card-header {
        flex-direction: column;
        gap: 12px;
    }

    .filter-row {
        flex-wrap: wrap;
    }
}
/* Plan badges */
.plan-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.plan-badge.free {
    background: rgba(156, 163, 175, 0.2);
    color: #9CA3AF;
}

.plan-badge.creator {
    background: rgba(139, 92, 246, 0.2);
    color: #8B5CF6;
}

.plan-badge.pro {
    background: rgba(251, 191, 36, 0.2);
    color: #F59E0B;
}

/* Status badges for activation codes */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.unused {
    background: rgba(34, 197, 94, 0.2);
    color: #22C55E;
}

.status-badge.used {
    background: rgba(107, 114, 128, 0.2);
    color: #6B7280;
}

/* Code text styling */
.code-text {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.9rem;
    padding: 4px 8px;
    background: var(--bg-input);
    border-radius: 4px;
    letter-spacing: 1px;
}

/* Header actions row for codes tab */
.header-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions-row select,
.header-actions-row input {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.header-actions-row span {
    color: var(--text-secondary);
}

.action-btn.delete {
    color: var(--error);
}

.action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
}
