*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6fb;
  color: #111827;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 3rem;
  background: linear-gradient(90deg, #1e3a8a, #2563eb, #4f46e5);
  color: #e5e7eb;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-size: 0.9rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.nav-link {
  position: relative;
  color: #e5e7eb;
}

.nav-link:hover {
  color: #ffffff;
}

.content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem 4rem;
}

.card-wrapper {
  width: 100%;
  max-width: 960px;
}

.card {
  background: radial-gradient(circle at top left, #eef2ff 0, #ffffff 45%, #f9fafb 100%);
  border-radius: 1.25rem;
  padding: 2.5rem 3rem 2.75rem;
  margin: 0 auto;
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.08);
}

.card-narrow {
  max-width: 440px;
}

.card-wide {
  max-width: 100%;
}

.card-wrapper {
  perspective: 1200px;
}

.card-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e0edff;
  font-size: 1.4rem;
}

.card-title {
  text-align: center;
  font-size: 1.7rem;
  margin: 0.25rem 0 0.35rem;
}

.card-subtitle {
  text-align: center;
  margin: 0 0 1.75rem;
  color: #6b7280;
  font-size: 0.95rem;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: flex;
  gap: 1.25rem;
}

.two-column .form-field {
  flex: 1;
}

.form-row-between {
  align-items: center;
  justify-content: space-between;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
}

.required {
  color: #ef4444;
}

.optional {
  color: #9ca3af;
  font-weight: 400;
}

.input,
.select,
select {
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
  background-color: #f9fafb;
}

.input:focus,
.select:focus,
select:focus {
  border-color: #2563eb;
  background-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.35);
}

.primary-button:hover {
  background: linear-gradient(90deg, #1d4ed8, #1e40af);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 0.85rem;
  color: #374151;
  background: #ffffff;
}

.form-footer-text {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: center;
}

.form-footer-text.small {
  font-size: 0.75rem;
}

.link {
  color: #2563eb;
}

.alert-list {
  margin-bottom: 1rem;
}

.alert {
  padding: 0.7rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
}

.alert-success {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #4b5563;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table th,
.table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  white-space: nowrap;
}

.checkbox-col {
  width: 44px;
}

.checkbox-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.dashboard-bulk-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bulk-actions-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bulk-hint {
  font-size: 0.85rem;
  color: #6b7280;
}

.table th {
  font-weight: 600;
  color: #1f2937;
  background: linear-gradient(90deg, #dbeafe, #e5e7ff);
}

.empty-state {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #6b7280;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  border: 1px solid #bfdbfe;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-label {
  font-size: 0.8rem;
  color: #6b7280;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
}

.dashboard-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.dashboard-search {
  flex: 1 1 260px;
}

.search-input {
  width: 100%;
}

.dashboard-filters {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.filter-select {
  min-width: 160px;
}

.small-button {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

.small-primary {
  width: auto;
  padding-inline: 1rem;
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.45);
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: linear-gradient(90deg, #ef4444, #b91c1c);
  color: #fef2f2;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.danger-button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.card-flip,
.login-flip {
  animation: cardFlip 0.8s ease-out forwards;
  transform-origin: center;
}

@keyframes cardFlip {
  0% {
    transform: rotateY(0deg) scale(1);
    opacity: 1;
  }
  40% {
    transform: rotateY(90deg) scale(0.97);
    opacity: 0.9;
  }
  100% {
    transform: rotateY(0deg) scale(1);
    opacity: 1;
    box-shadow: 0 26px 55px rgba(37, 99, 235, 0.4);
  }
}

.token-box {
  margin-top: 0.4rem;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  background: #f3f4ff;
  border: 1px dashed #4f46e5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.token-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: #1d4ed8;
}

.hidden {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 1.1rem;
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.35);
}

.modal-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: #111827;
}

.modal-text {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #4b5563;
}

.modal-hint {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.progress-container {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #f3f4f6;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #facc15, #22c55e);
  transition: width 0.08s linear;
}

@media (max-width: 768px) {
  .site-header {
    padding-inline: 1.25rem;
  }

  .nav-links {
    display: none;
  }

  .card {
    padding-inline: 1.5rem;
  }

  .form-row,
  .two-column {
    flex-direction: column;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-filters {
    justify-content: flex-start;
  }
}

