:root {
  --bg: #0f172a;
  --bg-elevated: #020617;
  --border-subtle: #1f2937;
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.15);
  --accent-strong: #4ade80;
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.7);
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #1e293b, #020617 52%, #000 90%);
  color: var(--text);
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 1120px;
  margin: 32px auto;
  padding: 24px 20px 32px;
}

/* 登入畫面 */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  width: 100%;
}

.login-card {
  background: radial-gradient(circle at top left, #020617, #020617 40%, #020617);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: var(--shadow-soft);
  width: 100%;
  max-width: 400px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-desc {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.btn.full-width {
  width: 100%;
  margin-top: 4px;
}

/* 後台 header */
.header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.app-header {
  padding: 16px 10px 24px;
}

.app-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.app-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.app-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
  gap: 20px;
}

.card {
  background: radial-gradient(circle at top left, #020617, #020617 40%, #020617);
  border-radius: var(--radius-lg);
  padding: 18px 18px 20px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.card h2 {
  margin: 0 0 16px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

input[type="text"],
input[type="number"],
input[type="email"] {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  font-size: 14px;
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.5);
  background-color: rgba(15, 23, 42, 0.95);
}

input::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.btn {
  border-radius: 999px;
  border: 0;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background-color 0.12s ease, color 0.12s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #022c22;
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.35);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(34, 197, 94, 0.4);
}

.btn.ghost {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn.ghost:hover {
  background: rgba(15, 23, 42, 1);
  color: var(--text);
}

.btn.small {
  padding: 5px 10px;
  font-size: 12px;
}

.btn.icon {
  padding-inline: 10px;
}

.btn.icon.danger {
  background: var(--danger-soft);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.5);
}

.btn.icon.danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

.table-wrapper {
  margin-top: 6px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 41, 55, 0.9);
  background: radial-gradient(circle at top left, #020617, #020617 40%, #020617);
  max-height: 420px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.98);
  z-index: 1;
}

th,
td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(31, 41, 55, 0.85);
}

th {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 12px;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(15, 118, 110, 0.18);
}

.message {
  margin-top: 8px;
  font-size: 13px;
  min-height: 18px;
}

.message--success {
  color: var(--accent-strong);
}

.message--error {
  color: #fecaca;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--text-muted);
}

.numeric {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .app {
    margin: 16px auto;
    padding-inline: 14px;
  }

  .card {
    padding-inline: 14px;
  }
}

