@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Mono:wght@400;600&family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
  --bg-0: #050c13;
  --bg-1: #0d1a27;
  --bg-2: #153149;
  --panel: rgba(12, 27, 40, 0.8);
  --panel-strong: rgba(8, 20, 31, 0.92);
  --line: rgba(137, 190, 224, 0.32);
  --line-strong: rgba(255, 171, 64, 0.62);
  --text: #e8f2fb;
  --muted: #9fb5c7;
  --brand: #ff9f43;
  --brand-deep: #d87a1b;
  --accent: #45d3c2;
  --ok: #3ee596;
  --warn: #ff6b6b;
  --admin: #ffd166;
  --user: #9acbff;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: 'Space Grotesk', 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  letter-spacing: 0.01em;
  background: linear-gradient(160deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: min(42vw, 620px);
  height: min(42vw, 620px);
  top: -18vmin;
  right: -10vmin;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 159, 67, 0.42), rgba(255, 159, 67, 0));
  filter: blur(8px);
}

body::after {
  width: min(40vw, 560px);
  height: min(40vw, 560px);
  left: -12vmin;
  bottom: -22vmin;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(69, 211, 194, 0.28), rgba(69, 211, 194, 0));
  filter: blur(10px);
}

.bg-aurora {
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 159, 67, 0.18), transparent 34%),
    radial-gradient(circle at 12% 15%, rgba(69, 211, 194, 0.16), transparent 38%),
    linear-gradient(140deg, var(--bg-0), #0b1723 45%, #123247 100%);
}

.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 90% 5%, rgba(255, 159, 67, 0.12), transparent 32%),
    linear-gradient(165deg, #050c13, #0a1724 48%, #123046);
  background-size:
    22px 22px,
    22px 22px,
    auto,
    auto;
}

.shell,
.dashboard {
  position: relative;
  z-index: 1;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.dashboard {
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px;
  display: grid;
  gap: 16px;
}

.panel {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  padding: 20px;
}

.panel.narrow {
  width: min(460px, 100%);
}

.auth-grid {
  width: min(980px, 100%);
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

#admin-panel {
  border-color: rgba(255, 209, 102, 0.45);
  background:
    radial-gradient(circle at 100% 10%, rgba(255, 209, 102, 0.16), rgba(255, 209, 102, 0)),
    var(--panel);
}

h1,
h2,
h3 {
  margin: 0 0 8px;
  line-height: 1.24;
  font-weight: 700;
}

h1 {
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0.015em;
}

h2 {
  font-size: clamp(18px, 2vw, 24px);
}

h3 {
  font-size: clamp(16px, 1.6vw, 20px);
}

.subtitle {
  margin: 0 0 14px;
  color: var(--muted);
}

.hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.92em;
  border: 1px solid rgba(154, 198, 231, 0.3);
  border-radius: 8px;
  padding: 0.15em 0.45em;
  background: rgba(10, 24, 37, 0.72);
}

.stack-gap {
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
}

.row.wrap {
  flex-wrap: wrap;
}

.row.between {
  justify-content: space-between;
}

.gap-sm {
  gap: 8px;
}

.gap-md {
  gap: 12px;
}

.top-gap {
  margin-top: 14px;
}

.full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: #d5e4f2;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: rgba(7, 18, 27, 0.78);
  padding: 10px 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(159, 181, 199, 0.9);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(255, 159, 67, 0.2);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

button {
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 204, 146, 0.44);
  color: #2a1703;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  padding: 10px 14px;
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 180ms ease, filter 180ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(216, 122, 27, 0.32);
  filter: saturate(1.05);
}

button:active {
  transform: translateY(0);
}

button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.btn-secondary {
  color: #dce9f5;
  background: linear-gradient(145deg, #1b3245, #17283a);
  border-color: rgba(150, 189, 219, 0.35);
}

.btn-secondary:hover {
  box-shadow: 0 8px 20px rgba(22, 40, 58, 0.44);
}

.btn-danger {
  color: #ffe8e8;
  background: linear-gradient(145deg, #883535, #5f2727);
  border-color: rgba(255, 159, 159, 0.45);
}

.btn-danger:hover {
  box-shadow: 0 8px 20px rgba(95, 39, 39, 0.5);
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 21, 32, 0.78);
}

.radio-pill input {
  margin: 0;
  width: auto;
  accent-color: var(--brand);
}

.mode-btn {
  color: #dae9f8;
  background: linear-gradient(145deg, #20384d, #1a2f40);
  border-color: rgba(150, 189, 219, 0.35);
}

.mode-btn.active {
  color: #2a1703;
  border-color: rgba(255, 199, 130, 0.64);
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
}

.mode-panel {
  border-top: 1px dashed rgba(164, 204, 232, 0.34);
  padding-top: 16px;
}

.hidden {
  display: none;
}

.time-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.time-grid input {
  min-width: 0;
}

.message {
  min-height: 1.3em;
  margin: 0;
  font-weight: 600;
}

.message.error {
  color: var(--warn);
}

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

.badge {
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid rgba(150, 189, 219, 0.42);
  background: rgba(9, 21, 32, 0.78);
  color: #d9ebfb;
  font-size: 13px;
}

.jobs {
  display: grid;
  gap: 10px;
}

.users {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding-right: 2px;
}

.users::-webkit-scrollbar {
  width: 8px;
}

.users::-webkit-scrollbar-thumb {
  background: rgba(150, 189, 219, 0.34);
  border-radius: 999px;
}

.admin-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.admin-card,
.user-card,
.job-card {
  border: 1px solid rgba(150, 189, 219, 0.28);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
}

.admin-card {
  padding: 12px;
}

.admin-card h3 {
  margin-bottom: 10px;
}

.user-card {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.inline-fields {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.01em;
}

.badge.role-admin {
  border-color: rgba(255, 209, 102, 0.6);
  color: #ffe7a7;
}

.badge.role-user {
  border-color: rgba(154, 203, 255, 0.55);
  color: #d7ebff;
}

.badge.state-active {
  border-color: rgba(62, 229, 150, 0.45);
  color: #bbf6d8;
}

.badge.state-disabled {
  border-color: rgba(255, 107, 107, 0.5);
  color: #ffd0d0;
}

.job-card {
  padding: 12px;
}

.job-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.job-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.job-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 204, 146, 0.44);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 700;
  color: #ffd8b1;
  background: rgba(66, 36, 9, 0.5);
}

details {
  margin-top: 9px;
}

summary {
  cursor: pointer;
  color: #d6e9fa;
}

summary:hover {
  color: #ffffff;
}

.item-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(150, 189, 219, 0.25);
  font-size: 13px;
}

.item-row strong {
  color: #f0f7ff;
}

.fade-in {
  animation: riseIn 0.48s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.delay-1 {
  animation-delay: 0.08s;
}

.delay-2 {
  animation-delay: 0.16s;
}

.delay-3 {
  animation-delay: 0.24s;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .dashboard {
    padding: 16px;
  }

  .panel {
    padding: 16px;
    border-radius: 16px;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 14px;
  }

  .dashboard {
    padding: 12px;
    gap: 12px;
  }

  .row.between {
    gap: 10px;
    align-items: flex-start;
  }

  .action-row {
    width: 100%;
  }

  .action-row button {
    flex: 1 1 42%;
  }

  button,
  input,
  select,
  textarea {
    font-size: 15px;
  }
}
