/* NextSoft Admin Panel CSS */
/* RTL Premium Design - v2.0 */

:root {
    --primary: #fb5708;
    --primary-dark: #e04d06;
    --primary-light: #ff7a3d;
    --secondary: #0e2b5c;
    --accent: #13b2f0;
    --accent-light: #4fc3f7;
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    --info: #3b82f6;
    --info-light: #60a5fa;
    
    --bg-dark: #0a0f1a;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --bg-input: #1e293b;
    --bg-hover: #243044;
    --bg-sidebar: linear-gradient(180deg, #0e1525 0%, #0a0f1a 100%);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: rgba(255,255,255,0.08);
    --border-color-hover: rgba(255,255,255,0.15);
    --border-radius: 10px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(251,87,8,0.15);
    
    --sidebar-width: 280px;
    --header-height: 70px;
    
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
    direction: rtl;
    font-weight: 400;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary);
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--secondary) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    height: 50px;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Form Controls */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(251, 87, 8, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 16px;
    padding-left: 36px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 87, 8, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02);
}

.sidebar-logo {
    height: 36px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.sidebar-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    margin-bottom: 4px;
    color: var(--text-secondary);
    transition: all var(--transition);
    position: relative;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    transform: translateX(-2px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(251,87,8,0.15) 0%, rgba(251,87,8,0.05) 100%);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(251,87,8,0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 3px;
    border-radius: 3px;
    background: var(--primary);
}

.nav-icon {
    font-size: 1.25rem;
}

.nav-badge {
    margin-right: auto;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.nav-badge.badge-danger {
    background: var(--danger);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.admin-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.admin-content {
    flex: 1;
    padding: 24px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(251,87,8,0.08) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--border-color-hover);
}

.stat-icon {
    font-size: 2.2rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(251,87,8,0.15) 0%, rgba(251,87,8,0.05) 100%);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(251,87,8,0.2);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.dashboard-card {
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.dashboard-card:hover {
    border-color: var(--border-color-hover);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02);
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 24px;
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255,255,255,0.02);
    border-radius: var(--border-radius);
    transition: background var(--transition-fast);
}

.status-item:hover {
    background: rgba(255,255,255,0.05);
}

.status-count {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
}

.ai-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-label {
    color: var(--text-secondary);
}

.ai-value {
    font-weight: 600;
}

.text-danger {
    color: var(--danger) !important;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-search {
    flex: 1;
    min-width: 200px;
}

.toolbar-filters {
    display: flex;
    gap: 12px;
}

.toolbar-filters .form-control {
    width: 160px;
}

.toolbar-actions {
    display: flex;
    gap: 12px;
}

/* Data Table */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: right;
}

.data-table th {
    background: var(--bg-input);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.data-table .empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Badges */
.badge,
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
}

.badge-primary {
    background: rgba(251, 87, 8, 0.2);
    color: var(--primary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.badge-secondary {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.action-btn.edit:hover {
    color: var(--info);
    border-color: var(--info);
}

.action-btn.delete:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.action-btn.sync:hover {
    color: var(--success);
    border-color: var(--success);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-start;
    gap: 12px;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 99;
}

.mobile-menu-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition);
}

.mobile-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-logo {
    height: 28px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
}

.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    margin-right: auto;
    transition: color var(--transition);
}

.sidebar-close:hover {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    .sidebar-overlay {
        display: block;
        pointer-events: none;
    }
    
    .sidebar-overlay.active {
        pointer-events: auto;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .admin-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        z-index: 100;
        transition: right var(--transition);
    }
    
    .admin-sidebar.open {
        right: 0;
    }
    
    .admin-main {
        margin-right: 0;
        padding-top: 60px;
    }
    
    .admin-header {
        position: static;
        padding: 16px;
    }
    
    .admin-content {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .toolbar-filters {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .toolbar-filters .form-control {
        width: 100%;
        min-width: unset;
    }
    
    .toolbar-actions {
        width: 100%;
    }
    
    .toolbar-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .card {
        border-radius: var(--border-radius);
    }
    
    .card-header {
        padding: 14px 16px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    /* Table responsive */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        font-size: 0.85rem;
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
        white-space: nowrap;
    }
    
    .data-table .actions {
        display: flex;
        gap: 4px;
    }
    
    .data-table .btn-icon {
        padding: 6px;
        font-size: 0.9rem;
    }
    
    /* Modal responsive */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Body when sidebar open */
body.sidebar-open {
    overflow: hidden;
}

/* Stats Grid Small */
.stats-grid-small {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card-small {
    padding: 16px;
}

.stat-card-small .stat-value {
    font-size: 1.5rem;
}

.stat-card-small .stat-label {
    font-size: 0.8rem;
}

/* Expired row */
.row-expired {
    opacity: 0.6;
}

.row-expired td {
    text-decoration: line-through;
    text-decoration-color: var(--text-muted);
}

/* Form row for modals */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-row .form-group {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .stats-grid-small {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Clickable Cards */
.stat-card-link,
.dashboard-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card-link:hover,
.dashboard-card-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-card-link:hover .stat-icon {
    transform: scale(1.1);
}

.stat-card .stat-icon {
    transition: transform 0.2s ease;
}

/* Dashboard Grid 3 columns */
.dashboard-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
    .dashboard-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Nav Divider */
.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px 20px;
}

/* Settings Page */
.settings-container {
    max-width: 800px;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.settings-tab {
    padding: 10px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    font-size: 0.95rem;
}

.settings-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.settings-form .form-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Content Tabs */
.content-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.content-tab {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
}

.content-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.content-tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
    color: white;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Testimonials Grid */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.testimonial-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

.testimonial-card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
}

.testimonial-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.testimonial-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.testimonial-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.testimonial-content {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.testimonial-rating {
    color: #fbbf24;
    font-size: 1rem;
}

.testimonial-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Analytics */
.analytics-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.analytics-filters .form-control {
    max-width: 200px;
}

.chart-container {
    position: relative;
    height: 300px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Responsive for new pages */
@media (max-width: 768px) {
    .settings-tabs {
        flex-direction: column;
    }
    
    .settings-tab {
        width: 100%;
        text-align: center;
    }
    
    .content-tabs {
        flex-direction: column;
    }
    
    .content-tab {
        width: 100%;
        text-align: center;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-filters {
        flex-direction: column;
    }
    
    .analytics-filters .form-control {
        max-width: none;
    }
}

/* Simple Charts */
.simple-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 250px;
    gap: 4px;
    padding: 20px 0;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.chart-bar {
    width: 100%;
    max-width: 30px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height var(--transition);
}

.chart-bar-wrapper:hover .chart-bar {
    background: var(--accent);
}

.chart-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 8px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

/* Sources List */
.sources-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.source-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.source-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.source-name {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.source-count {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
}

.source-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.source-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 4px;
    transition: width var(--transition);
}

/* Rate Limit Settings Card */
.rate-limit-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
}

.settings-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border-color);
}

.settings-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.settings-status {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.settings-status.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.settings-status.status-disabled {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.settings-card-body {
    padding: 20px;
}

.rate-limit-form .form-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.rate-limit-form .form-group {
    flex: 1;
    min-width: 140px;
}

.rate-limit-form .form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.rate-limit-form .form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.rate-limit-form .form-group-toggle {
    display: flex;
    align-items: center;
}

.rate-limit-form .form-group-btn {
    flex: 0 0 auto;
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--bg-input);
    border-radius: 13px;
    transition: var(--transition);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-label input:checked + .toggle-switch {
    background: var(--success);
}

.toggle-label input:checked + .toggle-switch::after {
    left: 25px;
    background: white;
}

.toggle-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .rate-limit-form .form-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .rate-limit-form .form-group {
        width: 100%;
    }
}
