:root {
  --bg: #eaecec;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f4f5f5;
  --bg-input: #f5f6f6;
  --border: #d9dcdd;
  --border-light: #e4e6e7;
  --text: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #888888;
  --accent: #00aff5;
  --accent-hover: #009de0;
  --accent-light: #e6f7fe;
  --green: #22c55e;
  --green-bg: #dcfce7;
  --blue: #3b82f6;
  --blue-bg: #dbeafe;
  --purple: #8b5cf6;
  --purple-bg: #ede9fe;
  --red: #ef4444;
  --red-bg: #fee2e2;
  --orange: #f59e0b;
  --orange-bg: #fef3c7;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 4px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-style: normal; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

/* Top nav */
.topnav {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topnav-left { display: flex; align-items: center; gap: 12px; }
.topnav-logo {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.topnav-logo svg { width: 36px; height: 36px; border-radius: 8px; }
.topnav-title { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.topnav-right { display: flex; align-items: center; gap: 14px; }
.topnav-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.topnav-avatar {
  width: 32px; height: 32px;
  background: #1a1a1a;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 11px; font-weight: 600;
}

/* Layout */
.layout { max-width: 1080px; margin: 0 auto; padding: 32px 32px 100px; }
.layout-wide { max-width: 100%; margin: 0; padding: 32px 48px 100px; }

/* Buttons */
.btn {
  padding: 9px 20px; border-radius: 4px; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s; font-family: inherit; text-decoration: none;
  letter-spacing: -0.1px;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 2px 8px rgba(0,175,245,0.3); }
.btn-secondary { background: var(--bg-white); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 4px; }
.btn-green { background: var(--green); color: white; }
.btn-green:hover { filter: brightness(1.08); }
.btn-red-outline { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-red-outline:hover { background: var(--red-bg); }

/* Status badges */
.badge {
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  letter-spacing: -0.1px;
}
.badge-voting { background: #f0f0f0; color: #666; }
.badge-planned { background: var(--green-bg); color: #15803d; }
.badge-progress { background: var(--blue-bg); color: #1d4ed8; }
.badge-done { background: var(--purple-bg); color: #6d28d9; }
.badge-declined { background: var(--red-bg); color: #dc2626; }
.badge-customer { background: var(--accent-light); color: #0284c7; }
.badge-admin { background: var(--orange-bg); color: #b45309; }

/* Board header */
.board-header { margin-bottom: 28px; }
.board-header h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.5px; color: var(--text); }
.board-header p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* Filter / tabs bar */
.tabs-bar {
  display: flex; align-items: center; gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 28px;
}
.tab-item {
  padding: 12px 20px; cursor: pointer;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.15s;
  text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
}
.tab-item:hover { color: var(--text); }
.tab-item.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-item .tab-count {
  background: #f0f0f0; color: #666;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; margin-left: 4px;
}
.tab-item.active .tab-count { background: var(--accent-light); color: var(--accent); }

.filter-right { margin-left: auto; display: flex; align-items: center; gap: 10px; padding-bottom: 2px; }
.search-input {
  background: var(--bg-input); border: none; border-radius: 4px;
  padding: 9px 14px 9px 36px; font-size: 13px; font-family: inherit; color: var(--text);
  width: 240px; transition: all 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { outline: none; box-shadow: 0 0 0 2px var(--accent); }

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.idea-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.idea-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border);
}

.idea-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }

.idea-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.idea-card-title { font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--text); flex: 1; padding-right: 8px; letter-spacing: -0.2px; }
.idea-card-votes {
  display: flex; align-items: center; gap: 2px;
  font-size: 13px; font-weight: 700; color: var(--text);
  flex-shrink: 0; padding: 4px 0;
}
.idea-card-votes i, .idea-card-votes svg { width: 18px; height: 18px; }

.idea-card-desc {
  font-size: 13px; color: var(--text-secondary); line-height: 1.55;
  flex: 1; margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.idea-card-footer {
  display: flex; align-items: center; justify-content: flex-end;
  padding-top: 14px; border-top: 1px solid var(--border-light);
}
.idea-card-stats { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); }
.idea-card-stats span { display: flex; align-items: center; gap: 4px; }

.idea-card.voted { border-color: var(--accent); }
.idea-card.voted .idea-card-votes { color: var(--accent); }
.idea-card.done { opacity: 0.65; }

/* Detail page */
.detail-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; }

.voters-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.voters-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 13px; font-weight: 700; }
.voters-count { color: var(--text-muted); font-weight: 500; font-size: 12px; }
.voters-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.voter-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: white;
}
.voter-overflow {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-input); display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: var(--text-muted);
}

.detail-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.detail-title { font-size: 24px; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.5px; }
.detail-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; flex-wrap: wrap; }
.detail-meta .author { color: var(--text); font-weight: 600; }
.detail-meta .sep { color: var(--border); }
.detail-body { font-size: 14px; color: var(--text-secondary); line-height: 1.75; margin-bottom: 24px; }
.detail-body p + p { margin-top: 12px; }
.detail-actions {
  display: flex; align-items: center; gap: 14px;
  padding-top: 20px; border-top: 1px solid var(--border-light);
}
.vote-btn-lg {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 28px; border-radius: 4px; border: none;
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  background: var(--accent); color: white; transition: all 0.15s; letter-spacing: -0.1px;
}
.vote-btn-lg:hover { background: var(--accent-hover); box-shadow: 0 2px 8px rgba(0,175,245,0.3); }
.vote-btn-lg.voted { background: var(--bg-input); color: var(--accent); border: 2px solid var(--accent); }
.detail-vote-count { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }

/* Comments */
.comments-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; letter-spacing: -0.2px; }
.comments-section h3 .count-badge { background: var(--accent-light); color: var(--accent); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.comment { padding: 18px 0; border-bottom: 1px solid var(--border-light); }
.comment:last-of-type { border-bottom: none; }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.comment-author { font-weight: 700; color: var(--text); }
.comment-time { color: var(--text-muted); font-size: 12px; }
.comment-body { font-size: 13px; color: var(--text-secondary); line-height: 1.65; padding-left: 44px; }
.comment.admin-reply { background: var(--orange-bg); margin: 0 -28px; padding: 18px 28px; border-left: 3px solid var(--orange); border-bottom: none; }
.comment.admin-reply .comment-body { padding-left: 44px; }
.comment-compose { margin-top: 20px; }
.comment-compose textarea {
  width: 100%; min-height: 88px; border: 1px solid var(--border); border-radius: 4px;
  padding: 14px 16px; font-size: 13px; font-family: inherit; resize: vertical;
  color: var(--text); background: var(--bg-white); transition: border-color 0.15s;
}
.comment-compose textarea::placeholder { color: var(--text-muted); }
.comment-compose textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,175,245,0.15); }

/* Submit form */
.form-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-sm); max-width: 640px;
}
.form-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.4px; }
.form-card .form-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--text); letter-spacing: -0.1px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; border: 1px solid var(--border); border-radius: 4px;
  padding: 12px 14px; font-size: 14px; font-family: inherit;
  color: var(--text); background: var(--bg-white); transition: border-color 0.15s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,175,245,0.15);
}
.form-group textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.form-group .hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.form-notice {
  background: var(--orange-bg); border: 1px solid #fde68a; border-radius: var(--radius-sm);
  padding: 14px 18px; font-size: 13px; color: #92400e; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 24px; line-height: 1.5;
}

