:root {
  color-scheme: light;
  --bg: #eef1f6;
  --surface: #ffffff;
  --ink: #1d1f22;
  --muted: #5f6a78;
  --accent: #1a3d8f;
  --accent-dark: #122c6a;
  --accent-red: #d42027;
  --line: #d4dae3;
  --shadow: 0 18px 40px rgba(26, 61, 143, 0.10);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  background: radial-gradient(circle at top, #dce3f0 0%, #eef1f6 45%, #e8ecf2 100%);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: 48px;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.hero {
  padding: 36px 24px 20px;
  background: linear-gradient(160deg, #0d1b3e 0%, #1a3d8f 55%, #2956a8 100%);
  color: #eef2ff;
  border-bottom-left-radius: 36px;
  border-bottom-right-radius: 36px;
}

.hero__content {
  display: grid;
  gap: 14px;
}

.hero__brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero__logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: 0 0 auto;
  padding: 8px;
  border-radius: 18px;
  background: #ffffff;
}

.hero__label {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}

.hero__title {
  font-family: "Nanum Myeongjo", serif;
  font-size: 2.2rem;
  margin: 4px 0 0;
}

.hero__subtitle {
  margin: 0;
  color: rgba(238, 242, 255, 0.82);
  line-height: 1.5;
}

.main {
  padding: 24px;
  display: grid;
  gap: 24px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

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

label {
  font-weight: 600;
  font-size: 0.9rem;
}

input {
  width: 100%;
  padding: 16px 18px;
  margin: 10px 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  font-size: 1rem;
  background: #f5f7fb;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 61, 143, 0.12);
}

button {
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  min-height: 52px;
}

button.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 22px rgba(26, 61, 143, 0.30);
}

button.primary:hover,
button.primary:focus {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(26, 61, 143, 0.35);
}

button.primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(26, 61, 143, 0.30);
}

button.ghost {
  width: auto;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  min-height: 44px;
}

button.ghost:hover,
button.ghost:focus {
  background: var(--bg);
  transform: translateY(-1px);
}

.helper {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 12px;
}

.error {
  color: #c7372f;
  margin-top: 12px;
}

.badge {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #1a3d8f;
  color: #fff;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hidden {
  display: none;
}

.dashboard__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.status {
  margin-top: 18px;
  padding: 16px;
  background: #eef1f6;
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.status__label {
  margin: 0 0 6px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.option-row {
  margin-top: 12px;
}

.option-row__label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.certificates {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

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

.grid-form button {
  margin-top: 8px;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

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

th,
td {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
}

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

.action-group button {
  width: auto;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.action-group button.secondary {
  background: #dce3f0;
  color: var(--ink);
}

th {
  background: #eef1f6;
  font-weight: 600;
}

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

.certificate {
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
  background: #f8faff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.certificate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(29, 31, 34, 0.08);
}

.certificate h3 {
  margin: 0;
  font-size: 1.1rem;
}

.certificate p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.certificate button {
  margin-top: 8px;
  min-height: 48px;
}

.certificate button:hover,
.certificate button:focus {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(26, 61, 143, 0.25);
}

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

@media (max-width: 480px) {
  .hero {
    padding: 28px 20px 16px;
  }

  .hero__title {
    font-size: 1.8rem;
  }

  .main {
    padding: 20px;
  }

  .card {
    padding: 20px;
  }

  .status {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .certificate {
    padding: 18px;
  }

  .action-group {
    flex-direction: column;
    gap: 6px;
  }

  .action-group button {
    width: 100%;
  }
}

.point-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d42027 0%, #b01a20 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.shop-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.shop-product {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f8faff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shop-product:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(29, 31, 34, 0.08);
}

.shop-product__img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #dce3f0;
}

.shop-product__body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-product__name {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}

.shop-product__category {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.shop-product__price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin: 4px 0 0;
}

.shop-product__desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.shop-product button {
  margin: 0 14px 14px;
  min-height: 42px;
  font-size: 0.9rem;
  width: calc(100% - 28px);
  box-sizing: border-box;
  white-space: nowrap;
  flex-shrink: 0;
}

.shop-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
}

@media (max-width: 480px) {
  .shop-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .shop-product__img {
    height: 100px;
  }

  .shop-product__body {
    padding: 10px;
  }

  .shop-product button {
    margin: 0 10px 10px;
    width: calc(100% - 20px);
    min-height: 38px;
    font-size: 0.82rem;
  }
}

@media (min-width: 768px) {
  .app {
    max-width: 820px;
  }

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

  .hero__title {
    font-size: 2.6rem;
  }

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

  .grid-form button {
    grid-column: 1 / -1;
  }

  #employee-admin .table-wrap {
    max-height: 360px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #employee-admin .table-wrap th {
    position: sticky;
    top: 0;
    z-index: 1;
  }
}
