/* ======================================================
   NEXRA Admin Panel - Complete Stylesheet
   Professional & Secure Admin Interface
   ====================================================== */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-card: #141414;
    --accent-green: #d4ff00;
    --accent-green-dark: #b8e600;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --border-color: #2a2a2a;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

body.admin-mobile-sidebar-open {
    overflow: hidden;
}

/* ======================================================
   AUTH PAGE STYLES
   ====================================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding: 2rem;
}

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-dark) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.auth-logo i {
    width: 40px;
    height: 40px;
    color: var(--bg-primary);
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-footer i {
    width: 14px;
    height: 14px;
}

.security-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(212, 255, 0, 0.1);
    border: 1px solid rgba(212, 255, 0, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--accent-green);
}

.security-notice i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ======================================================
   ADMIN LAYOUT
   ====================================================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.mobile-menu-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 160;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(17, 17, 17, 0.94);
    color: var(--text-primary);
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
}

.mobile-menu-toggle i {
    width: 20px;
    height: 20px;
}

.admin-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 120;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-header .logo i {
    width: 28px;
    height: 28px;
    color: var(--accent-green);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--accent-green);
    background: rgba(212, 255, 0, 0.1);
    border-left-color: var(--accent-green);
}

.nav-item i {
    width: 20px;
    height: 20px;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.75rem 1.5rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-avatar {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-avatar i {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.admin-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admin-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-logout {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-header {
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.header-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.admin-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    min-width: 0;
}

/* ======================================================
   FORM STYLES
   ====================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    width: 16px;
    height: 16px;
    color: var(--accent-green);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(212, 255, 0, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-select {
    padding: 0.625rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

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

.input-group input {
    flex: 1;
}

.input-prefix {
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.input-group .input-prefix + input {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    border-left: none;
}

.password-wrapper {
    position: relative;
}

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

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
}

.toggle-password:hover {
    color: var(--accent-green);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-green);
}

/* ======================================================
   BUTTONS
   ====================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-dark) 100%);
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(212, 255, 0, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

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

.btn-warning {
    background: var(--warning);
    color: var(--bg-primary);
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-icon:hover {
    color: var(--accent-green);
    border-color: var(--accent-green);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-sm.btn-icon {
    width: 32px;
    height: 32px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ======================================================
   CARDS
   ====================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

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

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i {
    width: 20px;
    height: 20px;
    color: var(--accent-green);
}

.card-body {
    padding: 1.5rem;
}

/* ======================================================
   STATS GRID
   ====================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stats-grid-sm {
    grid-template-columns: repeat(4, 1fr);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    width: 24px;
    height: 24px;
}

.stat-icon.revenue {
    background: rgba(212, 255, 0, 0.1);
    color: var(--accent-green);
}

.stat-icon.month {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.stat-icon.users {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-icon.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.stat-icon.credits {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.generations {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.stat-icon.api {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

.stat-icon.total {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ======================================================
   TABLES
   ====================================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

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

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

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

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

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

/* ======================================================
   BADGES & STATUS
   ====================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.badge-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.badge-muted {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.credit-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: rgba(212, 255, 0, 0.1);
    color: var(--accent-green);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ======================================================
   CHARTS
   ====================================================== */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.chart-card.full-width {
    grid-column: span 2;
}

.chart-container {
    height: 300px;
    padding: 1rem;
}

.chart-container-sm {
    height: 250px;
    padding: 1rem;
}

/* ======================================================
   INFO CARDS
   ====================================================== */
.info-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.info-card i {
    width: 24px;
    height: 24px;
    color: var(--info);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.info-card h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.info-card p,
.info-card ul {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-card ul {
    padding-left: 1.25rem;
    margin-top: 0.5rem;
}

.info-card.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
}

.info-card.warning i {
    color: var(--warning);
}

/* ======================================================
   QUICK ACTIONS
   ====================================================== */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.action-btn:hover {
    border-color: var(--accent-green);
    transform: translateY(-2px);
}

.action-btn i {
    width: 20px;
    height: 20px;
    color: var(--accent-green);
}

/* ======================================================
   PACKAGES GRID
   ====================================================== */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.package-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    transition: all 0.2s ease;
}

.package-card:hover {
    border-color: var(--accent-green);
    transform: translateY(-2px);
}

.package-card.popular {
    border-color: var(--accent-green);
}

.package-card.inactive {
    opacity: 0.6;
}

.popular-badge {
    position: absolute;
    top: -10px;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: var(--accent-green);
    color: var(--bg-primary);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.popular-badge i {
    width: 12px;
    height: 12px;
}

.inactive-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    background: var(--danger);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.package-header {
    margin-bottom: 1rem;
}

.package-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.package-header code {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.package-price {
    margin-bottom: 0.75rem;
}

.package-price .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-green);
}