/* Admin */
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.admin-header h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.admin-stat {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.admin-stat .stat-value { font-size: 32px; font-weight: 800; margin-bottom: 2px; letter-spacing: -0.5px; }
.admin-stat .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.admin-stat.orange .stat-value { color: var(--orange); }
.admin-stat.blue .stat-value { color: var(--blue); }
.admin-stat.green .stat-value { color: var(--green); }
.admin-stat.purple .stat-value { color: var(--purple); }

.admin-section {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.admin-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.admin-section-header h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; letter-spacing: -0.2px; }
.admin-section-header h2 .count { background: var(--red-bg); color: var(--red); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }

.mod-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border-light); }
.mod-item:last-child { border-bottom: none; }
.mod-content { flex: 1; min-width: 0; }
.mod-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; letter-spacing: -0.1px; }
.mod-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mod-meta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.mod-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: flex-start; padding-top: 2px; }
.status-select {
  background: var(--bg-white); border: 1px solid var(--border); border-radius: 4px;
  padding: 6px 10px; font-size: 12px; font-family: inherit; cursor: pointer; color: var(--text-secondary);
}

/* Admin tabs */
.admin-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border-light); margin-bottom: 24px; }
.admin-tab {
  padding: 12px 20px; font-size: 11px; font-weight: 700; color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-tab .tab-count { background: var(--red-bg); color: var(--red); font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }

/* Magic link auth */
.auth-container { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 61px); padding: 32px; }
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 16px; padding: 48px 40px; box-shadow: var(--shadow-lg);
  max-width: 420px; width: 100%; text-align: center;
}
.auth-card .auth-logo {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
}
.auth-card .auth-logo svg { width: 52px; height: 52px; border-radius: 14px; }
.auth-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.4px; }
.auth-card .auth-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.6; }
.auth-card .auth-input {
  width: 100%; border: 1.5px solid var(--border); border-radius: 4px;
  padding: 14px 16px; font-size: 14px; font-family: inherit; color: var(--text);
  margin-bottom: 14px; transition: border-color 0.15s;
}
.auth-card .auth-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,175,245,0.15); }
.auth-card .auth-input::placeholder { color: var(--text-muted); }
.auth-card .auth-btn {
  width: 100%; padding: 14px; border-radius: 4px; border: none;
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  background: var(--accent); color: white; transition: all 0.15s; letter-spacing: -0.1px;
}
.auth-card .auth-btn:hover { background: var(--accent-hover); box-shadow: 0 2px 8px rgba(0,175,245,0.3); }
.auth-card .auth-footer { font-size: 12px; color: var(--text-muted); margin-top: 24px; line-height: 1.6; }
.auth-success .check-icon {
  width: 60px; height: 60px; background: var(--green-bg); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 30px; margin: 0 auto 20px;
}

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-muted); text-decoration: none;
  margin-bottom: 24px; cursor: pointer; transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

/* Responsive */
@media (min-width: 1441px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .layout-wide { padding: 24px 24px 100px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .topnav { padding: 0 16px; }
  .layout { padding: 20px 16px 80px; }
  .layout-wide { padding: 20px 16px 80px; }
  .card-grid { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .tabs-bar { flex-wrap: wrap; }
  .filter-right { width: 100%; margin-top: 8px; margin-left: 0; }
  .search-input { width: 100%; }
  .board-header { flex-direction: column !important; gap: 12px; }
  .board-header .btn-primary { align-self: flex-start; }
}
