@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=Manrope:wght@500;600;700;800&display=swap");

:root {
  --bg: #eff4fb;
  --surface: rgba(255, 255, 255, 0.95);
  --surface-strong: #ffffff;
  --line: #d5e0ef;
  --line-strong: #bed0e6;
  --text: #132038;
  --muted: #5a6f8e;
  --brand-red: #d5001c;
  --brand-blue: #0b3d91;
  --soft-blue: #f1f6ff;
  --soft-red: #fff0f2;
  --shadow: 0 18px 48px rgba(14, 40, 74, 0.11);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 5% -5%, rgba(213, 0, 28, 0.16), transparent 36%),
    radial-gradient(circle at 105% 110%, rgba(11, 61, 145, 0.18), transparent 40%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 45%, #edf3fb 100%);
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.55;
  animation: float 12s ease-in-out infinite;
}

.bg-shape-a {
  width: 420px;
  height: 420px;
  top: -220px;
  left: -120px;
  background: rgba(213, 0, 28, 0.26);
}

.bg-shape-b {
  width: 390px;
  height: 390px;
  right: -130px;
  bottom: -180px;
  background: rgba(11, 61, 145, 0.23);
  animation-delay: -5s;
}

.page {
  width: min(1220px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(16px, 2.2vw, 30px);
  display: grid;
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: clamp(16px, 1.6vw, 24px);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background:
    linear-gradient(135deg, rgba(11, 61, 145, 0.07), rgba(213, 0, 28, 0.07)),
    var(--surface);
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  width: 62px;
  height: 62px;
  border-radius: 14px;
  padding: 6px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  object-fit: contain;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.78rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(213, 0, 28, 0.35);
  background: var(--soft-red);
  color: #9a1a2f;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 12px;
  white-space: nowrap;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(310px, 1fr);
  gap: 18px;
  align-items: start;
}

.side-stack {
  display: grid;
  gap: 18px;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  background: var(--soft-blue);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 16px;
}

button {
  font: inherit;
}

.tab-btn {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: #38506f;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.22s ease, transform 0.15s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.tab-btn:hover {
  color: #213753;
}

.tab-btn.active {
  background: var(--surface-strong);
  color: #14243d;
  box-shadow: 0 8px 20px rgba(35, 62, 98, 0.14);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: panel-in 0.24s ease;
}

form {
  display: grid;
  gap: 12px;
}

label {
  font-size: 0.82rem;
  color: #425a78;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  color: var(--text);
  padding: 12px 13px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input::placeholder {
  color: #7a8faa;
}

input:focus,
select:focus {
  outline: none;
  border-color: #8ba8cc;
  box-shadow: 0 0 0 4px rgba(11, 61, 145, 0.12);
  transform: translateY(-1px);
}

input[type="file"] {
  border-style: dashed;
  background: #f9fbff;
  padding: 11px 12px;
}

#submitManual,
#submitImport,
#downloadCsvTemplate,
#downloadXlsxTemplate {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 13px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

#submitManual,
#submitImport {
  background: linear-gradient(120deg, var(--brand-red), #b70726 48%, #8f0c2c 100%);
  box-shadow: 0 10px 24px rgba(213, 0, 28, 0.25);
}

#downloadCsvTemplate,
#downloadXlsxTemplate {
  background: linear-gradient(120deg, var(--brand-blue), #1457c1);
  box-shadow: 0 10px 24px rgba(11, 61, 145, 0.25);
}

#submitManual:hover,
#submitImport:hover,
#downloadCsvTemplate:hover,
#downloadXlsxTemplate:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
}

#submitManual:disabled,
#submitImport:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.2);
}

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

.result-box {
  margin-top: 12px;
  min-height: 48px;
  max-height: 250px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f7fbff;
  color: #304c70;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.4;
}

.status {
  min-height: 68px;
  padding: 12px 13px;
  border-radius: 12px;
  background: #f6f9ff;
  border: 1px solid var(--line);
  color: #1d2f49;
  line-height: 1.5;
  font-weight: 600;
}

code {
  background: #eaf1fb;
  border-radius: 6px;
  padding: 2px 5px;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.82em;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(10px);
  }
}

@media (max-width: 1040px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-tag {
    align-self: flex-start;
  }

  .side-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .panel-switch {
    grid-template-columns: 1fr;
  }

  .hero-brand {
    align-items: flex-start;
  }

  .logo {
    width: 52px;
    height: 52px;
  }
}
