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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

/* Login */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  width: 360px;
}

.login-box h1 {
  margin-bottom: 24px;
  font-size: 24px;
  text-align: center;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #4f46e5;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: #4f46e5;
  color: #fff;
}

.btn-primary:hover {
  background: #4338ca;
}

.btn-success {
  background: #10b981;
  color: #fff;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-secondary {
  background: #6b7280;
  color: #fff;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
}

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

.sidebar {
  width: 240px;
  background: #1a1a2e;
  color: #fff;
  padding: 24px 0;
  flex-shrink: 0;
}

.sidebar h2 {
  padding: 0 20px;
  margin-bottom: 32px;
  font-size: 20px;
  color: #a5b4fc;
}

.sidebar nav a {
  display: block;
  padding: 12px 20px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s, color 0.2s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar .logout-btn {
  margin-top: 40px;
  padding: 12px 20px;
  color: #f87171;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 15px;
  text-align: left;
  width: 100%;
}

.sidebar .logout-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.main-content {
  flex: 1;
  padding: 32px;
}

.main-content h1 {
  margin-bottom: 24px;
  font-size: 28px;
}

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

.stat-card {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.stat-card .stat-value {
  font-size: 36px;
  font-weight: 700;
  color: #4f46e5;
}

.stat-card .stat-label {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

.stat-card.pending .stat-value { color: #f59e0b; }
.stat-card.approved .stat-value { color: #10b981; }
.stat-card.rejected .stat-value { color: #ef4444; }

/* Table */
.table-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
}

th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
}

td {
  border-bottom: 1px solid #f1f5f9;
}

tr:hover td {
  background: #f8fafc;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.badge-approved {
  background: #d1fae5;
  color: #065f46;
}

.badge-rejected {
  background: #fee2e2;
  color: #991b1b;
}

/* Filters */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.filters .btn {
  padding: 8px 16px;
  font-size: 13px;
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.filters .btn.active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

/* Application detail */
.detail-card {
  background: #fff;
  padding: 28px;
  border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.detail-card h2 {
  margin-bottom: 16px;
  font-size: 20px;
}

.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  width: 240px;
  font-weight: 500;
  color: #6b7280;
  flex-shrink: 0;
}

.detail-value {
  flex: 1;
}

.review-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* Questions page */
.question-item {
  background: #fff;
  padding: 16px 20px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.question-item .order-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.question-item .order-btns button {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px 8px;
  font-size: 12px;
}

.question-item .order-btns button:hover {
  background: #f3f4f6;
}

.question-item .q-content {
  flex: 1;
}

.question-item .q-content .q-title {
  font-weight: 500;
  margin-bottom: 4px;
}

.question-item .q-content .q-meta {
  font-size: 13px;
  color: #6b7280;
}

.question-item .q-actions {
  display: flex;
  gap: 8px;
}

.toggle-active {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.toggle-active.on {
  background: #d1fae5;
  color: #065f46;
}

.toggle-active.off {
  background: #fee2e2;
  color: #991b1b;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  width: 480px;
  max-width: 90vw;
}

.modal h2 {
  margin-bottom: 20px;
}

.modal .form-group:last-of-type {
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Error message */
.error-msg {
  color: #ef4444;
  font-size: 14px;
  margin-bottom: 12px;
  display: none;
}

.error-msg.visible {
  display: block;
}

/* Clickable row */
.clickable {
  cursor: pointer;
}
