/* ========================================
   Tracehound Content Dashboard — Styles
   ======================================== */

:root {
  --bg: #0a0a0a;
  --bg-card: #1a1d29;
  --bg-card-hover: #1f2335;
  --border: #2d3348;
  --border-light: #3a4160;
  --accent: #00c9a7;
  --accent-dim: rgba(0, 201, 167, 0.15);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Status colors */
  --status-pending: #64748b;
  --status-draft: #f59e0b;
  --status-approved: #00c9a7;
  --status-published: #10b981;

  /* Pillar colors */
  --pillar-signal: #3b82f6;
  --pillar-product: #8b5cf6;
  --pillar-education: #f97316;
  --pillar-community: #ec4899;
  --pillar-ecosystem: #22c55e;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --transition: 0.2s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- Header ---- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0f1019 0%, var(--bg) 100%);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  display: flex;
  align-items: center;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.header-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 1px;
}

.week-nav .header-subtitle {
  margin-top: 0;
  min-width: 150px;
}

.week-nav-btn {
  background: transparent;
  border: 1px solid var(--border-color, #2a2a2a);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.week-nav-btn:hover {
  background: rgba(0, 201, 167, 0.08);
  border-color: #00c9a7;
  color: #00c9a7;
}

.week-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.week-nav-today {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 10px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.refresh-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-nav-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-approve {
  background: var(--status-approved);
  color: #0a0a0a;
}

.btn-approve:hover:not(:disabled) {
  background: #00e6bf;
  box-shadow: 0 0 20px rgba(0, 201, 167, 0.3);
}

.btn-reject {
  background: #ef4444;
  color: #fff;
}

.btn-reject:hover:not(:disabled) {
  background: #f87171;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.btn-publish {
  background: var(--pillar-signal);
  color: #fff;
}

.btn-publish:hover:not(:disabled) {
  background: #60a5fa;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* ---- Stats Bar ---- */
.stats-bar {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  overflow-x: auto;
}

.stat-card {
  flex: 1;
  min-width: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  text-align: center;
  transition: border-color var(--transition);
}

.stat-card:hover {
  border-color: var(--border-light);
}

.stat-count {
  display: block;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 2px;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.stat-pending .stat-count { color: var(--status-pending); }
.stat-draft .stat-count { color: var(--status-draft); }
.stat-approved .stat-count { color: var(--status-approved); }
.stat-published .stat-count { color: var(--status-published); }

/* ---- Calendar Grid ---- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 8px 24px 24px;
  min-height: calc(100vh - 200px);
}

.day-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-header {
  text-align: center;
  padding: 10px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: sticky;
  top: 65px;
  z-index: 10;
}

.day-name {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.day-date {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

.day-today .day-header {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(0, 201, 167, 0.08) 0%, var(--bg-card) 100%);
}

.day-today .day-date {
  color: var(--accent);
}

.day-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  min-height: 80px;
}

/* ---- Post Card ---- */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.post-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.post-card-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.slot-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.slot-time {
  font-size: 10px;
  color: var(--text-muted);
}

.post-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.post-card-preview {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.post-card-preview.empty {
  color: var(--text-muted);
  font-style: italic;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.post-card-image {
  width: 100%;
  height: 48px;
  border-radius: 4px;
  background: var(--border);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  overflow: hidden;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thread-indicator {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.thread-indicator svg {
  opacity: 0.6;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Status badges */
.badge-pending {
  background: rgba(100, 116, 139, 0.15);
  color: var(--status-pending);
}

.badge-draft {
  background: rgba(245, 158, 11, 0.15);
  color: var(--status-draft);
}

.badge-approved {
  background: rgba(0, 201, 167, 0.15);
  color: var(--status-approved);
}

.badge-published {
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-published);
}

/* Pillar badges */
.badge-signal {
  background: rgba(59, 130, 246, 0.15);
  color: var(--pillar-signal);
}

.badge-product {
  background: rgba(139, 92, 246, 0.15);
  color: var(--pillar-product);
}

.badge-education {
  background: rgba(249, 115, 22, 0.15);
  color: var(--pillar-education);
}

.badge-community {
  background: rgba(236, 72, 153, 0.15);
  color: var(--pillar-community);
}

.badge-ecosystem {
  background: rgba(34, 197, 94, 0.15);
  color: var(--pillar-ecosystem);
}

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}

.modal-schedule {
  font-size: 13px;
  color: var(--text-muted);
}

.modal-type {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-body {
  padding: 20px 24px;
}

.modal-body h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 10px;
}

.modal-content-section {
  margin-bottom: 20px;
}

.modal-tweet-content {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-tweet-content.empty {
  color: var(--text-muted);
  font-style: italic;
}

.char-count {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 6px;
}

.char-count.over-limit {
  color: #ef4444;
  font-weight: 700;
}

/* Thread preview */
.thread-preview {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 20px;
}

.thread-tweet {
  position: relative;
  padding: 12px 16px 12px 32px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.thread-tweet:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.thread-tweet:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}

.thread-tweet:not(:last-child) {
  border-bottom: none;
}

.thread-tweet::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0.3;
}

.thread-tweet:first-child::before {
  top: 50%;
}

.thread-tweet:last-child::before {
  bottom: 50%;
}

.thread-tweet-number {
  position: absolute;
  left: 8px;
  top: 12px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0a0a;
  font-size: 8px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.thread-tweet-chars {
  text-align: right;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Image preview */
.modal-image-section {
  margin-bottom: 20px;
}

.modal-image-preview {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}

.modal-image-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 4px;
}

.modal-image-preview .image-path {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  word-break: break-all;
}

/* Modal actions */
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ---- Loading / Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  z-index: 2000;
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success {
  border-color: var(--status-approved);
}

.toast.error {
  border-color: #ef4444;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Spinner ---- */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
  .calendar-grid {
    grid-template-columns: repeat(4, 1fr);
    padding: 8px 16px 16px;
  }
}

@media (max-width: 900px) {
  .calendar-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats-bar {
    padding: 12px 16px;
    gap: 8px;
  }
  .stat-card {
    min-width: 90px;
    padding: 12px 14px;
  }
  .stat-count {
    font-size: 22px;
  }
}

@media (max-width: 640px) {
  .calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
  }
  .header-right {
    align-self: flex-end;
  }
  .modal {
    max-width: 100%;
    max-height: 95vh;
    border-radius: var(--radius);
  }
  .modal-overlay {
    padding: 10px;
  }
  .stats-bar {
    flex-wrap: wrap;
  }
  .stat-card {
    flex: 0 0 calc(50% - 6px);
    min-width: auto;
  }
}

@media (max-width: 420px) {
  .calendar-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   TAB BAR
   ============================================ */

.tab-bar {
  display: flex;
  gap: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-badge {
  background: var(--status-draft);
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.tab-panel { min-height: 400px; }

/* ============================================
   REPLIES TAB
   ============================================ */

.replies-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.replies-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.filter-btn:hover { border-color: var(--border-light, #4b5563); color: var(--text-primary); }
.filter-btn.active {
  background: rgba(0, 201, 167, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.replies-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 24px 24px;
}

.replies-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 60px 20px;
}

/* Reply card */
.reply-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
}

.reply-card:hover {
  border-color: var(--border-light, #4b5563);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.reply-card.reply-escalation {
  border-left: 3px solid #f59e0b;
}

.reply-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.reply-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.reply-card-badges { display: flex; gap: 6px; }

.reply-card-mention {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.reply-card-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.reply-card-draft {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.reply-card-draft.empty {
  color: var(--text-muted);
  font-style: italic;
}

.reply-draft-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.reply-card-footer {
  margin-top: 8px;
}

.reply-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* Badges */
.badge-escalation {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.badge-skipped {
  background: rgba(100, 116, 139, 0.15);
  color: var(--status-pending);
}

.escalation-flag {
  background: #f59e0b;
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Reply textarea */
.reply-edit-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.reply-edit-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Save button for reply editing */
.btn-save {
  background: var(--accent);
  color: #0a0a0a;
}

.btn-save:hover {
  opacity: 0.9;
}

.btn-skip {
  background: transparent;
  border: 1px solid var(--status-pending);
  color: var(--status-pending);
}

.btn-skip:hover {
  background: rgba(100, 116, 139, 0.15);
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #0d1117 0%, var(--bg) 70%);
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.login-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-login {
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  margin-top: 8px;
}

.btn-login:hover { opacity: 0.9; }
.btn-login:disabled { opacity: 0.5; cursor: not-allowed; }

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: #fca5a5;
}

/* ============================================
   USER MENU + MANAGEMENT MODAL
   ============================================ */

.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.user-menu-btn:hover { border-color: var(--accent); }

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  display: none;
  z-index: 100;
  overflow: hidden;
}

.user-dropdown.active { display: block; }

.user-dropdown-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.user-dropdown-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.user-dropdown-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
  font-family: inherit;
}

.user-dropdown-item:hover { background: rgba(0, 201, 167, 0.08); }
.user-dropdown-item.danger { color: #fca5a5; }
.user-dropdown-item.danger:hover { background: rgba(239, 68, 68, 0.08); }

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
}

/* Users management table */
.users-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.users-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.users-list-row:last-child { border-bottom: none; }

.users-list-info { display: flex; flex-direction: column; gap: 2px; }
.users-list-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.users-list-role { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

.users-list-actions { display: flex; gap: 6px; }

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon.danger:hover { border-color: #ef4444; color: #ef4444; }

.add-user-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}

.add-user-form input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
}

.add-user-form input:focus { outline: none; border-color: var(--accent); }

@media (max-width: 600px) {
  .add-user-form { grid-template-columns: 1fr; }
}
