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

:root {
  --bg: #f2f5f8;
  --panel: #ffffff;
  --panel-soft: #f9fcff;
  --text: #1a222c;
  --muted: #5e6a77;
  --primary: #1f7a6f;
  --primary-dark: #12564f;
  --primary-soft: #e8f7f3;
  --accent: #f3a63b;
  --danger: #b5273f;
  --line: #dce4ea;
  --focus: rgba(31, 122, 111, 0.18);
  --shadow-soft: 0 8px 20px rgba(17, 31, 46, 0.06);
  --shadow-pop: 0 12px 26px rgba(17, 31, 46, 0.1);
  --radius: 16px;
}

:root[data-theme='dark'] {
  --bg: #090c11;
  --panel: #121620;
  --panel-soft: #0f131b;
  --text: #edf2f7;
  --muted: #a8b2bf;
  --primary: #eceff3;
  --primary-dark: #d6dbe2;
  --primary-soft: #1a2028;
  --accent: #d7b277;
  --line: #313845;
  --focus: rgba(255, 255, 255, 0.2);
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.3);
  --shadow-pop: 0 12px 26px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at -12% -20%, #e6f5f0 0%, rgba(230, 245, 240, 0) 62%),
    radial-gradient(900px 460px at 110% -10%, #eef5ff 0%, rgba(238, 245, 255, 0) 60%),
    var(--bg);
  font-family: 'Noto Sans KR', sans-serif;
  line-height: 1.45;
}

[data-theme='dark'] body {
  background:
    radial-gradient(920px 480px at -8% -20%, rgba(88, 95, 110, 0.24) 0%, rgba(88, 95, 110, 0) 64%),
    radial-gradient(760px 420px at 110% -12%, rgba(64, 70, 83, 0.24) 0%, rgba(64, 70, 83, 0) 62%),
    var(--bg);
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(247, 250, 252, 0.84);
  border-bottom: 1px solid var(--line);
}

[data-theme='dark'] header {
  background: rgba(10, 13, 18, 0.82);
}

.topbar {
  max-width: 1080px;
  margin: 0 auto;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.35px;
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 0 rgba(17, 31, 46, 0.03);
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.14s ease, box-shadow 0.18s ease;
}

nav a.active {
  color: white;
  border-color: var(--primary);
  background: linear-gradient(180deg, #2a9588, var(--primary));
  box-shadow: 0 10px 18px rgba(31, 122, 111, 0.22);
}

@media (min-width: 861px) {
  body.has-side-nav nav {
    position: fixed;
    left: 14px;
    top: 82px;
    z-index: 21;
    width: 128px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--panel), var(--panel-soft));
    box-shadow: var(--shadow-soft);
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 6px;
  }

  body.has-side-nav nav a {
    width: 100%;
    text-align: center;
    border-radius: 10px;
    padding: 7px 10px;
  }

  body.has-side-nav main {
    padding-left: 154px;
  }
}

[data-theme='dark'] nav a {
  background: rgba(19, 24, 32, 0.9);
  box-shadow: none;
}

