/* ============================================
   EARTHLINGS DIGITAL PLATFORM - REDESIGN v2.0
   Based on ПанельУправления2_0 template
   ============================================ */

/* RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors - Dark Theme (default) */
  --bg-primary: #0f172a;
  --bg-secondary: #020617;
  --bg-card: rgba(30, 41, 59, 0.8);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(74, 144, 226, 0.5);
  
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  
  --accent-blue: #4a90e2;
  --accent-blue-dark: #357abd;
  --accent-cyan: #1abce3;
  --accent-gold: #FFD700;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --accent-orange: #f59e0b;
  
  /* Layout */
  --header-height: 70px;
  --sidebar-width: 260px;
  --content-max-width: 1200px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Light Theme */
body[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --border-color: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(74, 144, 226, 0.5);
  
  --text-primary: #0f172a;
  --text-secondary: rgba(15, 23, 42, 0.7);
  --text-muted: rgba(15, 23, 42, 0.5);
}

body[data-theme="light"] {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

body[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.95);
}

.header-content {
  max-width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

.logo {
  font-size: 32px;
}

.platform-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Quick Actions Bar */
.quick-actions-bar {
  display: flex;
  gap: 10px;
  flex: 1;
  justify-content: center;
}

.quick-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.15), rgba(26, 188, 227, 0.15));
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: 10px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-size: 13px;
  font-weight: 500;
}

.quick-btn:hover {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.quick-btn span:first-child {
  font-size: 16px;
}

/* User Section */
.user-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.notifications-badge {
  position: relative;
  cursor: pointer;
  padding: 8px;
}

.notif-icon {
  font-size: 22px;
}

.badge-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent-red);
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info {
  text-align: right;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.user-id {
  font-size: 11px;
  color: var(--accent-gold);
  font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

.connect-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-size: 14px;
  font-weight: 500;
}

.connect-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

/* Notifications Dropdown */
.notifications-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: none;
  z-index: 1001;
  overflow: hidden;
}

.notifications-dropdown.active {
  display: block;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

.mark-read-btn {
  background: none;
  border: none;
  color: var(--accent-blue);
  cursor: pointer;
  font-size: 12px;
}

.dropdown-content {
  max-height: 300px;
  overflow-y: auto;
}

.dropdown-footer {
  display: block;
  padding: 12px 20px;
  text-align: center;
  color: var(--accent-blue);
  text-decoration: none;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
}

.dropdown-footer:hover {
  background: rgba(74, 144, 226, 0.1);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: var(--header-height);
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-color);
  padding: 20px 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 900;
  transition: transform var(--transition-normal);
}

body[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.95);
}

.nav-menu {
  flex: 1;
}

.nav-group {
  margin-bottom: 20px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 15px;
  margin-bottom: 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  font-size: 14px;
  position: relative;
}

.nav-link:hover {
  background: rgba(74, 144, 226, 0.1);
  color: var(--text-primary);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
  color: white;
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 16px;
}

.nav-text {
  flex: 1;
}

.nav-badge {
  padding: 2px 8px;
  background: rgba(74, 144, 226, 0.2);
  color: var(--accent-blue);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.nav-badge.gold {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent-gold);
}