.package-price .period {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.package-credits {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.package-credits i {
    width: 18px;
    height: 18px;
    color: var(--warning);
}

.package-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.package-actions {
    display: flex;
    gap: 0.5rem;
}

/* ======================================================
   MODEL PRICING
   ====================================================== */
.model-pricing-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.model-pricing-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.model-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.model-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.model-info h4 {
    font-size: 1rem;
}

.model-key {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pricing-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.pricing-input {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.pricing-input label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pricing-input input {
    padding: 0.625rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
}

.pricing-input small {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

.model-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ======================================================
   PRICING GRID
   ====================================================== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.pricing-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pricing-item label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.pricing-item small {
    font-size: 0.75rem;
    color: var(--accent-green);
}

/* ======================================================
   TOP USERS LIST
   ====================================================== */
.top-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.top-user-item .rank {
    width: 28px;
    height: 28px;
    background: var(--bg-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-green);
}

.top-user-item .user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-user-item .user-info strong {
    font-size: 0.85rem;
}

.top-user-item .user-info small {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.top-user-item .user-stats .credits {
    font-size: 0.8rem;
    color: var(--accent-green);
}

/* ======================================================
   SEARCH BOX
   ====================================================== */
.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 250px;
}

.search-box i {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* ======================================================
   MODAL
   ====================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}

.modal-content.modal-sm {
    max-width: 400px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.modal-header h2 {
    font-size: 1.125rem;
}

.btn-close {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ======================================================
   TOAST NOTIFICATIONS
   ====================================================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.3s ease;
    min-width: 280px;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

.toast i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--danger);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ======================================================
   FORM ERROR MESSAGE
   ====================================================== */
.form-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: #fca5a5;
    font-size: 0.85rem;
}

.form-error i {
    width: 18px;
    height: 18px;
    color: var(--danger);
}

/* ======================================================
   EMPTY STATES
   ====================================================== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ======================================================
   INFO GRID & BOX
   ====================================================== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.info-value {
    font-size: 0.9rem;
    font-weight: 500;
}

.info-box {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.info-box h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.info-box p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.code-block {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--accent-green);
    overflow-x: auto;
}

.settings-form {
    max-width: 600px;
}

.settings-form .form-group {
    margin-bottom: 1rem;
}

/* ======================================================
   UTILITIES
   ====================================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ======================================================
   RESPONSIVE
   ====================================================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-card.full-width {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .admin-content {
        padding: 1rem;
    }
    
    .stats-grid,
    .stats-grid-sm {
        grid-template-columns: 1fr 1fr;
    }
    
    .pricing-inputs {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .pricing-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .mobile-menu-toggle {
        display: inline-flex;
    }

    .admin-sidebar {
        width: min(320px, calc(100vw - 2rem));
        transform: translateX(-110%);
        transition: transform 0.28s ease;
        z-index: 140;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    }

    body.admin-mobile-sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    body.admin-mobile-sidebar-open .admin-sidebar-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .admin-sidebar .logo span,
    .admin-sidebar .nav-item span,
    .admin-sidebar .admin-details {
        display: inline;
    }

    .admin-main {
        margin-left: 0;
        width: 100%;
    }

    .admin-header {
        padding: 0.8rem 0.95rem 0.8rem 4.15rem;
        align-items: center;
        gap: 0.65rem;
        flex-wrap: wrap;
        min-height: 64px;
    }

    .header-left,
    .header-right {
        width: 100%;
    }

    .header-right {
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.55rem;
    }

    .header-left h1 {
        font-size: 1.02rem;
        margin-bottom: 0;
        line-height: 1.15;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-subtitle {
        display: none !important;
    }

    .admin-content {
        padding: 1rem;
    }

    .stats-grid,
    .stats-grid-sm,
    .charts-grid,
    .watch-grid,
    .financial-grid,
    .pricing-grid,
    .info-grid,
    .summary-grid,
    .metrics-grid {
        grid-template-columns: 1fr !important;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .btn,
    button,
    input,
    select,
    textarea {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .admin-header {
        padding: 0.72rem 0.8rem 0.72rem 3.75rem;
        min-height: 58px;
    }
    
    .header-right {
        width: 100%;
        gap: 0.45rem;
    }

    .header-left h1 {
        font-size: 0.94rem;
        max-width: calc(100vw - 6.2rem);
    }
    
    .search-box {
        width: 100%;
    }
    
    .stats-grid,
    .stats-grid-sm {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .admin-content {
        padding: 0.85rem;
    }

    .current-date {
        font-size: 0.8rem;
    }

    .mobile-menu-toggle {
        top: 0.72rem;
        left: 0.85rem;
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .nav-item {
        padding: 0.95rem 1.1rem;
    }

    .sidebar-header,
    .sidebar-footer {
        padding: 1rem 1.1rem;
    }

    .table-responsive {
        margin: 0 -0.15rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.85rem 0.8rem;
    }
}
