* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}
.card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.card-sm { max-width: 400px; margin: 0 auto; }
.card-header { text-align: center; margin-bottom: 24px; }
.logo { font-size: 48px; text-align: center; margin-bottom: 8px; }
h1 {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 4px;
}
.subtitle {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-bottom: 24px;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #333;
}
.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus {
  border-color: #10a37f;
  box-shadow: 0 0 0 3px rgba(16,163,127,0.1);
}
.captcha-row {
  display: flex;
  gap: 10px;
}
.captcha-row input { flex: 1; }
.captcha-row img {
  height: 45px;
  border-radius: 8px;
  cursor: pointer;
  border: 1.5px solid #e0e0e0;
}
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary {
  width: 100%;
  background: #10a37f;
  color: #fff;
  margin-top: 8px;
}
.btn-primary:hover:not(:disabled) { background: #0e8a6b; }
.btn-sm {
  padding: 8px 16px;
  background: #e8f5f0;
  color: #10a37f;
  font-size: 13px;
  white-space: nowrap;
}
.btn-sm:hover { background: #d0ede5; }
.btn-block {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 20px;
}
.error {
  background: #fff0f0;
  color: #d00e17;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid #ffd4d4;
}
.success {
  background: #f0fff4;
  color: #0a8852;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid #d4ffd4;
}
.links {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  font-size: 14px;
}
.links a {
  color: #10a37f;
  text-decoration: none;
}
.links a:hover { text-decoration: underline; }
.info-box {
  background: #f8f9fb;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}
.info-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}
.info-item label { color: #666; }
.token-box {
  margin-bottom: 8px;
}
.token-box label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}
.token-row {
  display: flex;
  gap: 8px;
}
.token-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px dashed #ccc;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  background: #f8f9fb;
  color: #333;
}
.hint {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}

/* ==================== Admin Panel ==================== */
.admin-body {
  display: block;
  padding: 0;
}
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 220px;
  background: #1a1a2e;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-header {
  padding: 24px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header .logo-sm { font-size: 32px; margin-bottom: 4px; }
.sidebar-header h3 { font-size: 16px; font-weight: 600; color: #fff; }
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}
.nav-item {
  display: block;
  padding: 12px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active {
  background: rgba(16,163,127,0.2);
  color: #10a37f;
  border-right: 3px solid #10a37f;
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logout-link {
  color: #ff6b6b;
  text-decoration: none;
  font-size: 13px;
}
.admin-main {
  flex: 1;
  padding: 32px;
  background: #f5f7fa;
  overflow-x: auto;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.admin-header h2 { font-size: 22px; font-weight: 600; }
.badge {
  background: #e8f5f0;
  color: #10a37f;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon { font-size: 32px; }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 28px; font-weight: 700; color: #1a1a2e; }
.stat-label { font-size: 13px; color: #999; }
.table-wrapper {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 600;
  color: #666;
  border-bottom: 2px solid #eee;
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}
.admin-table tr:hover { background: #f8f9fb; }
.admin-table tr:last-child td { border-bottom: none; }
.row-disabled { opacity: 0.5; }
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.role-admin { background: #fff3e0; color: #e65100; }
.role-user { background: #e8f5f0; color: #10a37f; }
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.green { background: #10a37f; }
.status-dot.red { background: #ff5252; }
.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}
.btn-xs:hover { background: #e0e0e0; }
