* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: #f4f6f8;
  color: #1a1a1a;
}
.hidden { display: none !important; }
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #0d9488;
  color: white;
}
.header h1 { margin: 0; font-size: 1.25rem; }
main { padding: 20px 24px 40px; max-width: 1400px; margin: 0 auto; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  border: 1px solid #cbd5e1;
  background: white;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.tab.active { background: #0d9488; color: white; border-color: #0d9488; }
.panel {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 16px;
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eee; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; color: #64748b; }
.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  margin-right: 6px;
}
.btn.primary { background: #0d9488; color: white; }
.btn.danger { background: #dc2626; color: white; }
.btn.secondary { background: #e2e8f0; color: #1a1a1a; }
.btn.request { background: #d97706; color: white; }
.btn.activate { background: #0f766e; color: white; }
.btn.exception { background: #5b21b6; color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 170px; }
.actions .btn { margin-right: 0; }
.row-request { background: #fffbeb; }
.muted { color: #94a3b8; font-size: 12px; }
.login-screen {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: white;
  padding: 32px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  max-width: 400px;
  width: 100%;
  text-align: center;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  margin-top: 16px;
}
.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}
.login-form input {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.request { background: #fde68a; color: #92400e; }
.badge.active { background: #d1fae5; color: #065f46; }
.badge.lifetime { background: #e0e7ff; color: #3730a3; }
.badge.ok { background: #d1fae5; color: #065f46; }
.badge.soon { background: #fef3c7; color: #92400e; }
.badge.warn { background: #ffedd5; color: #c2410c; }
.badge.expired { background: #fee2e2; color: #991b1b; }
.badge.rejected, .badge.revoked { background: #fee2e2; color: #991b1b; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card.pending { border-color: #fde68a; background: #fffbeb; }
.stat-card.soon { border-color: #fdba74; background: #fff7ed; }
.stat-card.expired { border-color: #fecaca; background: #fef2f2; }
.stat-card.revenue { border-color: #99f6e4; background: #f0fdfa; }
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}
.stat-label {
  font-size: 12px;
  color: #64748b;
  line-height: 1.3;
}
.search-row { margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}
.empty { color: #64748b; padding: 24px; text-align: center; }
.meta-line { color: #64748b; font-size: 13px; margin: 0 0 12px; }
.error { color: #dc2626; font-size: 14px; margin-top: 12px; }
.panel-title { margin: 0 0 4px; font-size: 1.2rem; }
.tutorial-admin-header { margin-bottom: 16px; }
.tutorial-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
}
.tutorial-form h3 { margin: 0 0 12px; font-size: 1rem; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
.form-grid .span-2 { grid-column: span 2; }
.form-grid input, .form-grid textarea {
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; }
.form-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.tutorial-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  background: white;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.tutorial-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f172a;
}
.tutorial-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: white;
  background: rgba(15, 23, 42, 0.25);
}
.draft-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
}
.tutorial-card-body { padding: 14px; }
.tutorial-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0d9488;
  margin-bottom: 6px;
}
.tutorial-card-body h4 { margin: 0 0 6px; font-size: 1rem; }
.tutorial-card-body p {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
  min-height: 36px;
}
.tutorial-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
}
