body {
    font-family: 'Segoe UI', system-ui, -apple-system, 'Roboto', sans-serif;
}

.sidebar {
    transition: all 0.2s ease;
}

.sidebar .nav-link {
    color: #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.sidebar .nav-link.active {
    background-color: #0d6efd;
    color: white;
}

main {
    background-color: #f8f9fc;
    min-height: calc(100vh - 100px);
}

.card {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    transition: transform 0.1s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --primary: #1a56db;
    --primary-dark: #1040a8;
    --primary-light: #e8f0fe;
    --secondary: #0e9f6e;
    --secondary-light: #def7ec;
    --danger: #e02424;
    --danger-light: #fde8e8;
    --warning: #e3a008;
    --warning-light: #fdf6b2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 260px;
    --header-height: 64px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  }
  html { font-size: 15px; }
  body { font-family: var(--font); background: var(--gray-100); color: var(--gray-800); line-height: 1.6; }

  /* ===== SCROLLBAR ===== */
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

  /* ===== UTILS ===== */
  .hidden { display: none !important; }
  .flex { display: flex; }
  .items-center { align-items: center; }
  .gap-2 { gap: .5rem; }
  .gap-3 { gap: .75rem; }
  .text-sm { font-size: .85rem; }
  .text-xs { font-size: .75rem; }
  .text-muted { color: var(--gray-500); }
  .font-bold { font-weight: 700; }
  .font-semibold { font-weight: 600; }
  .truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

  /* ===== LOGIN PAGE ===== */
  #page-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a56db 0%, #0e4bb5 50%, #0a3a8f 100%);
    position: relative;
    overflow: hidden;
  }
  #page-login::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: rgba(255,255,255,.04);
    border-radius: 50%;
    top: -200px; right: -100px;
  }
  #page-login::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: rgba(255,255,255,.04);
    border-radius: 50%;
    bottom: -150px; left: -80px;
  }
  .login-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
  }
  .login-logo {
    text-align: center;
    margin-bottom: 2rem;
  }
  .login-logo .logo-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 8px 20px rgba(26,86,219,.3);
  }
  .login-logo .logo-icon svg { color: #fff; }
  .login-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); }
  .login-logo p { color: var(--gray-500); font-size: .875rem; margin-top: .25rem; }
  .form-group { margin-bottom: 1.25rem; }
  .form-label { display: block; font-size: .875rem; font-weight: 600; color: var(--gray-700); margin-bottom: .5rem; }
  .form-input {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font);
    color: var(--gray-800);
    background: var(--gray-50);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
  }
  .form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.12); background: #fff; }
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: none;
    transition: all .2s;
    text-decoration: none;
  }
  .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(26,86,219,.3);
  }
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(26,86,219,.4); }
  .btn-primary:active { transform: translateY(0); }
  .btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1.5px solid var(--primary);
  }
  .btn-outline:hover { background: var(--primary-light); }
  .btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1.5px solid var(--gray-200);
  }
  .btn-secondary:hover { background: var(--gray-200); }
  .btn-success {
    background: linear-gradient(135deg, var(--secondary), #0b8a5e);
    color: #fff;
    box-shadow: 0 4px 12px rgba(14,159,110,.3);
  }
  .btn-sm { padding: .4rem .9rem; font-size: .8rem; }
  .btn-full { width: 100%; }

  /* ===== APP LAYOUT ===== */
  #app { display: flex; min-height: 100vh; }

  /* ===== SIDEBAR ===== */
  .sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform .3s ease;
  }
  .sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: .75rem;
  }
  .sidebar-logo {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .sidebar-logo svg { color: #fff; }
  .sidebar-title { color: #fff; font-weight: 800; font-size: 1rem; line-height: 1.2; }
  .sidebar-subtitle { color: var(--gray-400); font-size: .7rem; line-height: 1.3; }
  .sidebar-nav { padding: 1rem 0; flex: 1; overflow-y: auto; }
  .nav-section-title {
    padding: .5rem 1.5rem .25rem;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gray-500);
  }
  .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.5rem;
    color: var(--gray-400);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    border-radius: 0;
    transition: all .2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    margin-bottom: .1rem;
    position: relative;
  }
  .nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
  .nav-link.active {
    color: #fff;
    background: rgba(26,86,219,.25);
  }
  .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
  }
  .nav-link .nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
  .nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: .15rem .45rem;
    border-radius: 20px;
  }
  .sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .user-info {
    display: flex;
    align-items: center;
    gap: .75rem;
  }
  .user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), #60a5fa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
  }
  .user-name { color: #fff; font-size: .8rem; font-weight: 600; }
  .user-role { color: var(--gray-400); font-size: .7rem; }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
  }

  /* ===== MAIN CONTENT ===== */
  .main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  /* ===== TOP HEADER ===== */
  .topbar {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
  }
  .topbar-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
  }
  .topbar-menu-btn:hover { background: var(--gray-100); }
  .topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--gray-900); }
  .topbar-subtitle { font-size: .75rem; color: var(--gray-500); }
  .topbar-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
  .topbar-sync {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .9rem;
    background: var(--secondary-light);
    color: var(--secondary);
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
  }
  .sync-dot {
    width: 7px; height: 7px;
    background: var(--secondary);
    border-radius: 50%;
    animation: pulse 2s infinite;
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .6; transform: scale(.85); }
  }
  .topbar-notify {
    position: relative;
    width: 36px; height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: background .2s;
  }
  .topbar-notify:hover { background: var(--gray-200); }
  .notify-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 1.5px solid #fff;
  }

  /* ===== PAGE CONTENT ===== */
  .page-content { padding: 1.5rem; flex: 1; }
  .page { display: none; }
  .page.active { display: block; }

  /* ===== STATS CARDS ===== */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  .stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: box-shadow .2s, transform .2s;
  }
  .stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
  .stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .stat-icon.blue { background: var(--primary-light); color: var(--primary); }
  .stat-icon.green { background: var(--secondary-light); color: var(--secondary); }
  .stat-icon.yellow { background: var(--warning-light); color: var(--warning); }
  .stat-icon.red { background: var(--danger-light); color: var(--danger); }
  .stat-icon.purple { background: #f3e8ff; color: #7c3aed; }
  .stat-icon.indigo { background: #e0e7ff; color: #4f46e5; }
  .stat-value { font-size: 1.75rem; font-weight: 800; color: var(--gray-900); line-height: 1; }
  .stat-label { font-size: .8rem; color: var(--gray-500); margin-top: .25rem; }
  .stat-change {
    font-size: .75rem;
    font-weight: 600;
    margin-top: .4rem;
    display: flex;
    align-items: center;
    gap: .2rem;
  }
  .stat-change.up { color: var(--secondary); }
  .stat-change.down { color: var(--danger); }

  /* ===== SECTION CARDS ===== */
  .section-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
  }
  .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
  }
  .section-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: .5rem;
  }
  .section-title svg { color: var(--primary); }
  .section-body { padding: 1.25rem; }

  /* ===== DASHBOARD GRID ===== */
  .dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }
  .dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
  }
