/* ==================== VARIABLES & RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f3f4f6;
    --white: #ffffff;
    --bg-dark: #0a0a0a;
    --bg-secondary: #111827;
    --border-color: rgba(99, 102, 241, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: #e5e7eb;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.fade-enter-active, .fade-leave-active {
    transition: all 0.3s ease;
}

.fade-enter-from, .fade-leave-to {
    opacity: 0;
    transform: translateY(10px);
}

/* ==================== LOGIN PAGE ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    position: relative;
    overflow: hidden;
}

.login-bg-animation {
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 50% 100%, rgba(99, 102, 241, 0.2) 0%, transparent 50%);
    animation: pulse 20s ease-in-out infinite;
}

.login-box {
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 420px;
    animation: fadeIn 0.6s ease;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.login-logo p {
    color: #9ca3af;
    font-size: 1.125rem;
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.btn-login {
    width: 100%;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-arrow {
    transition: transform 0.3s ease;
}

.btn-login:hover .login-arrow {
    transform: translateX(5px);
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    color: #e5e7eb;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: rgba(17, 24, 39, 0.8);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: #e5e7eb;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.btn-ghost:hover {
    background: rgba(156, 163, 175, 0.1);
    color: #e5e7eb;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ==================== ADMIN LAYOUT ==================== */
.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-dark);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-dark) 100%);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    animation: slideIn 0.3s ease;
}

