:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-sidebar: #1e293b;
  --color-sidebar-text: #94a3b8;
  --color-sidebar-hover: #334155;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  font-size: 14px;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--color-sidebar);
  color: var(--color-sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header { padding: 20px; border-bottom: 1px solid var(--color-sidebar-hover); }
.logo { color: #fff; font-weight: 700; font-size: 18px; }
.logo:hover { text-decoration: none; }

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-item {
  display: block;
  padding: 10px 20px;
  color: var(--color-sidebar-text);
  transition: background 0.15s;
}
.nav-item:hover { background: var(--color-sidebar-hover); text-decoration: none; }
.nav-item.active { background: var(--color-sidebar-hover); color: #fff; }

.nav-accordion { margin: 0; }
.nav-section-btn {
  width: 100%;
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--color-sidebar-text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-section-btn:hover { background: var(--color-sidebar-hover); }
.accordion-icon::after { content: '+'; }
.nav-accordion.open .accordion-icon::after { content: '−'; }
.nav-section-items { display: none; padding-left: 12px; }
.nav-accordion.open .nav-section-items { display: block; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--color-sidebar-hover);
  font-size: 12px;
}
.admin-email { display: block; color: #fff; margin-bottom: 4px; }
.logout-link { color: var(--color-sidebar-text); }

.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 24px 32px;
  min-height: 100vh;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 24px; font-weight: 600; }
.page-actions { display: flex; gap: 8px; }

.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-warning { background: #fef3c7; color: #92400e; }
.flash-info { background: #dbeafe; color: #1e40af; }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-header h2 { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer { padding: 16px 20px; border-top: 1px solid var(--color-border); }

.danger-zone { border-color: var(--color-danger); }
.danger-zone .card-header { background: #fef2f2; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stats-small { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--color-primary); }
.stat-label { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 1024px) { .grid-2 { grid-template-columns: 1fr; } }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.table th { font-weight: 600; color: var(--color-text-muted); font-size: 12px; text-transform: uppercase; }
.table tbody tr:hover { background: var(--color-bg); }
.table .empty { color: var(--color-text-muted); text-align: center; padding: 24px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: var(--color-bg);
  color: var(--color-text-muted);
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-chatting { background: #dbeafe; color: #1e40af; }
.badge-planning { background: #fef3c7; color: #92400e; }
.badge-met { background: #dcfce7; color: #166534; }
.badge-matched { background: #e0e7ff; color: #3730a3; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary { background: var(--color-bg); border-color: var(--color-border); color: var(--color-text); }
.btn-secondary:hover { background: var(--color-border); }
.btn-success { background: var(--color-success); color: #fff; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; }
.form-input, .form-select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
}
.form-input:focus, .form-select:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
textarea { resize: vertical; min-height: 80px; }

.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

.filter-form { display: flex; gap: 8px; align-items: center; }
.filter-form .form-input, .filter-form .form-select { width: auto; min-width: 180px; }

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

.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; }

.detail-list { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; }
.detail-list dt { font-weight: 500; color: var(--color-text-muted); }
.detail-list dd { margin: 0; }

.link { color: var(--color-primary); font-size: 13px; }

.message-list { max-height: 500px; overflow-y: auto; }
.message-item { padding: 12px; border-bottom: 1px solid var(--color-border); }
.message-item:last-child { border-bottom: none; }
.message-item.reported-user { background: #fef2f2; }
.message-meta { display: flex; justify-content: space-between; margin-bottom: 4px; }
.message-meta strong { font-weight: 600; }
.message-time { color: var(--color-text-muted); font-size: 12px; }
.message-body { color: var(--color-text); }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-content h3 { margin-bottom: 16px; }

.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-sidebar);
}
.auth-card {
  background: var(--color-surface);
  padding: 40px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.auth-card h1 { text-align: center; margin-bottom: 24px; }

code {
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'SF Mono', Monaco, monospace;
}