.nav-badge.pending {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

.sidebar-footer {
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.theme-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.theme-btn {
  flex: 1;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.theme-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.theme-btn.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
  border-color: transparent;
}

.api-info {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.api-info code {
  color: var(--accent-blue);
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 899;
}

.sidebar-overlay.active {
  display: block;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 30px;
  min-height: calc(100vh - var(--header-height));
}

/* Auto content wrapper if not present */
.main-content > .card:first-child,
.main-content > .section:first-child,
.main-content > .stats-grid:first-child {
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
}

.content-wrapper {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* ============================================
   SECTIONS (Cards)
   ============================================ */
.section {
  background: linear-gradient(135deg, var(--bg-card), rgba(15, 23, 42, 0.8));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 25px;
  backdrop-filter: blur(10px);
}

body[data-theme="light"] .section {
  background: var(--bg-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-action {
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.section-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.section-action.secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
}

.section-action.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

/* Section Tabs */
.section-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 13px;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
  color: white;
  border-color: transparent;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(15, 23, 42, 0.8));
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
}

body[data-theme="light"] .stat-card {
  background: var(--bg-card);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  width: 36px;
  height: 36px;
  background: rgba(74, 144, 226, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.stat-change {
  font-size: 12px;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.negative {
  color: var(--accent-red);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================
   CELLS GRID (Соты)
   ============================================ */
.cells-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.cell-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.cell-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-3px);
  border-color: var(--border-hover);
}

.cell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cell-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.cell-type {
  padding: 4px 10px;
  background: rgba(74, 144, 226, 0.2);
  color: var(--accent-blue);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
}

.cell-type.project {
  background: rgba(34, 197, 94, 0.2);
  color: var(--accent-green);
}

.cell-type.territorial {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-orange);
}

.cell-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 15px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cell-members {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(74, 144, 226, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  margin-left: -8px;
}

.member-avatar:first-child {
  margin-left: 0;
}

.members-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.cell-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.cell-stat {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ============================================
   PROJECTS LIST
   ============================================ */
.projects-list {
  display: grid;
  gap: 15px;
}

.project-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.project-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.project-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.project-status {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
}

.project-status.active {
  background: rgba(34, 197, 94, 0.2);
  color: var(--accent-green);
}

.project-status.draft {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

.project-status.review {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-orange);
}

.project-cell {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.project-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--accent-blue);
  font-weight: 600;
  min-width: 45px;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.project-terms {
  display: flex;
  gap: 20px;
}

.project-term {
  display: flex;
  flex-direction: column;
}

.term-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.term-value {
  font-size: 13px;
  color: var(--accent-blue);
  font-weight: 600;
}

.project-earnings {
  text-align: right;
}

.earnings-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.earnings-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ============================================
   WALLET
   ============================================ */
.wallet-balance {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 14px;
  padding: 30px;
  margin-bottom: 25px;
  text-align: center;
}

.balance-amount {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  margin-bottom: 5px;
}

.balance-usd {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.balance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.balance-item {
  text-align: center;
}

.balance-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.balance-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.wallet-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 25px;
}

.wallet-btn {
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.15), rgba(26, 188, 227, 0.15));
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: 10px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-size: 13px;
  font-weight: 500;
}

.wallet-btn:hover {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border-color: transparent;
  transform: translateY(-2px);
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  transition: background var(--transition-fast);
}

.transaction-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.transaction-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.transaction-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.transaction-icon.income {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
}

.transaction-icon.expense {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.transaction-icon.locked {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
}

.transaction-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.transaction-date {
  font-size: 12px;
  color: var(--text-muted);
}

.transaction-amount {
  font-size: 16px;
  font-weight: 600;
}

.transaction-amount.income {
  color: var(--accent-green);
}

.transaction-amount.expense {
  color: var(--accent-red);
}

.transaction-amount.locked {
  color: #9ca3af;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */
label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  margin-top: 15px;
}

label:first-child {
  margin-top: 0;
}

input, select, textarea {
  width: 100%;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.08);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

select {
  cursor: pointer;
}

body[data-theme="light"] input,
body[data-theme="light"] select,
body[data-theme="light"] textarea {
  background: rgba(0, 0, 0, 0.03);
}

/* Buttons */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

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

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(74, 144, 226, 0.2);
  color: var(--accent-blue);
}

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

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

.badge.error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

.badge.gold {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent-gold);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 14px;
}

/* ============================================
   NOTIFICATIONS (in content)
   ============================================ */
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.notification-item.is-new {
  background: rgba(74, 144, 226, 0.1);
  border-left: 3px solid var(--accent-blue);
}

.notification-icon {
  font-size: 20px;
}

.notification-content {
  flex: 1;
}

.notification-action {
  font-weight: 500;
  margin-bottom: 4px;
}

.notification-details {
  font-size: 13px;
  color: var(--text-muted);
}

.notification-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.new-badge {
  background: var(--accent-blue);
  color: white;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}

/* ============================================
   PROPOSALS / VOTING
   ============================================ */
.proposal-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.proposal-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.proposal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.proposal-title {
  font-size: 16px;
  font-weight: 600;
}

.proposal-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.vote-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vote-option {
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: all var(--transition-fast);
}

.vote-option.selected {
  border-color: var(--accent-blue);
  background: rgba(74, 144, 226, 0.1);
}

.vote-option-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.vote-option-name {
  font-weight: 500;
}

.vote-option-count {
  font-size: 13px;
  color: var(--text-muted);
}

.vote-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.vote-bar-fill {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.btn-vote {
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--accent-blue);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.btn-vote:hover {
  background: var(--accent-blue-dark);
}

.btn-vote.voted {
  background: var(--accent-green);
}

/* ============================================
   BACK BUTTON
   ============================================ */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--transition-fast);
}

.btn-back:hover {
  color: var(--accent-cyan);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .quick-actions-bar {
    display: none;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .sidebar-overlay.active {
    display: block;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .user-info {
    display: none !important;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cells-grid {
    grid-template-columns: 1fr;
  }
  
  .wallet-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .balance-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .project-footer {
    flex-direction: column;
    gap: 15px;
  }
  
  .project-terms {
    width: 100%;
    justify-content: space-between;
  }
  
  .project-earnings {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0 15px;
  }
  
  .main-content {
    padding: 20px 15px;
  }
  
  .section {
    padding: 20px 15px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-value {
    font-size: 24px;
  }
  
  .balance-amount {
    font-size: 36px;
  }
  
  .notifications-dropdown {
    width: 300px;
    right: -50px;
  }
}

/* ============================================
   UTILITIES
   ============================================ */
.clickable {
  cursor: pointer;
}

.mono {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.text-muted {
  color: var(--text-muted);
}

.text-success {
  color: var(--accent-green);
}

.text-error {
  color: var(--accent-red);
}

.text-gold {
  color: var(--accent-gold);
}

.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-10 {
  gap: 10px;
}

.gap-20 {
  gap: 20px;
}

/* Backward compatibility aliases */
.card {
  background: linear-gradient(135deg, var(--bg-card), rgba(15, 23, 42, 0.8));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 25px;
  backdrop-filter: blur(10px);
}

body[data-theme="light"] .card {
  background: var(--bg-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.card.highlight {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), var(--bg-card));
}

.card.error {
  border-color: var(--accent-red);
}

/* Info grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.info-item {
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.info-item .label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.info-item .value {
  font-weight: 500;
}

/* List items */
.list-item {
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.list-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.list-item-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* Legacy quick actions */
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-normal);
  text-align: center;
}

.quick-action:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.quick-action-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

/* Legacy reputation */
.reputation-header {
  display: flex;
  align-items: baseline;
  gap: 15px;
  margin-bottom: 20px;
}

.reputation-score {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent-gold);
}

.reputation-level {
  font-size: 18px;
  font-weight: 500;
}

/* Value colors */
.value.positive, .positive {
  color: var(--accent-green);
}

.value.negative, .negative {
  color: var(--accent-red);
}

/* Responsive grids on mobile */
@media (max-width: 768px) {
  .stats-grid[style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .stats-grid[style*="grid-template-columns: repeat(5"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .stats-grid[style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }
  
  div[style*="grid-template-columns: 1fr 1fr; gap: 25px"] {
    grid-template-columns: 1fr !important;
  }
  
  div[style*="grid-template-columns: 1fr 1fr; gap: 20px"] {
    grid-template-columns: 1fr !important;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
