:root {
  --pico-font-size: 16px;
  --pico-form-element-spacing-vertical: 0.25rem;
  --pico-form-element-spacing-horizontal: 0.5rem;
  --brand-blue: #1568c7;
}

body {
  font-family: sans-serif;
  padding: 1rem;
}

/* 네비게이션 로고 */
nav ul li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo {
  height: 32px;
  width: auto;
}

.container {
  max-width: 1400px;
}

h1 {
  color: #333;
}

[role='alert'] {
  color: #c62828;
}

/* 공지사항 배너 */
.notice-section {
  margin-bottom: 1.35rem;
}

.notice-title-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.notice-banner {
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

[x-cloak] {
  display: none !important;
}

/* 상단 캘린더 */
.schedule-section {
  margin-bottom: 1.35rem;
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.86fr);
  gap: clamp(1rem, 2.1vw, 1.9rem);
  align-items: start;
}

.schedule-copy,
.schedule-calendar {
  min-width: 0;
}

.schedule-calendar {
  width: min(100%, 36rem);
  margin-left: auto;
}

.schedule-title {
  margin: 0;
  color: #1b1b1f;
  font-size: clamp(2.35rem, 5vw, 4.5rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
  font-weight: 900;
}

.schedule-title-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.schedule-divider {
  width: 100%;
  height: 1px;
  margin: clamp(1.25rem, 2.6vw, 2.75rem) 0 1.45rem;
  background: rgba(33, 35, 39, 0.75);
}

.schedule-selected-meta {
  display: flex;
  align-items: center;
}

.schedule-selected-date {
  display: grid;
  grid-template-columns: max-content 1.35rem max-content;
  grid-template-rows: auto auto;
  column-gap: 0.12rem;
  row-gap: 0.02rem;
  align-items: end;
  color: #222328;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.schedule-selected-month,
.schedule-selected-day {
  font-size: clamp(1.35rem, 1.45vw, 1.9rem);
  line-height: 0.92;
}

.schedule-selected-month {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.schedule-selected-slash {
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: center;
  align-self: stretch;
  width: 1px;
  background: rgba(34, 35, 40, 0.65);
  transform: rotate(37deg);
  transform-origin: center;
}

.schedule-selected-dayline {
  grid-column: 3;
  grid-row: 2;
  display: inline-flex;
  align-items: flex-end;
  gap: 0.32rem;
  justify-self: start;
}

.schedule-selected-day {
  line-height: 0.92;
}

.schedule-selected-weekday {
  color: #222328;
  font-size: clamp(0.82rem, 0.72vw, 1rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.96;
  padding-bottom: 0.06rem;
}

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.schedule-list.schedule-list-lined {
  gap: 0;
}

.schedule-list-item {
  display: grid;
  grid-template-columns: 4.8rem 0.85rem 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  margin: 0;
  border-radius: 0.8rem;
}

.schedule-list.schedule-list-lined .schedule-list-item {
  gap: 0.9rem;
  padding: 1.2rem 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
  border-radius: 0;
}

.schedule-list.schedule-list-lined .schedule-list-item.has-divider-after {
  border-bottom: 1px solid rgba(33, 35, 39, 0.2);
}

.schedule-list.schedule-list-lined .schedule-list-item.is-time-group-open {
  padding-bottom: 0.8rem;
}

.schedule-list.schedule-list-lined
  .schedule-list-item.is-time-group-continuation {
  padding-top: 0.8rem;
}

.schedule-list-time {
  color: #222328;
  font-size: clamp(0.95rem, 0.65vw + 0.78rem, 1.18rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.schedule-list-separator {
  width: 1px;
  min-height: 1.45rem;
  align-self: stretch;
  justify-self: center;
  background: rgba(33, 35, 39, 0.16);
  border-radius: 999px;
}

.schedule-list-title {
  margin: 0;
  color: #222328;
  font-size: clamp(0.82rem, 0.42vw + 0.73rem, 1.08rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.schedule-empty {
  margin: 0;
  color: #666;
  font-size: 0.95rem;
}

.schedule-calendar-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

.schedule-calendar-selectors {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.schedule-year-picker,
.schedule-month-picker {
  position: relative;
  display: inline-flex;
  width: fit-content;
}

.schedule-year-picker select {
  appearance: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #111217;
  font-size: clamp(1.22rem, 1.45vw, 1.78rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  width: auto;
  min-width: 0;
  height: auto;
  line-height: 1.08;
  padding: 0.08rem 1.35rem 0.08rem 0;
  margin: 0;
}

.schedule-month-picker select {
  appearance: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #111217;
  font-size: clamp(1.22rem, 1.45vw, 1.78rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  width: auto;
  min-width: 0;
  height: auto;
  line-height: 1.08;
  padding: 0.08rem 1.35rem 0.08rem 0;
  margin: 0;
}

.schedule-year-picker select option,
.schedule-month-picker select option {
  font-size: 1rem;
  font-weight: 700;
}

.schedule-year-picker select:focus,
.schedule-month-picker select:focus {
  outline: none;
  box-shadow: none;
}

.schedule-year-caret {
  pointer-events: none;
  position: absolute;
  top: 50%;
  right: 0.25rem;
  width: 0;
  height: 0;
  border-left: 0.28rem solid transparent;
  border-right: 0.28rem solid transparent;
  border-top: 0.34rem solid rgba(17, 18, 23, 0.8);
  transform: translateY(-30%);
}

.schedule-month-caret {
  pointer-events: none;
  position: absolute;
  top: 50%;
  right: 0.25rem;
  width: 0;
  height: 0;
  border-left: 0.28rem solid transparent;
  border-right: 0.28rem solid transparent;
  border-top: 0.34rem solid rgba(17, 18, 23, 0.8);
  transform: translateY(-30%);
}

.schedule-weekdays,
.schedule-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: calc(100% + 0.9rem);
  margin-left: -0.45rem;
}

.schedule-weekdays {
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.schedule-weekday {
  display: flex;
  justify-content: center;
  font-size: clamp(0.88rem, 0.5vw + 0.72rem, 1.35rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  color: #111217;
}

.schedule-days {
  gap: 0.45rem 0.5rem;
}

.schedule-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #2a2c31;
  font-size: clamp(0.92rem, 0.45vw + 0.78rem, 1.18rem);
  font-weight: 500;
}

.schedule-day:disabled {
  cursor: default;
  opacity: 1;
}

.schedule-day span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
}

.schedule-day.is-empty {
  visibility: hidden;
}

.schedule-day.is-sunday {
  color: #ff3d32;
}

.schedule-day.has-event span {
  background: rgba(21, 104, 199, 0.18);
  color: var(--brand-blue);
}

.schedule-day.is-today span {
  background: transparent;
  color: inherit;
  border-color: var(--brand-blue);
}

.schedule-day.is-selected span {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
  box-shadow: none;
}

/* 툴바 */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar-left button {
  margin-bottom: 0;
  white-space: nowrap;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.toolbar-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.toolbar-right input[type='search'] {
  width: 200px;
  margin-bottom: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  background-image: none;
}

.toolbar-right button {
  width: auto;
  margin-bottom: 0;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* 태그 필터 */
.tag-filter-section {
  margin-bottom: 0.75rem;
}

.tag-filter-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag-filter-label {
  font-size: 0.85rem;
  font-weight: 500;
}

.tag-filter-header button {
  margin-bottom: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.tag-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.15s;
}

.tag-chip:hover {
  border-color: #999;
}

.tag-chip input[type='checkbox'] {
  display: none;
}

.tag-chip.selected {
  background: #0077cc;
  border-color: #0077cc;
  color: #fff;
}

/* 테이블 */
.table-wrapper {
  overflow-x: auto;
}

.product-table {
  font-size: 0.8rem;
  white-space: nowrap;
  table-layout: fixed;
}

.product-table th {
  resize: horizontal;
  overflow: hidden;
  text-align: center;
}

/* 컬럼 기본 너비 */
.col-select {
  width: 40px;
}
.col-tags {
  width: 120px;
}
.col-image {
  width: 90px;
}
.col-name {
  width: 240px;
}
.col-code {
  width: 80px;
}
.col-barcode {
  width: 80px;
}
.col-price {
  width: 70px;
}
.col-date {
  width: 85px;
}
.col-qty {
  width: 55px;
}
.col-amount {
  width: 70px;
}
.col-memo {
  width: 140px;
}

.product-table th,
.product-table td {
  padding: 0.25rem 0.4rem;
  vertical-align: middle;
  min-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
}

.qty-input {
  width: 40px;
  margin: 0 !important;
  text-align: right;
}

.text-right {
  text-align: right;
}

/* 합계 행 */
.total-row {
  background-color: var(--pico-muted-color, #f0f0f0);
  font-weight: 500;
}

.total-row td {
  padding: 0.5rem 0.4rem;
}

/* 로딩 인디케이터 */
.loading {
  text-align: center;
  padding: 2rem;
  color: #666;
  font-size: 0.85rem;
}

/* 로그인 페이지 */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 4rem);
}

.login-container article {
  max-width: 400px;
  width: 100%;
}

.login-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0;
}

.login-logo {
  height: 48px;
  width: auto;
}

.login-title {
  font-size: 1.5rem;
  font-weight: bold;
}

#login-form label,
#login-form input,
#login-form select,
#login-form button,
.login-title {
  font-family:
    'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic',
    sans-serif;
}

#login-form label {
  font-size: 1rem;
  line-height: 1.4;
}

#login-form input,
#login-form select,
#login-form button {
  font-size: 1rem;
  line-height: 1.4;
}

#login-form input::placeholder {
  font-size: 1rem;
}

/* 복사 방지 */
.no-select {
  user-select: none;
  -webkit-user-select: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 워터마크 오버레이 */
.watermark-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background-repeat: repeat;
  background-attachment: fixed;
}

@media (max-width: 1100px) {
  .schedule-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .schedule-calendar {
    width: 100%;
    margin-left: 0;
  }

  .schedule-divider {
    margin-top: 1.4rem;
  }

  .schedule-calendar-selectors {
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .schedule-calendar-selectors {
    gap: 0.55rem;
  }

  .schedule-list-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.8rem 0.9rem;
  }

  .schedule-list-separator {
    display: none;
  }

  .schedule-list.schedule-list-lined .schedule-list-item {
    gap: 0.35rem;
    padding: 0.8rem 0;
  }

  .schedule-list.schedule-list-lined .schedule-list-item.is-time-group-open {
    padding-bottom: 0.65rem;
  }

  .schedule-list.schedule-list-lined
    .schedule-list-item.is-time-group-continuation {
    padding-top: 0.65rem;
  }

  .schedule-days {
    gap: 0.45rem 0.35rem;
  }

  .schedule-day {
    min-height: 3.4rem;
  }

  .schedule-day span {
    width: 2.5rem;
    height: 2.5rem;
  }
}
