:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-soft: #f0f5f2;
  --text: #202124;
  --muted: #60646c;
  --line: #dadce0;
  --green: #2f6f4f;
  --blue: #2f5f8f;
  --rose: #9a3f57;
  --gold: #a86f1d;
  --shadow: 0 14px 34px rgba(32, 33, 36, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.brand,
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.user-chip {
  max-width: 38vw;
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--green);
  color: #fff;
}

.button.secondary {
  border-color: rgba(47, 95, 143, 0.26);
  background: #eef5fb;
  color: var(--blue);
}

.button.outline {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.button.full {
  width: 100%;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(420px, 1.4fr);
  grid-template-areas:
    "notice notice"
    "today calendar"
    "week calendar";
  gap: 18px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 4vw, 40px);
}

.notice {
  padding: 14px 16px;
  border: 1px solid rgba(168, 111, 29, 0.28);
  border-radius: 8px;
  background: #fff8e7;
  color: #68430e;
}

.notice.wide {
  grid-area: notice;
}

.summary-panel,
.calendar-panel,
.login-box,
.simple-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-panel {
  min-width: 0;
  padding: 20px;
}

.today-panel {
  grid-area: today;
}

.week-panel {
  grid-area: week;
}

.calendar-panel {
  grid-area: calendar;
  min-width: 0;
  padding: 20px;
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

h2 {
  font-size: 1.28rem;
}

.muted,
.status-text {
  color: var(--muted);
}

.status-text {
  min-width: 88px;
  text-align: right;
  font-size: 0.9rem;
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-list.compact {
  max-height: 440px;
  overflow: auto;
  padding-right: 2px;
}

.event-row {
  display: grid;
  grid-template-columns: minmax(76px, 0.4fr) minmax(0, 1fr);
  gap: 2px 12px;
  width: 100%;
  min-height: 70px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.event-row:hover,
.event-row:focus-visible {
  border-color: rgba(47, 111, 79, 0.38);
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 111, 79, 0.12);
}

.event-row.priority-normal {
  border-left-color: var(--blue);
}

.event-row.priority-medium {
  border-left-color: var(--gold);
}

.event-row.priority-high {
  border-left-color: var(--rose);
}

.event-time {
  grid-row: span 2;
  color: var(--muted);
  font-weight: 700;
}

.event-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.event-meta {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.92rem;
}

#calendar {
  min-height: 620px;
}

.fc {
  --fc-border-color: var(--line);
  --fc-button-bg-color: var(--green);
  --fc-button-border-color: var(--green);
  --fc-button-hover-bg-color: #255b40;
  --fc-button-hover-border-color: #255b40;
  --fc-button-active-bg-color: var(--blue);
  --fc-button-active-border-color: var(--blue);
  color: var(--text);
}

.fc .fc-toolbar {
  gap: 10px;
  flex-wrap: wrap;
}

.fc .fc-toolbar-title {
  font-size: 1.35rem;
  letter-spacing: 0;
}

.fc .fc-button {
  border-radius: 8px;
  font-weight: 700;
}

.fc .fc-event {
  border: 0;
  border-radius: 6px;
  padding: 2px 4px;
}

.fc .priority-normal {
  background: var(--blue);
}

.fc .priority-medium {
  background: var(--gold);
}

.fc .priority-high {
  background: var(--rose);
}

.event-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.event-dialog::backdrop {
  background: rgba(32, 33, 36, 0.46);
}

.event-dialog form {
  padding: 22px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.login-page,
.simple-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-box,
.simple-box {
  width: min(420px, 100%);
  padding: 28px;
}

.login-brand {
  margin-bottom: 24px;
}

.login-brand h1 {
  font-size: 1.6rem;
}

.alert {
  padding: 12px 14px;
  border: 1px solid rgba(154, 63, 87, 0.28);
  border-radius: 8px;
  background: #fff0f3;
  color: #783044;
}

@media (max-width: 980px) {
  .dashboard {
    grid-template-columns: 1fr;
    grid-template-areas:
      "notice"
      "today"
      "week"
      "calendar";
  }

  #calendar {
    min-height: 560px;
  }
}

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

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .user-chip {
    max-width: 100%;
  }

  .button {
    min-height: 42px;
  }

  .dashboard {
    padding: 14px;
  }

  .summary-panel,
  .calendar-panel {
    padding: 16px;
  }

  .event-row {
    grid-template-columns: 1fr;
  }

  .event-time {
    grid-row: auto;
  }

  #calendar {
    min-height: 520px;
  }

  .fc .fc-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .fc .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
  }
}

