* { font-family: 'Noto Sans KR', sans-serif; }
.loading { opacity: 0.6; pointer-events: none; }
.fade-in { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.btn-primary:hover { background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%); }
.card { background: white; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
input:focus, select:focus, textarea:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
  outline: none;
}

/* Toast */
.toast {
  position: fixed; bottom: 20px; right: 20px; padding: 16px 24px;
  border-radius: 12px; color: white; font-weight: 500;
  transform: translateY(100px); opacity: 0; transition: all 0.3s ease;
  z-index: 1000;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.toast.error { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }

/* Tabs */
.tab-btn.active { background: #667eea !important; color: white !important; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.modal-overlay.hidden { display: none; }
.modal-overlay.show { display: flex; }
.modal-content {
  background: white; border-radius: 12px; max-width: 900px; width: 95%;
  max-height: 90vh; overflow-y: auto;
}

/* Modal Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px 12px 0 0;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin: 0;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover {
  background: rgba(255,255,255,0.3);
}

/* Modal Body */
.modal-body {
  padding: 20px;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
}

/* Modal Buttons */
.btn-cancel {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-cancel:hover {
  background: #f3f4f6;
}
.btn-save {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-save:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Tags */
.tag-container { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border: 1px solid #e5e7eb; border-radius: 8px; min-height: 50px; background: #f9fafb; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 16px; font-size: 13px; font-weight: 500; }
.tag-remove { cursor: pointer; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.3); font-size: 11px; }
.tag-remove:hover { background: rgba(255,255,255,0.5); }

/* Data Table */
.data-table { width: 100%; font-size: 13px; border-collapse: collapse; border: 1px solid #e2e8f0; }
.data-table th { padding: 10px 8px; background: #f8fafc; font-weight: 600; color: #475569; text-align: center; white-space: nowrap; border: 1px solid #e2e8f0; }
.data-table td { padding: 10px 8px; border: 1px solid #e2e8f0; vertical-align: middle; text-align: center; }
.data-table tr:hover { background: #f8fafc; }

/* Input */
.input-compact { padding: 8px 12px; font-size: 14px; border: 1px solid #e5e7eb; border-radius: 6px; }
.header-compact { padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }

/* Stat Card */
.stat-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #1e293b; }
.stat-card .stat-label { font-size: 13px; color: #64748b; }

/* Sub Tab */
.sub-tab-btn { padding: 10px 20px; font-weight: 600; border-bottom: 3px solid transparent; transition: all 0.2s; color: #64748b; background: none; border: none; cursor: pointer; }
.sub-tab-btn:hover { color: #667eea; }
.sub-tab-btn.active { color: #667eea; border-bottom-color: #667eea; }

/* 고정 헤더 */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Summary Bar */
.summary-bar { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 8px; padding: 12px 20px; margin-bottom: 16px; }
.summary-bar .summary-item { display: flex; align-items: center; gap: 8px; }
.summary-bar .summary-value { font-size: 20px; font-weight: 700; }
.summary-bar .summary-label { font-size: 12px; opacity: 0.9; }

/* 관리 버튼 컨테이너 */
.action-buttons {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}
.action-buttons button {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.action-buttons .edit-btn {
  color: #2563eb;
  background: #eff6ff;
}
.action-buttons .edit-btn:hover {
  background: #dbeafe;
}
.action-buttons .delete-btn {
  color: #dc2626;
  background: #fef2f2;
}
.action-buttons .delete-btn:hover {
  background: #fee2e2;
}

/* 일정 조회 스타일 */
.schedule-event-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.schedule-event-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.schedule-event-header .event-name {
  font-size: 16px;
}
.schedule-event-header .event-summary {
  font-size: 13px;
  opacity: 0.9;
}
.schedule-group-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e5e7eb;
}
.schedule-group-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  border: 1px solid #e5e7eb;
}
.schedule-group-table td {
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #e5e7eb;
  vertical-align: middle;
  text-align: center;
}
.schedule-group-table tr:hover {
  background: #f8fafc;
}

/* Status Badge */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.status-badge.status-waiting { background: #fef3c7; color: #92400e; }
.status-badge.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-badge.status-completed { background: #d1fae5; color: #065f46; }
.status-badge.status-cancelled { background: #fee2e2; color: #991b1b; }

/* Settings Content */
.settings-content.hidden { display: none; }

/* SMS History Item */
.sms-history-item {
  background: #f9fafb;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #e5e7eb;
}
.sms-history-item .sms-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sms-history-item .sms-to {
  font-weight: 600;
  color: #374151;
}
.sms-history-item .sms-date {
  font-size: 12px;
  color: #6b7280;
}
.sms-history-item .sms-content {
  font-size: 13px;
  color: #4b5563;
  white-space: pre-wrap;
}
.sms-history-item .sms-status {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #d1fae5;
  color: #065f46;
}

/* Contact Search Results */
#sms-contact-results .item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
#sms-contact-results .item:hover {
  background: #f3f4f6;
}
#sms-contact-results .item .org {
  font-weight: 500;
  color: #374151;
}
#sms-contact-results .item .contact {
  font-size: 12px;
  color: #6b7280;
}

/* Pagination */
#pagination button {
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
#pagination button:hover:not(:disabled) {
  background: #f3f4f6;
}
#pagination button.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}
#pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Number Input Wrapper */
.number-input-wrapper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: visible;
  background: white;
  width: 120px;
  max-width: 120px;
}
.number-input-wrapper .number-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: none;
  background: #f3f4f6;
  color: #374151;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.number-input-wrapper .number-btn:hover {
  background: #e5e7eb;
}
.number-input-wrapper .number-display {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  border: none;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  -moz-appearance: textfield;
  padding: 8px 0;
  flex-shrink: 0;
}
.number-input-wrapper .number-display::-webkit-outer-spin-button,
.number-input-wrapper .number-display::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.loading-overlay.hidden { display: none; }
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #fff;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-text {
  color: white;
  font-size: 16px;
  font-weight: 500;
  margin-top: 16px;
}
.loading-progress {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  margin-top: 8px;
}

/* Toast improvements */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 12px;
  color: white;
  font-weight: 500;
  z-index: 10000;
  animation: slideInUp 0.3s ease-out;
}
@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Schedule group styling */
.schedule-group {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.schedule-group-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.schedule-group-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.schedule-group-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
}
.schedule-group table {
  width: 100%;
  border-collapse: collapse;
}
.schedule-group th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  border: 1px solid #e5e7eb;
}
.schedule-group td {
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #e5e7eb;
  text-align: center;
}
.schedule-group tr:hover {
  background: #f8fafc;
}

/* Empty message */
.empty-message {
  text-align: center;
  padding: 24px;
  color: #9ca3af;
}
