* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  background: #f5f6f8;
  color: #222;
}

.hidden { display: none !important; }

.topbar {
  background: #2c3e50;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

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

.toolbar input, .toolbar button {
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #d0d5dc;
  background: #fff;
}

.toolbar input[type="text"] { min-width: 220px; }

.toolbar .chk {
  color: #ecf0f1;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

button {
  cursor: pointer;
  font-size: 14px;
}

button.primary {
  background: #3498db;
  color: #fff;
  border-color: #3498db;
}
button.primary:hover { background: #2980b9; }

button.accent {
  background: #8e44ad;
  color: #fff;
  border-color: #8e44ad;
}
button.accent:hover { background: #7d3c98; }

/* 요약 통계 */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
  max-width: 1400px;
  margin: 0 auto;
}
.stat {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat .num {
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
}
.stat .lbl {
  font-size: 13px;
  color: #7f8c8d;
}
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

.main {
  padding: 0 16px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.empty {
  text-align: center;
  color: #95a5a6;
  padding: 60px;
  font-size: 16px;
  background: #fff;
  border-radius: 10px;
  border: 2px dashed #e0e4ea;
}

/* 날짜 그룹 */
.date-group {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
  border-left: 6px solid #bdc3c7;
}
.date-group.today { border-left-color: #3498db; box-shadow: 0 4px 12px rgba(52,152,219,0.15); }
.date-group.past  { opacity: 0.55; }
.date-group.future { border-left-color: #27ae60; }

.date-header {
  padding: 14px 18px;
  background: #f8f9fb;
  border-bottom: 1px solid #ecf0f1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.date-group.today .date-header { background: #ebf5fb; }

.date-title {
  font-size: 17px;
  font-weight: 700;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
}
.date-title .rel {
  background: #ecf0f1;
  color: #5d6d7e;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.date-title .rel.now {
  background: #3498db;
  color: #fff;
}
.date-meta {
  font-size: 13px;
  color: #7f8c8d;
  font-weight: 500;
}

.cards {
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card {
  border: 1px solid #e0e4ea;
  border-left: 4px solid #95a5a6;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.card.status-대기  { border-left-color: #95a5a6; }
.card.status-확정  { border-left-color: #27ae60; background: #f4fbf6; }
.card.status-도착  { border-left-color: #2980b9; background: #eaf2f8; }
.card.status-취소  { border-left-color: #e74c3c; opacity: 0.6; text-decoration: line-through; }
.card.status-노쇼  { border-left-color: #e67e22; background: #fff6ec; }

.card .info { flex: 1; min-width: 0; }
.card .info .line1 {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.card .info .time {
  background: #34495e;
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-family: monospace;
  letter-spacing: 0.5px;
}
.card .info .name { font-size: 16px; }
.card .info .line2 {
  margin-top: 5px;
  font-size: 13px;
  color: #5d6d7e;
}
.phone-link {
  color: #2980b9;
  text-decoration: none;
  font-weight: 500;
}
.phone-link:hover {
  text-decoration: underline;
}

.card .info .memo {
  margin-top: 4px;
  font-size: 12px;
  color: #7f8c8d;
  font-style: italic;
}
.card .badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #ecf0f1;
  color: #34495e;
}
.card .badge.s-확정 { background: #d5f5e3; color: #186a3b; }
.card .badge.s-도착 { background: #d4e6f1; color: #1a5276; }
.card .badge.s-취소 { background: #fadbd8; color: #922b21; }
.card .badge.s-노쇼 { background: #fdebd0; color: #873600; }

/* 도착/노쇼 체크박스 */
.quick-checks {
  margin-top: 8px;
  display: flex;
  gap: 16px;
}
.qchk {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  padding: 3px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.qchk:hover { background: #ecf0f1; }
.qchk input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2980b9;
}
.qchk.noshow input[type="checkbox"] {
  accent-color: #e67e22;
}

.card .buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card .buttons button {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #d0d5dc;
  background: #fff;
}
.card .buttons button:hover { background: #ecf0f1; }

/* 모달 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-content h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-content label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: #5d6d7e;
  gap: 4px;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #d0d5dc;
  font-size: 14px;
  font-family: inherit;
}

.modal-content .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

/* 텍스트 변경 모달 */
.hint {
  font-size: 13px;
  color: #5d6d7e;
  background: #f8f9fb;
  padding: 12px;
  border-radius: 8px;
  margin: 0 0 12px;
  line-height: 1.6;
}
.hint code {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #2c3e50;
}
.hint strong { color: #e74c3c; }

.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-bottom: 2px solid #ecf0f1;
}
.tab {
  padding: 8px 20px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 14px;
  font-weight: 600;
  color: #7f8c8d;
  cursor: pointer;
  transition: all 0.15s;
}
.tab.active {
  color: #2c3e50;
  border-bottom-color: #3498db;
}
.tab:hover { color: #2c3e50; }

.tab-content.hidden { display: none; }

#create-text,
#change-text {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d0d5dc;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}
