/* assets/css/app.css */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --secondary: #ec4899;
  --bg: #0f0f14;
  --bg-card: #1a1a2e;
  --bg-card2: #16213e;
  --bg-hover: #1e1e35;
  --border: #2a2a45;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: .2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font-family: inherit; font-size: 1rem; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
  max-width: 768px;
  margin: 0 auto;
  position: relative;
}

.main-content {
  flex: 1;
  padding-bottom: 80px; /* space for bottom nav */
}

/* ===== TOP BAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,15,20,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-logo {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 768px;
  background: rgba(26,26,46,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 0 12px;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  border-radius: 12px;
  color: var(--text-dim);
  transition: var(--transition);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-item svg { width: 22px; height: 22px; }
.nav-item.active, .nav-item:hover { color: var(--primary); }
.nav-item.active svg { filter: drop-shadow(0 0 6px var(--primary)); }

.nav-item-center {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white !important;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -16px;
  box-shadow: 0 4px 16px rgba(99,102,241,0.5);
  transition: var(--transition);
}
.nav-item-center:hover { transform: scale(1.1); }
.nav-item-center svg { width: 24px; height: 24px; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover { border-color: var(--primary); box-shadow: 0 0 20px rgba(99,102,241,0.1); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.5); }

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

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: var(--danger); color: white; }

.btn-success {
  background: rgba(16,185,129,0.15);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.3);
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: 8px; }
.btn-icon { padding: 8px; border-radius: 10px; }
.btn-full { width: 100%; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.form-control::placeholder { color: var(--text-dim); }

textarea.form-control { min-height: 120px; resize: vertical; }

.form-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.form-success {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--success);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* ===== AUTH PAGES ===== */
.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.auth-logo {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 0.9rem;
}

.auth-divider {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 20px 0;
  position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ===== CLAN CARDS ===== */
.clan-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.clan-option {
  position: relative;
}

.clan-option input[type=radio] { display: none; }

.clan-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-card2);
  border: 2px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.clan-option input:checked + .clan-label {
  border-color: var(--primary);
  background: rgba(99,102,241,0.1);
  box-shadow: 0 0 20px rgba(99,102,241,0.2);
}

.clan-label:hover { border-color: var(--text-muted); }

.clan-icon { font-size: 2rem; }
.clan-name { font-weight: 700; font-size: 0.9rem; }
.clan-members { font-size: 0.75rem; color: var(--text-dim); }

/* ===== AVATAR ===== */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-sm { width: 36px; height: 36px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 96px; height: 96px; }

.avatar-placeholder {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.avatar-placeholder.avatar-sm { width: 36px; height: 36px; font-size: 0.85rem; }
.avatar-placeholder.avatar-md { width: 48px; height: 48px; font-size: 1rem; }
.avatar-placeholder.avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar-placeholder.avatar-xl { width: 96px; height: 96px; font-size: 2rem; }

/* ===== POST CARD ===== */
.post-card {
  margin-bottom: 12px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}

.post-user-info { flex: 1; min-width: 0; }

.post-username {
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.clan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(99,102,241,0.15);
  color: var(--primary-light);
  border: 1px solid rgba(99,102,241,0.2);
}

.post-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}

.post-body { padding: 14px 16px 4px; }

.post-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-content {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px 14px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.action-btn:hover { color: var(--primary); background: rgba(99,102,241,0.1); }
.action-btn.liked { color: var(--secondary); }
.action-btn.liked:hover { background: rgba(236,72,153,0.1); }
.action-btn svg { width: 20px; height: 20px; }

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 20px 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.page-back {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: var(--transition);
}
.page-back:hover { border-color: var(--primary); color: var(--primary); }

/* ===== ADMIN ===== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

.admin-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-logo {
  padding: 0 20px 24px;
  font-size: 1.3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
  font-size: 0.9rem;
}

.admin-nav-item:hover, .admin-nav-item.active {
  color: var(--primary);
  background: rgba(99,102,241,0.08);
  border-left-color: var(--primary);
}

.admin-nav-item svg { width: 18px; height: 18px; }

.admin-main { padding: 28px; overflow-x: hidden; }

.admin-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-page-title { font-size: 1.5rem; font-weight: 800; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

@media (min-width: 1024px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card2);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(42,42,69,0.5);
  vertical-align: middle;
}

.admin-table tr:hover td { background: var(--bg-hover); }

.admin-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-admin { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-moderator { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-user { background: rgba(99,102,241,0.15); color: var(--primary); }
.badge-active { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-banned { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ===== SECTION ===== */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  padding: 28px 24px 36px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

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

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin: 0 auto 20px;
}

