:root {
  --ink: #18202b;
  --muted: #667280;
  --subtle: #8a96a3;
  --line: #d9e0e8;
  --soft-line: #edf1f5;
  --paper: #f3f6f9;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --accent: #0b5cab;
  --accent-soft: #eaf2fb;
  --orange: #e87516;
  --red: #c83f3f;
  --amber: #c88418;
  --green: #1d7650;
  --violet: #6554c0;
  --teal: #0f7d80;
  --shadow: 0 8px 24px rgba(24, 32, 43, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a { color: inherit; text-decoration: none; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand img { display: block; width: min(258px, 58vw); height: auto; }
.header-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.header-meta span { padding: 6px 9px; border: 1px solid #b7d7c6; border-radius: 6px; background: #eef8f3; color: var(--green); font-weight: 900; }
.header-meta strong { color: var(--ink); font-size: 15px; }
.logout { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-soft); font-weight: 900; }
.logout:hover { border-color: #b8c4d0; background: #eef2f6; }

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.tabs a {
  min-width: max-content;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.tabs a:hover { border-color: var(--line); background: var(--panel-soft); color: var(--ink); }
.tabs a.active { border-color: #2b445f; background: #223246; color: #fff; box-shadow: 0 3px 10px rgba(24, 32, 43, 0.14); }

.workspace { padding: 24px clamp(18px, 4vw, 48px) 34px; }

.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.summary article, .panel, .auth-card { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
.summary article { min-height: 108px; padding: 16px; }
.summary span, .summary small, .panel-header p, .task span, .task small, .check-list span, .muted { color: var(--muted); }
.summary span { display: block; font-size: 12px; font-weight: 900; }
.summary strong { display: block; margin-top: 9px; font-size: 30px; line-height: 1; letter-spacing: 0; }
.summary small { display: block; margin-top: 10px; font-size: 12px; }

.schedule-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 18px; }
.panel { min-width: 0; overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--soft-line); background: #fff; }
.panel-header.compact { padding-bottom: 14px; }
.panel-header p { margin: 0 0 5px; font-size: 12px; font-weight: 900; }
.panel-header h1, .panel-header h2 { margin: 0; letter-spacing: 0; }
.panel-header h1 { font-size: 28px; }
.panel-header h2 { font-size: 21px; }

.date-chip, .month-nav a {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: #344052;
  font-size: 13px;
  font-weight: 900;
}
.date-chip { padding: 8px 11px; }
.month-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.month-nav a { padding: 8px 10px; }
.month-nav a:hover { border-color: #aebbc8; background: #eef3f8; }

.filter-section { margin: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.filter-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.filter-heading span { color: var(--accent); font-size: 12px; font-weight: 900; }
.filter-heading strong { color: var(--muted); font-size: 12px; font-weight: 800; }
.schedule-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.schedule-tabs a { min-width: max-content; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #344052; font-size: 12px; font-weight: 900; }
.schedule-tabs a:hover { border-color: #aebbc8; background: #f0f4f8; }
.schedule-tabs a.active { border-color: var(--accent); background: var(--accent); color: #fff; }

.weekday-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--soft-line); border-bottom: 1px solid var(--line); background: #f9fbfd; }
.weekday-row div { padding: 10px 8px; color: var(--muted); font-size: 12px; font-weight: 900; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--soft-line); gap: 1px; }
.calendar-day { height: 136px; overflow: hidden; padding: 9px; background: #fff; }
.calendar-day.muted-day { background: #f7f9fb; color: #a0a8b2; }
.calendar-day.sunday .day-number, .calendar-day.holiday .day-number { color: var(--red); }
.calendar-day.saturday:not(.holiday) .day-number { color: #2563eb; }
.calendar-day.holiday { background: #fff8f8; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.calendar-day.selected { background: #fff8ec; box-shadow: inset 0 0 0 2px var(--orange); }
.calendar-day.detail-selected { outline: 3px solid rgba(232, 117, 22, 0.24); outline-offset: -5px; }
.day-number { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; margin-bottom: 7px; border-radius: 5px; font-size: 13px; font-weight: 900; }
.day-number:hover { background: var(--ink); color: #fff; }
.holiday-name { margin: -3px 0 7px; color: var(--red); font-size: 11px; font-weight: 900; line-height: 1.25; }

.calendar-event { margin-bottom: 6px; padding: 7px 8px; border-left: 3px solid var(--accent); border-radius: 5px; background: var(--accent-soft); color: #263342; }
.calendar-event.is-edited { outline: 2px solid rgba(200, 63, 63, 0.22); }
.calendar-event.is-complete { opacity: 0.72; }
.calendar-event strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.calendar-event span { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.badge { display: inline-block; margin: 6px 4px 0 0; padding: 2px 5px; border-radius: 4px; font-size: 10px; font-style: normal; font-weight: 900; }
.badge.edited { background: #fff0d7; color: #965500; }
.badge.complete { background: #e6f6ee; color: var(--green); }

.event-edit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; margin-top: 7px; }
.event-edit input { min-height: 28px; padding: 4px 5px; font-size: 11px; }
.event-edit button { min-height: 28px; padding: 0 7px; font-size: 11px; }
.detail-edit { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }
.detail-edit input { min-height: 36px; padding: 8px; font-size: 13px; }
.detail-edit button { min-height: 36px; padding: 0 10px; font-size: 12px; }

.calendar-event.customer-doosung { border-left-color: var(--accent); background: #eef5ff; }
.calendar-event.customer-siflex { border-left-color: var(--orange); background: #fff5e9; }
.calendar-event.customer-union { border-left-color: var(--green); background: #eef8f2; }
.calendar-event.customer-cutech { border-left-color: var(--violet); background: #f3f1ff; }
.calendar-event.customer-hksj { border-left-color: var(--red); background: #fff2f2; }
.calendar-event.customer-chemtronics { border-left-color: var(--teal); background: #eaf8f8; }
.calendar-event.customer-other { border-left-color: #7c5f35; background: #f7f0e7; }
.more-events { display: inline-block; margin-top: 2px; color: var(--accent); font-size: 11px; font-weight: 900; }

.day-detail { margin: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.day-detail-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--soft-line); background: var(--panel-soft); }
.day-detail-heading span { color: var(--accent); font-size: 12px; font-weight: 900; }
.day-detail-heading strong { font-size: 15px; }
.day-detail-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; padding: 14px; }
.detail-event { padding: 12px; border: 1px solid var(--line); border-left: 4px solid #8b97a6; border-radius: 6px; background: #fff; }
.detail-event strong, .detail-event span { display: block; }
.detail-event strong { font-size: 14px; }
.detail-event span, .detail-event p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.detail-event p { margin: 8px 0 0; }
.detail-event.customer-doosung { border-left-color: var(--accent); }
.detail-event.customer-siflex { border-left-color: var(--orange); }
.detail-event.customer-union { border-left-color: var(--green); }
.detail-event.customer-cutech { border-left-color: var(--violet); }
.detail-event.customer-hksj { border-left-color: var(--red); }
.detail-event.customer-chemtronics { border-left-color: var(--teal); }
.detail-event.customer-other { border-left-color: #7c5f35; }

.schedule-form { display: grid; gap: 12px; padding: 18px; }
.form-grid, .offset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.customer-picker, .quantity-picker { display: grid; gap: 8px; }
.customer-picker > span, .quantity-picker > span { font-size: 13px; font-weight: 900; color: #344052; }
.customer-tabs, .quantity-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.customer-tab, .quantity-tab { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #344052; font-size: 12px; font-weight: 900; }
.customer-tab:hover, .quantity-tab:hover { border-color: #aebbc8; background: #f0f4f8; }
.customer-tab.active, .quantity-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.customer-tab.direct.active, .quantity-tab.direct.active { background: #223246; border-color: #223246; }
.customer-picker input[readonly], .quantity-picker input[readonly] { background: #f7f9fb; color: #1f2937; font-weight: 800; }
.form-help, .no-write span { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.no-write { display: grid; gap: 8px; padding: 18px; }
.no-write strong { font-size: 14px; }

.board { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding: 18px; }
.lane { min-height: 420px; padding: 14px; border: 1px solid var(--soft-line); border-radius: 8px; background: var(--panel-soft); }
.lane h2 { margin: 0 0 14px; font-size: 16px; }
.task { margin-bottom: 10px; padding: 14px; border: 1px solid var(--line); border-left: 4px solid #8b97a6; border-radius: 6px; background: #fff; }
.task strong, .task span, .task small { display: block; }
.task strong { font-size: 14px; line-height: 1.35; }
.task span { margin-top: 8px; font-size: 12px; line-height: 1.45; }
.task small { margin-top: 12px; font-size: 12px; font-weight: 900; }
.task.priority-danger { border-left-color: var(--red); }
.task.priority-warn { border-left-color: var(--amber); }
.task.priority-high { border-left-color: var(--orange); }
.task.done { border-left-color: var(--green); }
.side-panel { align-self: start; }
.check-list { list-style: none; margin: 0; padding: 6px 18px 18px; }
.check-list li { padding: 16px 0; border-bottom: 1px solid var(--soft-line); }
.check-list li:last-child { border-bottom: 0; }
.check-list strong, .check-list span { display: block; }
.check-list strong { font-size: 14px; }
.check-list span { margin-top: 6px; font-size: 12px; }

.auth-page { display: grid; place-items: start center; min-height: calc(100vh - 120px); padding: 44px 18px; }
.auth-card { width: min(100%, 460px); padding: 28px; }
.auth-card h1 { margin: 0; font-size: 30px; }
.auth-card form { display: grid; gap: 14px; margin-top: 22px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 900; color: #344052; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
}
textarea { resize: none; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(11, 92, 171, 0.16); border-color: var(--accent); }
input[type="file"] { padding: 9px; background: var(--panel-soft); }
.memo-field { height: 88px; min-height: 88px; max-height: 88px; resize: none; }
button { min-height: 39px; border: 0; border-radius: 6px; padding: 0 14px; background: #223246; color: #fff; font-weight: 900; cursor: pointer; }
button:hover { background: #162538; }
button.secondary { background: #6b7280; }
button.secondary:hover { background: #535b66; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 0 14px; border-radius: 6px; background: #223246; color: #fff; font-weight: 900; }
.button-link.secondary { background: #6b7280; }
.auth-link { margin: 18px 0 0; font-size: 13px; }
.auth-link a { color: var(--accent); font-weight: 900; }
.alert { padding: 11px 12px; border: 1px solid #f0b9b9; border-radius: 6px; background: #fff4f4; color: #9f2727; font-size: 13px; font-weight: 900; }
.alert.success { border-color: #b9d9c8; background: #eef8f2; color: var(--green); }
.empty-panel { min-height: 260px; }
.empty-text { padding: 22px; color: var(--muted); }

.suggestion-panel { max-width: 780px; }
.suggestion-intro { display: grid; gap: 6px; margin: 18px; padding: 16px; border: 1px solid #f0d4a8; border-radius: 8px; background: #fff8ec; }
.suggestion-intro strong { color: #8a4b00; font-size: 16px; }
.suggestion-intro span { color: #6b7280; font-size: 13px; font-weight: 800; }
.suggestion-form { display: grid; gap: 14px; padding: 0 18px 18px; }
.suggestion-list { margin-top: 18px; }
.upload-panel { max-width: 760px; }
.upload-form { display: grid; gap: 14px; padding: 18px; }
.upload-list { margin-top: 18px; }
.table-link { color: var(--accent); font-weight: 900; text-decoration: underline; text-underline-offset: 2px; }
.table-wrap { overflow-x: auto; padding: 18px; }
.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--soft-line); padding: 12px; text-align: left; vertical-align: top; }
.admin-table th { background: var(--panel-soft); color: #344052; font-size: 12px; font-weight: 900; }
.admin-table tr:hover td { background: #fbfcfe; }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form select { min-width: 130px; }
.admin-user-form { flex-wrap: wrap; min-width: 420px; }

.completion-warning { display: block; margin-top: 6px; color: #9f2727; font-size: 12px; font-weight: 900; }
.confirm-panel { max-width: 720px; }
.confirm-body { display: grid; gap: 16px; padding: 18px; }
.confirm-body dl { display: grid; gap: 8px; margin: 0; }
.confirm-body div, .profile-summary div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 11px; border: 1px solid var(--soft-line); border-radius: 6px; background: var(--panel-soft); }
.confirm-body dt, .profile-summary dt { color: var(--muted); font-size: 12px; font-weight: 900; }
.confirm-body dd, .profile-summary dd { margin: 0; font-size: 14px; font-weight: 900; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 560px); gap: 18px; align-items: start; }
.profile-panel { align-self: start; }
.profile-summary { padding: 18px; }
.profile-summary dl { display: grid; gap: 10px; margin: 0 0 14px; }
.site-footer { padding: 18px clamp(18px, 4vw, 48px); border-top: 1px solid #202a36; background: #111821; color: #a8b1bb; font-size: 12px; text-align: right; }

@media (max-width: 980px) {
  .summary, .schedule-layout, .calendar-layout, .profile-layout { grid-template-columns: 1fr; }
  .side-panel { order: -1; }
}

@media (max-width: 680px) {
  .site-header, .header-meta { align-items: flex-start; flex-direction: column; }
  .panel-header { align-items: flex-start; flex-direction: column; }
  .calendar-grid, .weekday-row { grid-template-columns: repeat(7, minmax(128px, 1fr)); min-width: 896px; }
  .calendar-panel { overflow-x: auto; }
  .board { grid-template-columns: repeat(4, 230px); }
  .form-grid, .offset-grid { grid-template-columns: 1fr; }
  .admin-user-form { min-width: 0; }
}
