/* tbm.css - TBM 관리 페이지 전용 스타일 */

/* ===== 페이지 레이아웃 ===== */
.tbm-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ===== 페이지 헤더 ===== */
.tbm-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.tbm-title-section {
  flex: 1;
}

.tbm-page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tbm-page-title-icon {
  font-size: 1.5rem;
}

.tbm-page-description {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0;
}

/* ===== 탭 메뉴 ===== */
.tbm-tab-menu {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tbm-tab-btn {
  padding: 0.875rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tbm-tab-btn:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.tbm-tab-btn.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.tbm-tab-icon {
  font-size: 1.125rem;
}

.tbm-tab-badge {
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ===== 탭 컨텐츠 ===== */
.tbm-tab-content {
  display: none;
}

.tbm-tab-content.active {
  display: block;
}

/* ===== 섹션 스타일 ===== */
.tbm-section {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.tbm-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tbm-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tbm-section-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tbm-section-body {
  padding: 1.25rem;
}

/* ===== 통계 바 ===== */
.tbm-stats-bar {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.tbm-stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
}

.tbm-stat-label {
  color: #94a3b8;
}

.tbm-stat-value {
  font-weight: 700;
  color: #1e293b;
  font-size: 1rem;
}

.tbm-stat-value.highlight {
  color: #3b82f6;
}

.tbm-stat-value.success {
  color: #10b981;
}

.tbm-stat-value.warning {
  color: #f59e0b;
}

/* ===== TBM 세션 카드 그리드 ===== */
.tbm-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
}

/* ===== TBM 세션 카드 ===== */
.tbm-session-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
}

.tbm-session-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.tbm-card-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.tbm-card-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.tbm-card-leader {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.tbm-card-leader-role {
  font-size: 0.75rem;
  opacity: 0.85;
  font-weight: 400;
}

.tbm-card-status {
  padding: 0.25rem 0.625rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tbm-card-status.draft {
  background: rgba(254, 243, 199, 0.9);
  color: #92400e;
}

.tbm-card-status.completed {
  background: rgba(220, 252, 231, 0.9);
  color: #166534;
}

.tbm-card-status.cancelled {
  background: rgba(254, 226, 226, 0.9);
  color: #991b1b;
}

.tbm-card-date {
  font-size: 0.8rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.tbm-card-body {
  padding: 1rem 1.25rem;
}

.tbm-card-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.tbm-card-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.tbm-card-info-label {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.tbm-card-info-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
}

.tbm-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

/* ===== 날짜별 그룹 ===== */
.tbm-date-group {
  margin-bottom: 1.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tbm-date-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.tbm-date-header:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.tbm-date-header.today {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-left: 4px solid #3b82f6;
}

.tbm-date-toggle {
  font-size: 0.75rem;
  color: #64748b;
  margin-right: 0.75rem;
  transition: transform 0.2s;
}

.tbm-date-group.collapsed .tbm-date-toggle {
  transform: rotate(-90deg);
}

.tbm-date-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin-right: 0.5rem;
}

.tbm-date-day {
  font-size: 0.875rem;
  color: #64748b;
  padding: 0.25rem 0.5rem;
  background: white;
  border-radius: 4px;
  margin-right: 0.5rem;
}

.tbm-today-badge {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.tbm-date-count {
  margin-left: auto;
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

.tbm-date-content {
  padding: 1rem;
  background: #fafafa;
}

.tbm-date-group.collapsed .tbm-date-content {
  display: none;
}

.tbm-date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

/* ===== 빈 상태 ===== */
.tbm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  color: #64748b;
}

.tbm-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.tbm-empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #475569;
  margin: 0 0 0.5rem 0;
}

.tbm-empty-description {
  font-size: 0.9rem;
  color: #94a3b8;
  margin: 0 0 1.5rem 0;
  max-width: 400px;
}

/* ===== 버튼 스타일 ===== */
.tbm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.tbm-btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.tbm-btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.tbm-btn-secondary {
  background: white;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.tbm-btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.tbm-btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.tbm-btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.tbm-btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.tbm-btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.tbm-btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

.tbm-btn-icon {
  font-size: 1.125rem;
}

/* ===== 모달 스타일 ===== */
.tbm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 1rem;
}

/* 모달 열릴 때 하단 네비게이션 숨기기 */
body.tbm-modal-open .mobile-bottom-nav {
  display: none !important;
}

.tbm-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tbm-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 16px 16px 0 0;
}

.tbm-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tbm-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.tbm-modal-close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.tbm-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.tbm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 0 0 16px 16px;
}

/* ===== 폼 스타일 ===== */
.tbm-form-section {
  margin-bottom: 1.5rem;
}

.tbm-form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tbm-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.tbm-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.tbm-form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}

.tbm-form-required {
  color: #ef4444;
  margin-left: 0.125rem;
}

.tbm-form-input {
  padding: 0.625rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.2s;
  background: white;
}

.tbm-form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.tbm-form-input:disabled,
.tbm-form-input[readonly] {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

.tbm-form-input-readonly {
  background: #f1f5f9;
  padding: 0.625rem 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #475569;
}

/* ===== 작업자 카드 스타일 ===== */
.tbm-worker-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100px;
}

.tbm-worker-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s;
}

.tbm-worker-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tbm-worker-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.tbm-worker-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tbm-worker-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.tbm-worker-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.tbm-worker-role {
  font-size: 0.75rem;
  opacity: 0.85;
}

.tbm-worker-remove {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.tbm-worker-remove:hover {
  background: rgba(239, 68, 68, 0.8);
}

.tbm-worker-card-body {
  padding: 1rem;
}

.tbm-task-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  align-items: end;
}

.tbm-task-add-btn {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tbm-task-add-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

/* ===== 작업자 선택 그리드 ===== */
.tbm-worker-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
}

.tbm-worker-select-card {
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.tbm-worker-select-card:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.tbm-worker-select-card.selected {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.tbm-worker-select-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: transparent;
  transition: all 0.2s;
}

.tbm-worker-select-card.selected .tbm-worker-select-check {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.tbm-worker-select-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.tbm-worker-select-role {
  font-size: 0.75rem;
  color: #64748b;
}

/* ===== 선택 버튼 스타일 ===== */
.tbm-select-btn {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  text-align: left;
  font-size: 0.875rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tbm-select-btn:hover:not(:disabled) {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.tbm-select-btn:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
}

.tbm-select-btn.selected {
  color: #1e293b;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.tbm-select-arrow {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ===== 안전 체크리스트 ===== */
.tbm-safety-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tbm-safety-category {
  background: #f8fafc;
  border-radius: 10px;
  padding: 1rem;
}

.tbm-safety-category-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.tbm-safety-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tbm-safety-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s;
}

.tbm-safety-item:hover {
  border-color: #3b82f6;
}

.tbm-safety-item.checked {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #22c55e;
}

.tbm-safety-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}

.tbm-safety-item.checked .tbm-safety-checkbox {
  background: #22c55e;
  border-color: #22c55e;
  color: white;
}

.tbm-safety-text {
  flex: 1;
  font-size: 0.875rem;
  color: #374151;
}

.tbm-safety-required {
  font-size: 0.7rem;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
}

/* ===== 항목 선택 리스트 ===== */
.tbm-item-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.tbm-item-option {
  padding: 0.875rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.tbm-item-option:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.tbm-item-option.selected {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.tbm-item-name {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.125rem;
}

.tbm-item-desc {
  font-size: 0.8125rem;
  color: #64748b;
}

/* ===== 알림 박스 ===== */
.tbm-alert {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.tbm-alert-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tbm-alert-content {
  flex: 1;
}

.tbm-alert-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.tbm-alert-text {
  font-size: 0.875rem;
}

.tbm-alert-info {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 1px solid #3b82f6;
}

.tbm-alert-info .tbm-alert-title {
  color: #1e40af;
}

.tbm-alert-info .tbm-alert-text {
  color: #1e40af;
}

.tbm-alert-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
}

.tbm-alert-warning .tbm-alert-title {
  color: #92400e;
}

.tbm-alert-warning .tbm-alert-text {
  color: #92400e;
}

/* ===== 태스크 그리드 ===== */
.tbm-task-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

/* ===== 반응형 ===== */
@media (max-width: 768px) {
  .tbm-container {
    padding: 1rem;
  }

  .tbm-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .tbm-tab-menu {
    gap: 0;
  }

  .tbm-tab-btn {
    flex: 1;
    justify-content: center;
    padding: 0.75rem;
    font-size: 0.8125rem;
  }

  .tbm-card-grid,
  .tbm-date-grid {
    grid-template-columns: 1fr;
  }

  .tbm-task-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

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

  .tbm-worker-select-grid {
    grid-template-columns: repeat(2, 1fr);
    max-height: 50vh;
  }

  /* 모달 → 풀스크린 시트 */
  .tbm-modal-overlay {
    padding: 0;
  }

  .tbm-modal {
    max-width: 100% !important;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    overflow: hidden;
    animation: mobileSlideUp 0.25s ease-out;
  }

  .tbm-modal-header {
    flex-shrink: 0;
    border-radius: 0;
  }

  .tbm-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 1rem;
  }

  .tbm-modal-footer {
    flex-shrink: 0;
    border-radius: 0;
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
  }

  .tbm-modal-footer .tbm-btn {
    flex: 1;
    justify-content: center;
  }

  /* 버튼 최소 터치 영역 44px */
  .tbm-btn { min-height: 44px; }
  .tbm-btn-sm { min-height: 40px; padding: 0.5rem 1rem; }

  /* 셀렉트 버튼 확대 */
  .tbm-select-btn {
    min-height: 48px;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
  }

  /* 작업자 카드 터치 영역 */
  .tbm-worker-select-card { padding: 1rem; }

  /* 안전 체크 항목 */
  .tbm-safety-item { padding: 0.875rem; min-height: 48px; }

  /* 항목 선택 리스트 */
  .tbm-item-option { padding: 1rem; min-height: 48px; }
  .tbm-item-list { max-height: 60vh; }

  /* 삭제 버튼 확대 (28px → 36px) */
  .tbm-worker-remove { width: 36px; height: 36px; font-size: 1.25rem; }

  /* 세션 카드 액션 버튼 */
  .tbm-card-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }
  .tbm-card-footer .tbm-btn {
    flex: 1;
    min-width: 0;
    justify-content: center;
  }

  /* 터치 피드백 */
  .tbm-btn:active,
  .tbm-select-btn:active,
  .tbm-worker-select-card:active,
  .tbm-safety-item:active,
  .tbm-item-option:active,
  .tbm-session-card:active {
    transform: scale(0.97);
    opacity: 0.85;
    transition: transform 0.1s, opacity 0.1s;
  }

  /* 탭 하이라이트 제거 */
  .tbm-btn, .tbm-select-btn, .tbm-worker-select-card,
  .tbm-safety-item, .tbm-item-option, .tbm-session-card,
  .tbm-tab-btn, .tbm-modal-close {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

@keyframes mobileSlideUp {
  from { transform: translateY(30%); opacity: 0.5; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 480px) {
  .tbm-page-title {
    font-size: 1.375rem;
  }

  .tbm-worker-select-grid {
    grid-template-columns: 1fr;
  }

  .tbm-task-grid {
    grid-template-columns: 1fr;
    gap: 0.375rem;
  }

  .tbm-section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .tbm-section-actions {
    justify-content: flex-end;
  }

  .tbm-stats-bar {
    flex-direction: column;
    gap: 0.5rem;
  }

  .tbm-stat-item {
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f1f5f9;
  }

  .tbm-stat-item:last-child {
    border-bottom: none;
  }
}

/* ===== 가로모드 전체화면 지도 오버레이 ===== */
.landscape-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
}

.landscape-inner {
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

/* 세로모드(portrait)일 때 CSS 회전으로 가로 효과 */
.landscape-inner.rotated {
  width: 100vh;
  height: 100vw;
  transform: translate(-50%, -50%) rotate(90deg);
  position: absolute;
  top: 50%;
  left: 50%;
}

/* 물리적 가로모드일 때 회전 없이 전체화면 */
.landscape-inner.no-rotate {
  width: 100vw;
  height: 100vh;
}

.landscape-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  flex-shrink: 0;
}

.landscape-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.landscape-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.landscape-canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f1f5f9;
  padding: 0.5rem;
}

.landscape-canvas-wrap canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* 전체화면 지도 트리거 버튼 (모바일만) */
.landscape-trigger-btn {
  display: none;
}

@media (max-width: 768px) {
  .landscape-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    -webkit-tap-highlight-color: transparent;
  }
  .landscape-trigger-btn:active {
    transform: scale(0.97);
    opacity: 0.85;
  }
}

/* ===== 작업장 선택 지도 ===== */
.tbm-workplace-map-container {
  text-align: center;
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 0 auto;
}

.tbm-workplace-map-container canvas {
  max-width: 100%;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===== 토스트 ===== */
.tbm-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tbm-toast {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: #1e293b;
  color: white;
  font-size: 0.875rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: toastSlideIn 0.3s ease-out;
}

.tbm-toast.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.tbm-toast.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.tbm-toast.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