.modal-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 20px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.empty-state-text { font-size: 0.9rem; line-height: 1.6; }

/* ===== UTILITY ===== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* STORIES BAR */
.stories-bar {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stories-bar::-webkit-scrollbar { display: none; }

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  cursor: pointer;
}

.story-ring {
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.story-ring.seen {
  background: var(--border);
}

.story-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--bg);
  object-fit: cover;
}

.story-name {
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 60px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== FEED TABS ===== */
.feed-tabs {
  display: flex;
  gap: 0;
  padding: 0 16px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 57px;
  z-index: 90;
  background: rgba(15,15,20,0.92);
  backdrop-filter: blur(20px);
}

.feed-tab {
  flex: 1;
  padding: 12px 16px;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.feed-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Clan color dots */
.clan-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Search */
.search-bar {
  padding: 10px 16px;
  position: sticky;
  top: 57px;
  z-index: 90;
  background: var(--bg);
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-dim);
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 16px 11px 42px;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* Admin mobile top nav */
.admin-mobile-nav {
  display: none;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

@media (max-width: 768px) {
  .admin-mobile-nav { display: flex; }
  .admin-main { padding: 16px; }
}

/* Pagination */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 20px 16px;
  flex-wrap: wrap;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* Toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle {
  position: relative;
  width: 46px;
  height: 26px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 26px;
  transition: var(--transition);
}

.toggle-slider::before {
  position: absolute;
  content: '';
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Color input */
input[type=color] {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  padding: 2px;
}

/* Admin section card */
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.admin-section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-section-body { padding: 20px; }


/* ═══════════════════════════════════════════════════════════
   СВЕТЛАЯ ТЕМА — Instagram iOS Style
   Активируется через: <html data-theme="light">
═══════════════════════════════════════════════════════════ */

[data-theme="light"] {

  /* ── Цвета ── */
  --primary:       #0095f6;
  --primary-dark:  #0074cc;
  --primary-light: #47b4ff;
  --secondary:     #ed4956;
  --bg:            #fafafa;
  --bg-card:       #ffffff;
  --bg-card2:      #f5f5f5;
  --bg-hover:      #f0f0f0;
  --border:        #dbdbdb;
  --text:          #262626;
  --text-muted:    #737373;
  --text-dim:      #a8a8a8;
  --success:       #1aad19;
  --danger:        #ed4956;
  --warning:       #ff9500;
  --shadow:        0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);

  /* ── Типографика — SF Pro как у iOS ── */
  font-family: -apple-system, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Body */
[data-theme="light"] body {
  background: #fafafa;
  color: #262626;
}

/* Скроллбар */
[data-theme="light"] ::-webkit-scrollbar-track { background: #fafafa; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #dbdbdb; }

/* ── Topbar ── */
[data-theme="light"] .topbar {
  background: rgba(255,255,255,0.94);
  border-bottom: 1px solid #dbdbdb;
  box-shadow: none;
}

[data-theme="light"] .topbar-logo {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Billabong', 'Grand Hotel', cursive, -apple-system;
  font-size: 1.7rem;
  letter-spacing: 0;
  font-weight: 400;
}

/* ── Bottom nav ── */
[data-theme="light"] .bottom-nav {
  background: rgba(255,255,255,0.96);
  border-top: 1px solid #dbdbdb;
  box-shadow: 0 -1px 0 #dbdbdb;
}

[data-theme="light"] .nav-item { color: #a8a8a8; }
[data-theme="light"] .nav-item.active,
[data-theme="light"] .nav-item:hover { color: #262626; }
[data-theme="light"] .nav-item.active svg { filter: none; }

[data-theme="light"] .nav-item-center {
  background: #262626;
  box-shadow: none;
}

/* ── Sidebar ── */
[data-theme="light"] #sidebar {
  background: #fff;
  border-right: 1px solid #dbdbdb;
  box-shadow: 0 0 40px rgba(0,0,0,0.12);
}

[data-theme="light"] .sb-header {
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  border-bottom: 1px solid #dbdbdb;
}

[data-theme="light"] .sb-logo {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .sb-close {
  background: #f5f5f5;
  border-color: #dbdbdb;
  color: #737373;
}
[data-theme="light"] .sb-close:hover { background: #efefef; color: #262626; }

[data-theme="light"] .sb-profile { border-bottom-color: #dbdbdb; }
[data-theme="light"] .sb-profile:hover { background: #fafafa; }
[data-theme="light"] .sb-profile-name { color: #262626; }
[data-theme="light"] .sb-profile-sub  { color: #737373; }

[data-theme="light"] .sb-section-title { color: #a8a8a8; }

[data-theme="light"] .sb-item { color: #737373; }
[data-theme="light"] .sb-item:hover,
[data-theme="light"] .sb-item.active { color: #262626; background: #fafafa; }
[data-theme="light"] .sb-item::before {
  background: #262626;
}

[data-theme="light"] .sb-item-icon {
  background: #f5f5f5;
}
[data-theme="light"] .sb-item.active .sb-item-icon,
[data-theme="light"] .sb-item:hover .sb-item-icon {
  background: #efefef;
}

[data-theme="light"] .sb-footer { border-top-color: #dbdbdb; }
[data-theme="light"] .sb-footer-btn { color: #737373; background: #fafafa; border-color: #dbdbdb; }
[data-theme="light"] .sb-footer-btn:hover { background: #efefef; color: #262626; }
[data-theme="light"] .sb-footer-btn.danger:hover { background: rgba(237,73,86,.06); color: #ed4956; }

[data-theme="light"] #sidebar-overlay.open { background: rgba(0,0,0,0.4); }

/* ── Cards / Posts ── */
[data-theme="light"] .card,
[data-theme="light"] .post-card {
  background: #fff;
  border: 1px solid #dbdbdb;
  box-shadow: none;
}

[data-theme="light"] .card:hover {
  border-color: #c7c7c7;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* ── Кнопки ── */
[data-theme="light"] .btn-primary {
  background: #0095f6;
  box-shadow: none;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0;
}
[data-theme="light"] .btn-primary:hover {
  background: #0074cc;
  transform: none;
  box-shadow: none;
}

[data-theme="light"] .btn-secondary {
  background: #fff;
  border-color: #dbdbdb;
  color: #262626;
}
[data-theme="light"] .btn-secondary:hover {
  background: #fafafa;
  border-color: #c7c7c7;
  color: #262626;
}

[data-theme="light"] .btn-danger {
  background: rgba(237,73,86,0.08);
  border-color: rgba(237,73,86,0.25);
}

/* ── Формы ── */
[data-theme="light"] .form-control {
  background: #fafafa;
  border: 1px solid #dbdbdb;
  color: #262626;
  border-radius: 6px;
}
[data-theme="light"] .form-control:focus {
  border-color: #a8a8a8;
  box-shadow: none;
  background: #fff;
}
[data-theme="light"] .form-control::placeholder { color: #a8a8a8; }
[data-theme="light"] .form-label { color: #737373; }

/* ── Auth ── */
[data-theme="light"] .auth-container { background: #fafafa; }
[data-theme="light"] .auth-card {
  background: #fff;
  border-color: #dbdbdb;
  box-shadow: none;
  border-radius: 1px;
}
[data-theme="light"] .auth-logo {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Billabong', 'Grand Hotel', cursive;
  font-weight: 400;
  font-size: 3.2rem;
  letter-spacing: 0;
}
[data-theme="light"] .auth-subtitle { color: #737373; }
[data-theme="light"] .auth-divider::before,
[data-theme="light"] .auth-divider::after { background: #dbdbdb; }

/* ── Feed tabs ── */
[data-theme="light"] .feed-tabs {
  background: rgba(255,255,255,0.94);
  border-bottom-color: #dbdbdb;
}
[data-theme="light"] .feed-tab { color: #a8a8a8; }
[data-theme="light"] .feed-tab.active { color: #262626; border-bottom-color: #262626; }

/* ── Search ── */
[data-theme="light"] .search-bar { background: #fafafa; }
[data-theme="light"] .search-input {
  background: #efefef;
  border: none;
  border-radius: 10px;
  color: #262626;
}
[data-theme="light"] .search-input:focus {
  background: #e8e8e8;
  border: none;
  box-shadow: none;
}

/* ── Action кнопки поста ── */
[data-theme="light"] .action-btn { color: #262626; }
[data-theme="light"] .action-btn:hover { color: #0095f6; background: rgba(0,149,246,.06); }
[data-theme="light"] .action-btn.liked { color: #ed4956; }
[data-theme="light"] .action-btn.liked:hover { background: rgba(237,73,86,.06); }

/* ── Clan badge ── */
[data-theme="light"] .clan-badge {
  background: rgba(0,149,246,0.08);
  color: #0095f6;
  border-color: rgba(0,149,246,0.2);
}

/* ── Avatar ── */
[data-theme="light"] .story-ring { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
[data-theme="light"] .story-ring.seen { background: #dbdbdb; }
[data-theme="light"] .story-avatar { border-color: #fff; }

/* ── Notifications badge ── */
[data-theme="light"] .notif-badge {
  background: #ed4956;
}

/* ── Modal ── */
[data-theme="light"] .modal {
  background: #fff;
  border: none;
  border-top: 1px solid #dbdbdb;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.1);
}
[data-theme="light"] .modal-handle { background: #c7c7c7; }

/* ── Page back ── */
[data-theme="light"] .page-back {
  background: #fff;
  border-color: #dbdbdb;
  color: #262626;
}
[data-theme="light"] .page-back:hover { border-color: #a8a8a8; color: #262626; }

/* ── Admin ── */
[data-theme="light"] .admin-sidebar { background: #fff; border-right-color: #dbdbdb; }
[data-theme="light"] .admin-logo {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
[data-theme="light"] .admin-nav-item { color: #737373; }
[data-theme="light"] .admin-nav-item:hover,
[data-theme="light"] .admin-nav-item.active {
  color: #262626;
  background: #fafafa;
  border-left-color: #262626;
}
[data-theme="light"] .admin-table th {
  background: #fafafa;
  border-bottom-color: #dbdbdb;
  color: #737373;
}
[data-theme="light"] .admin-table td { border-bottom-color: #efefef; }
[data-theme="light"] .admin-table tr:hover td { background: #fafafa; }
[data-theme="light"] .admin-table-wrap { background: #fff; border-color: #dbdbdb; }
[data-theme="light"] .admin-section { background: #fff; border-color: #dbdbdb; }
[data-theme="light"] .admin-section-header { border-bottom-color: #dbdbdb; }
[data-theme="light"] .admin-mobile-nav { background: #fff; border-bottom-color: #dbdbdb; }

/* ── Stat cards ── */
[data-theme="light"] .stat-card { background: #fff; border-color: #dbdbdb; }

/* ── Badges ── */
[data-theme="light"] .badge-admin     { background: rgba(237,73,86,0.08); }
[data-theme="light"] .badge-moderator { background: rgba(255,149,0,0.08); }
[data-theme="light"] .badge-user      { background: rgba(0,149,246,0.08); color: #0095f6; }
[data-theme="light"] .badge-active    { background: rgba(26,173,25,0.08); }
[data-theme="light"] .badge-banned    { background: rgba(237,73,86,0.08); }

/* ── Toggle ── */
[data-theme="light"] .toggle-slider { background: #dbdbdb; }
[data-theme="light"] .toggle input:checked + .toggle-slider { background: #0095f6; }

/* ── Page btn ── */
[data-theme="light"] .page-btn { background: #fff; border-color: #dbdbdb; color: #262626; }
[data-theme="light"] .page-btn.active { background: #262626; border-color: #262626; }
[data-theme="light"] .page-btn:hover:not(.active) { border-color: #a8a8a8; color: #262626; }

/* ── Пуш кнопка ── */
[data-theme="light"] #push-enable-btn {
  background: rgba(0,149,246,0.06);
  border-top-color: rgba(0,149,246,0.15);
}
[data-theme="light"] #push-enable-btn:hover { background: rgba(0,149,246,0.1); }

/* ── Переключатель языка ── */
[data-theme="light"] div[style*="border-top:1px solid var(--border)"] {
  border-top-color: #dbdbdb !important;
}

/* ── Кулдаун блок (бонусы) ── */
[data-theme="light"] .cooldown-block {
  background: rgba(0,149,246,0.04);
  border-color: rgba(0,149,246,0.15);
}

/* ── Scrollbar ── */
[data-theme="light"] ::-webkit-scrollbar-track { background: #fafafa; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c7c7c7; }

/* ── Кастомные inline стили через CSS vars (переопределяем) ── */
[data-theme="light"] {
  color-scheme: light;
}

/* ── Плавное переключение темы (только нужные элементы) ── */
body, .card, .post-card, .btn, .form-control, .topbar,
.bottom-nav, #sidebar, .sb-item, .sb-bottom-item,
.nav-item, .action-btn, .modal, .badge, .stat-card,
.admin-sidebar, .admin-nav-item, .admin-table th, .admin-table td {
  transition: background-color .2s ease, border-color .2s ease, color .15s ease, box-shadow .2s ease;
}