[data-theme='dark'] nav a.active {
  color: #101318;
  border-color: #eef2f7;
  background: linear-gradient(180deg, #ffffff, #d8dde5);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}

main {
  max-width: 1080px;
  margin: 22px auto 32px;
  padding: 0 16px;
  animation: page-fade 0.28s ease;
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.2s ease;
}

[data-theme='dark'] .card {
  background: linear-gradient(180deg, #141a24, #111721);
}

.title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.1px;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

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

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

input:not([type='checkbox']):not([type='radio']), select, textarea {
  width: 100%;
  border: 1px solid #d2dde7;
  border-radius: 10px;
  padding: 9px 11px;
  background: #fbfdff;
  min-height: 36px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

[data-theme='dark'] input:not([type='checkbox']):not([type='radio']),
[data-theme='dark'] select,
[data-theme='dark'] textarea {
  color: var(--text);
  background: #161d28;
  border-color: #364050;
}

input[type='checkbox'] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  margin: 0 4px 0 0;
  vertical-align: -2px;
  accent-color: var(--primary);
}

textarea { min-height: 100px; }

label {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.field {
  margin-bottom: 12px;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  background: #f7fbff;
  color: var(--text);
  font-size: 13px;
}

[data-theme='dark'] .day-item {
  background: #151b25;
  border-color: #384253;
}

.day-item input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

.day-item input[type='number'] {
  margin-top: 6px;
  padding: 8px 6px;
  text-align: center;
}

button {
  border: 0;
  border-radius: 10px;
  min-height: 34px;
  padding: 6px 11px;
  background: linear-gradient(180deg, #2a9588, var(--primary));
  color: white;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(31, 122, 111, 0.2);
  transition: transform 0.12s ease, filter 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

[data-theme='dark'] button {
  color: #101318;
  background: linear-gradient(180deg, #ffffff, #d5dbe4);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

button.secondary {
  background: linear-gradient(180deg, #33455a, #243344);
  box-shadow: 0 8px 16px rgba(37, 52, 70, 0.2);
}
[data-theme='dark'] button.secondary {
  color: #f4f7fb;
  background: linear-gradient(180deg, #5d6675, #3f4754);
}
button.warn {
  background: linear-gradient(180deg, #cb3550, var(--danger));
  box-shadow: 0 8px 16px rgba(181, 39, 63, 0.2);
}
[data-theme='dark'] button.warn {
  color: #fff;
  background: linear-gradient(180deg, #d34f66, #aa2d46);
}
button.ghost {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(18, 35, 52, 0.05);
}

[data-theme='dark'] button.ghost {
  background: rgba(21, 26, 35, 0.92);
  border-color: #3a4352;
  color: var(--text);
  box-shadow: none;
}

button:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
}
button:active { transform: translateY(0); }
button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #cde9e3;
  background: var(--primary-soft);
  color: #195d54;
  font-size: 12px;
}

[data-theme='dark'] .badge {
  border-color: #3a4453;
  background: #1a2029;
  color: #dde5ef;
}

.task {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
  background: #fcfeff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

[data-theme='dark'] .task {
  background: #141a24;
  border-color: #343d4b;
}

.task.done { opacity: 0.55; }
.task h4 { margin: 0 0 6px; font-size: 14px; }
.task p { margin: 0; font-size: 13px; color: var(--muted); }

.task-actions button {
  padding: 7px 10px;
  font-size: 12px;
}

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

.calendar-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

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

.pricing-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #fcfeff, #f8fbff);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

[data-theme='dark'] .pricing-card {
  background: linear-gradient(180deg, #141a24, #111722);
  border-color: #343d4b;
}

.pricing-card h3 {
  margin: 0;
  font-size: 16px;
}

.pricing-card .price {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.pricing-card.active-tier {
  border-color: var(--primary);
  background: #eaf8f5;
  box-shadow: inset 0 0 0 1px rgba(31, 122, 111, 0.2);
}

nav a:hover {
  border-color: #c5d2dd;
  background: #f8fbfd;
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(24, 40, 56, 0.08);
}

[data-theme='dark'] nav a:hover {
  border-color: #495465;
  background: #1b222e;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.25);
}

.card:hover,
.task:hover,
.pricing-card:hover {
  border-color: #cfd9e2;
  box-shadow: var(--shadow-pop);
  transform: translateY(-1px);
}

.kpi {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.kpi > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fbfdff;
}

[data-theme='dark'] .kpi > div {
  background: #151c27;
  border-color: #343d4b;
}

.kpi strong {
  display: block;
  font-size: 20px;
  font-family: 'Space Grotesk', sans-serif;
}

.mobile-bar {
  display: none;
}

.desktop-only { display: block; }
.mobile-only { display: none; }

.install-wrap {
  margin-left: auto;
}

.theme-toggle {
  white-space: nowrap;
}

.notice {
  padding: 8px 10px;
  border-left: 4px solid var(--accent);
  background: #fff9ef;
  font-size: 13px;
  color: #7a4b00;
  border-radius: 8px;
}

[data-theme='dark'] .notice {
  background: #2a2419;
  color: #f0cf98;
  border-left-color: #d7ad6f;
}

.hidden { display: none !important; }

.toast-stack {
  position: fixed;
  right: 14px;
  bottom: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(92vw, 380px);
}

.toast {
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 10px 22px rgba(9, 16, 24, 0.24);
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.toast-info { background: #283544; }
.toast-success { background: #1f7a6f; }
.toast-warn { background: #9a5a06; }
.toast-error { background: #b5273f; }
.toast-hide {
  transform: translateY(6px);
  opacity: 0;
}

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

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  nav { display: none; }
  .day-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .editor-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .toast-stack {
    left: 10px;
    right: 10px;
    max-width: none;
  }
  .mobile-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-top: 8px;
  }
  .mobile-bar a {
    text-align: center;
    text-decoration: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 8px 4px;
    font-size: 12px;
    box-shadow: 0 3px 10px rgba(17, 31, 46, 0.06);
    transition: transform 0.14s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }
  .mobile-bar a.active {
    color: #fff;
    border-color: var(--primary);
    background: linear-gradient(180deg, #2a9588, var(--primary));
    box-shadow: 0 10px 16px rgba(31, 122, 111, 0.24);
  }
  .mobile-bar a:hover {
    transform: translateY(-1px);
    border-color: #c7d4df;
  }
  [data-theme='dark'] .mobile-bar a {
    background: rgba(19, 24, 32, 0.95);
    border-color: #3a4352;
    box-shadow: none;
  }
  [data-theme='dark'] .mobile-bar a.active {
    color: #101318;
    border-color: #eef2f7;
    background: linear-gradient(180deg, #ffffff, #d8dde5);
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.35);
  }
  [data-theme='dark'] .mobile-bar a:hover {
    border-color: #4b5566;
  }
  .desktop-only { display: none; }
  .mobile-only { display: block; }
}