.sidebar-header {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.sidebar-header p {
    color: #6b7280;
    font-size: 0.875rem;
}

.nav-menu {
    padding: 1rem 0;
}

.nav-item {
    display: block;
    padding: 0.875rem 1.5rem;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-item:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding-left: 2rem;
}

.nav-item:hover::before,
.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 1.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    animation: fadeIn 0.5s ease;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.content-header h2 {
    font-size: 2rem;
    color: #e5e7eb;
}

/* ==================== USER INTERFACE ==================== */
.main-header {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    animation: fadeIn 0.3s ease;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-info {
    color: #9ca3af;
    font-size: 0.875rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-search {
    width: 300px;
}

/* User Main Content */
.user-main-content {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 2rem;
}

/* Categories Sidebar */
.categories-sidebar {
    width: 250px;
    background: rgba(31, 41, 55, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.categories-sidebar h3 {
    color: #e5e7eb;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: block;
    padding: 0.75rem 1rem;
    color: #9ca3af;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.category-list a:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.category-list a.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
}

/* Articles Section */
.articles-section {
    flex: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    color: #e5e7eb;
}

.article-count {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Featured Section */
.featured-section {
    margin-bottom: 3rem;
}

.featured-section h3 {
    color: #e5e7eb;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.featured-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.featured-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.2);
}

.featured-card:hover::before {
    opacity: 1;
}

.featured-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.featured-card h4 {
    color: #e5e7eb;
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.featured-card p {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.article-card {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

.article-card:hover::before {
    opacity: 1;
}

.article-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.article-card h3 {
    color: #e5e7eb;
    font-size: 1.25rem;
    flex: 1;
    margin-right: 1rem;
}

.article-card p {
    color: #9ca3af;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.read-more {
    color: var(--primary);
    font-weight: 500;
    transition: transform 0.3s ease;
}

.article-card:hover .read-more {
    transform: translateX(5px);
}

/* Article View */
.article-view {
    animation: fadeIn 0.5s ease;
}

.article-content-wrapper {
    background: rgba(31, 41, 55, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem;
    margin-top: 2rem;
}

.article-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    gap: 2rem;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.article-content {
    color: #e5e7eb;
    line-height: 1.8;
    font-size: 1.1rem;
}

.article-content h2 {
    color: var(--primary);
    margin: 2rem 0 1rem;
    font-size: 1.75rem;
}

.article-content h3 {
    color: var(--secondary);
    margin: 1.5rem 0 0.75rem;
    font-size: 1.5rem;
}

/* Явные стили для H1, чтобы не наследовались лишние text-transform и т.п. */
.ql-editor h1,
.article-content h1 {
    color: #e5e7eb;
    margin: 2.25rem 0 1.25rem;
    font-size: 2.25rem; /* ≈ 36px при базовом 16px */
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: normal;
    text-transform: none;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content ul, .article-content ol {
    margin: 1rem 0 1rem 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content pre {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content code {
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #9ca3af;
    font-style: italic;
}

/* ==================== ADMIN SPECIFIC ==================== */
/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-content h3 {
    font-size: 2rem;
    color: #e5e7eb;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Recent Section */
.recent-section {
    background: rgba(31, 41, 55, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.recent-section h3 {
    color: #e5e7eb;
    margin-bottom: 1rem;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(17, 24, 39, 0.5);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.recent-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.recent-item h4 {
    color: #e5e7eb;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.recent-item p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: rgba(31, 41, 55, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
}

td {
    padding: 1rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.05);
    color: #e5e7eb;
}

tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
}

.category-card h3 {
    color: #e5e7eb;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: #6b7280;
    margin-bottom: 1rem;
}

/* ==================== COMPONENTS ==================== */
/* Search Box */
.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    color: #e5e7eb;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

/* Badges */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.role-badge.admin {
    background: rgba(139, 92, 246, 0.1);
    color: var(--secondary);
}

.role-badge.user {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.action-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.action-btn-danger:hover {
    background: var(--danger);
    color: white;
}

.star-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.star-btn.active {
    color: #fbbf24;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.page-info {
    color: #6b7280;
}

/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-content {
    background: #1f2937;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.modal-large {
    max-width: 900px;
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.5rem;
    color: #e5e7eb;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.close-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.close-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ==================== EDITOR ==================== */
.ql-container {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
    min-height: 300px;
}

.ql-toolbar {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
}

.ql-editor {
    color: #e5e7eb;
    font-size: 1rem;
    line-height: 1.8;
    min-height: 300px;
}

.ql-snow .ql-stroke {
    stroke: #9ca3af;
}

.ql-snow .ql-fill {
    fill: #9ca3af;
}

.ql-snow .ql-picker {
    color: #9ca3af;
}

.ql-snow .ql-picker-label:hover {
    color: var(--primary);
}

/* ==================== IMAGE VIEWER ==================== */
.image-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
}

.image-viewer-container {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-container img {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: default;
    animation: zoomIn 0.3s ease;
}

.image-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.image-viewer-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Стили для изображений в контенте */
.article-content img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    margin: 1.5rem auto;
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: rgba(31, 41, 55, 0.3);
    padding: 2px;
}

.article-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.article-content p img {
    display: block;
    margin: 1.5rem auto;
}

/* Центрирование маленьких изображений */
.article-content p {
    text-align: center;
}

.article-content p:has(img) + p {
    text-align: left;
}

/* Подпись под изображением (если нужно) */
.article-content img + em {
    display: block;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

/* Стили для редактора */
.ql-editor img {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    margin: 1rem auto;
    display: block;
    cursor: move;
    background: rgba(31, 41, 55, 0.3);
    padding: 2px;
}

.ql-editor.drag-over {
    background: rgba(99, 102, 241, 0.05);
    border: 2px dashed var(--primary);
    transition: all 0.3s ease;
}

/* Анимация появления просмотрщика */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== ALERTS & TOASTS ==================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid;
    animation: fadeIn 0.3s ease;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: #e5e7eb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    z-index: 2000;
    min-width: 300px;
}

.toast.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.toast.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ==================== MOBILE MENU ==================== */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 101;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary);
    padding: 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.25rem;
}

/* ==================== UTILITIES ==================== */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .featured-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Mobile Sidebar */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* Mobile Layout */
    .container {
        flex-direction: column;
    }

    .categories-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 2rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    /* Mobile Header */
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .header-left {
        justify-content: space-between;
    }

    .header-right {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-search {
        width: 100%;
    }

    /* Mobile Modals */
    .modal-content {
        padding: 1.5rem;
    }

    /* Mobile Article View */
    .article-content-wrapper {
        padding: 1.5rem;
    }

    .article-title {
        font-size: 2rem;
    }

    /* Mobile Tables */
    .table-container {
        padding: 0.5rem;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 2rem 1.5rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* ==================== ДОБАВЬТЕ ЭТИ СТИЛИ К СУЩЕСТВУЮЩЕМУ style.css ==================== */

/* Обновленные стили для ролей */
.role-badge.buyer {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.role-badge.designer {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.role-badge.affiliate {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* Roles Checkboxes */
.roles-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem;
    background: rgba(17, 24, 39, 0.3);
    border-radius: 8px;
}

.roles-checkboxes .checkbox-label {
    margin: 0;
}

/* Roles List in Table */
.roles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.roles-list .role-badge {
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
}

/* User info update */
.user-info {
    color: #9ca3af;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info .role-badge {
    font-size: 0.75rem;
}

/* Divider стили */
.article-divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
    margin: 2rem 0;
    opacity: 0.5;
}

/* Spoiler стили */
.spoiler-container {
    margin: 1rem 0;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    background: rgba(31, 41, 55, 0.3);
    overflow: hidden;
}

.spoiler-header {
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    transition: background 0.3s ease;
}

.spoiler-header:hover {
    background: rgba(99, 102, 241, 0.1);
}

.spoiler-toggle {
    color: var(--primary);
    font-size: 0.875rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.spoiler-open .spoiler-toggle {
    transform: rotate(90deg);
}

.spoiler-title {
    color: #e5e7eb;
    font-weight: 500;
    flex: 1;
    outline: none;
    border: none;
    background: transparent;
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem;
    border-radius: 4px;
}

.spoiler-title:focus {
    background: rgba(99, 102, 241, 0.1);
}

.spoiler-content {
    padding: 1rem;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    min-height: 50px;
    outline: none;
}

/* Вложенные спойлеры */
.spoiler-content .spoiler-container {
    margin: 0.5rem 0;
}

/* Кнопки в тулбаре */
.ql-divider, .ql-spoiler {
    width: auto !important;
    padding: 0 8px !important;
    font-size: 14px !important;
    color: #9ca3af;
}

.ql-divider:hover, .ql-spoiler:hover {
    color: var(--primary);
}

.ql-divider::before {
    content: '—';
    font-weight: bold;
}

.ql-spoiler::before {
    content: '▼';
}

/* Стили для просмотра статей */
.article-content .spoiler-container {
    margin: 1.5rem 0;
}

.article-content .spoiler-header {
    background: rgba(99, 102, 241, 0.08);
}

.article-content .spoiler-title {
    cursor: default;
    pointer-events: none;
}

/* Анимация раскрытия */
@keyframes spoilerOpen {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spoiler-content {
    animation: spoilerOpen 0.3s ease;
}

/* ==================== ДОБАВЬТЕ ЭТИ СТИЛИ В style.css ==================== */

/* Color Input */
.color-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.color-input {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background: rgba(17, 24, 39, 0.6);
}

.color-text {
    flex: 1;
    max-width: 150px;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* System Badge */
.system-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: rgba(139, 92, 246, 0.1);
    color: var(--secondary);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Roles Table Specific */
.table-container table td .color-preview {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* Dynamic Role Badges */
.role-badge[style] {
    transition: all 0.3s ease;
}

/* Role Management Card */
.role-card {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.role-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
}

/* Role Stats */
.role-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.role-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Icon Input */
.form-group input[maxlength="2"] {
    font-size: 1.5rem;
    text-align: center;
}

/* Обновленные стили для редактора */
/* Обновленные стили для редактора *//* Обновленные стили для редактора */
.ql-editor {
    text-align: left !important;
}

.ql-editor p {
    text-align: left !important;
}

.ql-editor img {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    margin: 1rem auto;
    display: block;
    cursor: move;
    background: rgba(31, 41, 55, 0.3);
    padding: 2px;
}

.article-content {
    text-align: left !important;
}

.article-content p {
    text-align: left !important;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.draft {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.status-badge.published {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}


/* Стиль для отрендеренного разделителя в статье */

/* Добавьте в style.css если еще нет */

.article-divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
    margin: 2rem auto;
    opacity: 0.5;
    display: block;
    clear: both;
    max-width: 300px;
}

/* Дополнительные стили для статьи */
.article-content hr.article-divider {
    margin: 2.5rem auto;
    max-width: 400px;
}

/* Spoiler for macros help */
.spoiler-content {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(31, 41, 55, 0.3);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 6px;
}

.macro-help-list {
    margin: 0 0 10px 18px;
}

.macro-help-list code {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 1px 6px;
    border-radius: 4px;
}

.macro-help-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.copy-icon {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    border-radius: 6px;
    padding: 4px 6px;
}

.copy-icon:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}

.macro-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.macro-btn {
    padding: 6px 10px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    cursor: pointer;
    font-size: 0.875rem;
    border-radius: 6px;
}

.macro-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}