.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
  }

  /* ===== CHART BAR (CSS-only) ===== */
  .chart-bars { display: flex; align-items: flex-end; gap: .4rem; height: 120px; }
  .chart-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: .3rem; flex: 1; }
  .chart-bar {
    width: 100%;
    background: linear-gradient(to top, var(--primary), #60a5fa);
    border-radius: 4px 4px 0 0;
    transition: opacity .2s;
    min-height: 4px;
  }
  .chart-bar:hover { opacity: .8; }
  .chart-bar.today { background: linear-gradient(to top, var(--secondary), #34d399); }
  .chart-label { font-size: .65rem; color: var(--gray-500); }
  .chart-val { font-size: .7rem; font-weight: 700; color: var(--gray-700); }

  /* ===== RANKING LIST ===== */
  .rank-list { display: flex; flex-direction: column; gap: .6rem; }
  .rank-item {
    display: flex;
    align-items: center;
    gap: .75rem;
  }
  .rank-num {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 800;
    color: var(--gray-600);
    flex-shrink: 0;
  }
  .rank-num.gold { background: #fef3c7; color: #d97706; }
  .rank-num.silver { background: var(--gray-100); color: var(--gray-500); }
  .rank-num.bronze { background: #fef3c7; color: #b45309; }
  .rank-bar-wrap { flex: 1; }
  .rank-name { font-size: .8rem; font-weight: 600; color: var(--gray-700); margin-bottom: .2rem; }
  .rank-bar-track { background: var(--gray-100); border-radius: 4px; height: 6px; }
  .rank-bar-fill { height: 6px; border-radius: 4px; background: linear-gradient(90deg, var(--primary), #60a5fa); }
  .rank-count { font-size: .8rem; font-weight: 700; color: var(--gray-800); flex-shrink: 0; }

  /* ===== TAGS ===== */
  .tags-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
  .tag {
    padding: .3rem .75rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    cursor: default;
    transition: transform .15s;
  }
  .tag:hover { transform: scale(1.05); }
  .tag-blue { background: var(--primary-light); color: var(--primary); }
  .tag-green { background: var(--secondary-light); color: #057a55; }
  .tag-yellow { background: var(--warning-light); color: #92400e; }
  .tag-purple { background: #f3e8ff; color: #6d28d9; }
  .tag-red { background: var(--danger-light); color: #9b1c1c; }
  .tag-indigo { background: #e0e7ff; color: #3730a3; }

  /* ===== ACTIVITY FEED ===== */
  .activity-list { display: flex; flex-direction: column; gap: 0; }
  .activity-item {
    display: flex;
    gap: .75rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--gray-100);
  }
  .activity-item:last-child { border-bottom: none; }
  .activity-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-top: .5rem;
    flex-shrink: 0;
  }
  .activity-dot.green { background: var(--secondary); }
  .activity-dot.blue { background: var(--primary); }
  .activity-dot.yellow { background: var(--warning); }
  .activity-text { font-size: .8rem; color: var(--gray-700); line-height: 1.5; }
  .activity-time { font-size: .7rem; color: var(--gray-400); margin-top: .15rem; }

  /* ===== NEWS LIST ===== */
  .filters-bar {
    background: #fff;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-end;
  }
  .filter-group { display: flex; flex-direction: column; gap: .3rem; }
  .filter-label { font-size: .75rem; font-weight: 600; color: var(--gray-600); }
  .filter-select, .filter-input {
    padding: .5rem .75rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-family: var(--font);
    color: var(--gray-700);
    background: var(--gray-50);
    outline: none;
    min-width: 140px;
    transition: border-color .2s;
  }
  .filter-select:focus, .filter-input:focus { border-color: var(--primary); }
  .news-list { display: flex; flex-direction: column; gap: .75rem; }
  .news-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1rem;
    cursor: pointer;
    transition: box-shadow .2s, transform .2s;
    border-left: 4px solid transparent;
  }
  .news-card:hover { box-shadow: var(--shadow-md); transform: translateX(4px); border-left-color: var(--primary); }
  .news-card-thumb {
    width: 80px; height: 80px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
  }
  .news-card-body { flex: 1; min-width: 0; }
  .news-card-title { font-size: .9rem; font-weight: 700; color: var(--gray-900); margin-bottom: .3rem; line-height: 1.3; }
  .news-card-desc { font-size: .8rem; color: var(--gray-600); line-height: 1.5; margin-bottom: .6rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .news-card-meta { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
  .meta-chip {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    color: var(--gray-500);
  }
  .meta-chip svg { width: 13px; height: 13px; }
  .org-badge {
    padding: .2rem .6rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
  }
  .status-badge {
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
  }
  .status-badge.generated { background: var(--secondary-light); color: #057a55; }
  .status-badge.pending { background: var(--warning-light); color: #92400e; }

  /* ===== NEWS DETAIL ===== */
  .detail-back {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--primary);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1.25rem;
    width: fit-content;
    padding: .4rem .75rem;
    border-radius: var(--radius-sm);
    transition: background .2s;
  }
  .detail-back:hover { background: var(--primary-light); }
  .detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 1.5rem; }
  .detail-main { display: flex; flex-direction: column; gap: 1rem; }
  .detail-sidebar-col { display: flex; flex-direction: column; gap: 1rem; }
  .detail-header {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
  }
  .detail-title { font-size: 1.3rem; font-weight: 800; color: var(--gray-900); margin-bottom: .75rem; line-height: 1.3; }
  .detail-meta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
  .detail-summary {
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    font-size: .875rem;
    color: var(--primary-dark);
    line-height: 1.6;
    border-left: 4px solid var(--primary);
  }
  .orig-post-block {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
  }
  .orig-post-text { font-size: .85rem; color: var(--gray-700); line-height: 1.7; white-space: pre-line; }
  .vk-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: 1rem;
    color: #0077ff;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    padding: .4rem .8rem;
    border-radius: var(--radius-sm);
    background: #e8f0ff;
    transition: background .2s;
  }
  .vk-link:hover { background: #ccdeff; }
  .images-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .75rem; }
  .img-thumb {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    transition: transform .2s;
  }
  .img-thumb:hover { transform: scale(1.03); }
  .titles-list { display: flex; flex-direction: column; gap: .6rem; }
  .title-option {
    display: flex;
    gap: .75rem;
    padding: .75rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .2s;
    align-items: flex-start;
  }
  .title-option:hover { border-color: var(--primary); background: var(--primary-light); }
  .title-option.selected { border-color: var(--primary); background: var(--primary-light); }
  .title-num {
    width: 22px; height: 22px;
    background: var(--gray-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 800;
    color: var(--gray-600);
    flex-shrink: 0;
    margin-top: .1rem;
  }
  .title-option.selected .title-num { background: var(--primary); color: #fff; }
  .title-text { font-size: .85rem; font-weight: 600; color: var(--gray-800); line-height: 1.4; }
  .gen-news-text {
    font-size: .875rem;
    color: var(--gray-700);
    line-height: 1.8;
    white-space: pre-line;
  }

  /* ===== EMPTY PLACEHOLDER PAGES ===== */
  .placeholder-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
  }
  .placeholder-icon {
    width: 80px; height: 80px;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--gray-400);
  }
  .placeholder-title { font-size: 1.25rem; font-weight: 700; color: var(--gray-700); margin-bottom: .5rem; }
  .placeholder-text { font-size: .875rem; color: var(--gray-500); max-width: 360px; }

  /* ===== DIGEST PAGE ===== */
  .digest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
  .digest-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    cursor: pointer;
  }
  .digest-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
  .digest-card-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
  }
  .digest-card-date { font-size: .75rem; opacity: .8; margin-bottom: .3rem; }
  .digest-card-title { font-size: .95rem; font-weight: 700; }
  .digest-card-body { padding: 1.25rem; }
  .digest-card-stats { display: flex; gap: 1rem; margin-bottom: .75rem; }
  .digest-stat { font-size: .75rem; color: var(--gray-600); }
  .digest-stat span { font-weight: 700; color: var(--gray-800); }
  .digest-card-tags { display: flex; flex-wrap: wrap; gap: .4rem; }

  /* ===== REPORTS PAGE ===== */
  .report-list { display: flex; flex-direction: column; gap: .75rem; }
  .report-item {
    background: #fff;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: box-shadow .2s;
  }
  .report-item:hover { box-shadow: var(--shadow-md); }
  .report-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .report-title { font-size: .875rem; font-weight: 700; color: var(--gray-800); }
  .report-desc { font-size: .75rem; color: var(--gray-500); margin-top: .15rem; }
  .report-date { font-size: .75rem; color: var(--gray-400); margin-left: auto; }

  /* ===== RATINGS PAGE ===== */
  .ratings-table-wrap { overflow-x: auto; }
  table.ratings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
  }
  .ratings-table th {
    padding: .75rem 1rem;
    text-align: left;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
  }
  .ratings-table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
  }
  .ratings-table tr:hover td { background: var(--gray-50); }
  .ratings-table .medal { font-size: 1.1rem; }
  .progress-mini { height: 6px; background: var(--gray-100); border-radius: 3px; margin-top: .3rem; }
  .progress-mini-fill { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--primary), #60a5fa); }

  /* ===== RESPONSIVE ===== */
  @media (max-width: 1100px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 900px) {
    .dashboard-grid-3 { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 768px) {
    :root { --sidebar-width: 260px; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; }
    .topbar-menu-btn { display: flex; }
    .dashboard-grid-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-content { padding: 1rem; }
    .detail-grid { grid-template-columns: 1fr; }
    .images-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .news-card { flex-direction: column; }
    .news-card-thumb { width: 100%; height: 140px; }
    .login-card { padding: 1.5rem; margin: 1rem; }
    .topbar-sync { display: none; }
  }

  /* ===== DONUT CHART (CSS) ===== */
  .donut-wrap { display: flex; align-items: center; gap: 1.5rem; }
  .donut {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: conic-gradient(
      var(--primary) 0% 38%,
      var(--secondary) 38% 62%,
      var(--warning) 62% 74%,
      #7c3aed 74% 86%,
      var(--gray-200) 86% 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .donut-inner {
    width: 65px; height: 65px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    font-weight: 700;
    color: var(--gray-600);
    text-align: center;
    line-height: 1.3;
  }
  .donut-legend { display: flex; flex-direction: column; gap: .4rem; }
  .donut-legend-item { display: flex; align-items: center; gap: .5rem; font-size: .75rem; color: var(--gray-600); }
  .donut-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
/* Модальное окно для фото */
.modal-content.bg-dark {
    background: rgba(0,0,0,0.9) !important;
}
.img-thumb {
    cursor: pointer;
}
/* Уведомление о копировании */
.copy-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    pointer-events: none;
}
.copy-toast-inner {
    background: var(--gray-800);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.copy-toast-success {
    background: var(--secondary);
}
.copy-toast-error {
    background: var(--danger);
}
/* в dashboard.css */
.chart-bars {
    align-items: flex-end;
}
.chart-bar {
    width: 100%;
    background: linear-gradient(to top, var(--primary), #60a5fa);
    border-radius: 4px 4px 0 0;
    transition: opacity .2s;
    min-height: 2px;
}
.dashboard-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 900px) {
    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }
}
.table th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    background-color: var(--gray-50);
}

.table td {
    font-size: 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
}

.table-hover tbody tr:hover {
    background-color: var(--gray-50);
}
/* Стиль для ссылок на посты в аналитическом дайджесте */
.digest-content a.digest-post-link {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.1rem 0.4rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    margin: 0 0.1rem;
    transition: background 0.2s;
}
.digest-content a.digest-post-link:hover {
    background: var(--primary);
    color: white;
    text-decoration: none;
}