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

:root {
  --bg: #f4f0e8;
  --card: #ffffff;
  --ink: #182028;
  --muted: #5b6a72;
  --accent: #ff6b35;
  --accent-dark: #e25727;
  --teal: #1f8a8a;
  --border: #e4ded4;
  --shadow: 0 20px 40px rgba(23, 33, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff5e5 0%, var(--bg) 55%) fixed;
  min-height: 100vh;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(31, 138, 138, 0.15), transparent 45%),
    radial-gradient(circle at 10% 85%, rgba(255, 107, 53, 0.15), transparent 40%);
  z-index: -1;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 8vw 12px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #ff9a3c);
  box-shadow: 0 10px 20px rgba(255, 107, 53, 0.35);
}

h1, h2 {
  font-family: 'Space Grotesk', sans-serif;
  margin: 0;
}

h1 {
  font-size: 1.9rem;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

.container {
  padding: 0 8vw 60px;
}

.card {
  background: var(--card);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 26px;
  animation: rise 0.6s ease-out both;
}

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

.auth {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.auth-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 500;
}

input, select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fcfbf8;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button,
a.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.primary {
  background: var(--accent);
  color: white;
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 999px;
}

.msg {
  min-height: 20px;
  font-size: 0.9rem;
  color: var(--teal);
}

h3 {
  margin: 6px 0 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.grid {
  display: grid;
  gap: 20px;
}

.card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.option-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.option-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.option-toggle input {
  width: 18px;
  height: 18px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 32, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-card {
  background: var(--card);
  border-radius: 18px;
  padding: 22px 26px;
  max-width: 320px;
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
}

.summary .label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.summary .value {
  font-size: 1.3rem;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.badge {
  background: rgba(31, 138, 138, 0.15);
  color: var(--teal);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.sector-alert {
  margin-top: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.sector-alert.is-over {
  color: #c84215;
}

.diff-positive {
  color: var(--teal);
  font-weight: 600;
}

.diff-negative {
  color: #c84215;
  font-weight: 600;
}

.site-footer {
  padding: 10px 8vw 30px;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 860px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .data-table {
    min-width: 460px;
  }
}
