:root {
  --sidebar-width: 240px;
  --sidebar-width-collapsed: 64px;
  --topbar-height: 64px;
  --primary: #3b82f6;
}

.admin-schedules-v2 {
  display: flex;
  min-height: 100vh;
  background: #f9fafb;
  width: 100%;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}
.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.sidebar-role .role-badge {
  display: inline-block;
  padding: 3px 10px;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.nav-label {
  transition: opacity 0.3s ease;
  white-space: nowrap;
  font-size: 0.8125rem;
    font-size: 0.8125rem;
}
.nav-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 8px 12px;
}

.sidebar.collapsed 

/* メインコンテンツ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width) !important;
    padding: 24px;
    background: #f9fafb;
    min-width: 0;
    width: calc(100% - var(--sidebar-width)) !important;
    max-width: none !important;
    box-sizing: border-box;
    transition: margin-left 0.3s ease, width 0.3s ease;
  }

.sidebar.collapsed ~ .main-content,
.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-width-collapsed) !important;
    width: calc(100% - var(--sidebar-width-collapsed)) !important;
    max-width: none !important;
  }

/* トップバー */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.topbar-left h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-btn {
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  color: #6b7280;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.topbar-btn:hover {
  background: #f3f4f6;
  border-color: var(--primary);
  color: var(--primary);
}

.content-wrapper {
  /* コンテンツラッパー */
}

/* フィルター */
.filter-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.filter-group label {
  color: #6b7280;
}
.filter-group input,
.filter-group select {
  background: #fff;
  border-color: #e5e7eb;
  color: #111827;
}
.filter-group input:focus,
.filter-group select:focus {
  border-color: var(--primary);
  outline: none;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
}
.filter-group input,
.filter-group select {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.9rem;
}
.filter-group input[type="date"] {
  width: 150px;
}
.filter-group select {
  min-width: 150px;
}

/* テーブル */
.schedule-table-wrapper {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.schedule-table {
  width: 100%;
  border-collapse: collapse;
}
.schedule-table th,
.schedule-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
  color: #111827;
}
.schedule-table th {
  background: #f9fafb;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
}
.schedule-table tbody tr:hover {
  background: #fafafa;
}
.loading-cell {
  text-align: center;
  padding: 40px !important;
  color: #6b7280;
}

/* ステータスバッジ */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-draft { background: #fff3cd; color: #856404; }
.status-scheduled { background: #dbeafe; color: #1d4ed8; }
.status-in_progress { background: #fef3c7; color: #b45309; }
.status-completed { background: #d1fae5; color: #047857; }
.status-cancelled { background: #fee2e2; color: #b91c1c; }

/* 仮押さえアラート */
.draft-alert {
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border: 1px solid #ffc107;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.draft-alert.hidden { display: none; }
.draft-alert-icon {
  width: 48px;
  height: 48px;
  background: #ffc107;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.draft-alert-content {
  flex: 1;
}
.draft-alert-title {
  font-weight: 600;
  color: #856404;
  margin-bottom: 4px;
}
.draft-alert-text {
  font-size: 0.85rem;
  color: #6d5a00;
}
.draft-alert-btn {
  padding: 10px 20px;
  background: #ffc107;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  color: #000;
  cursor: pointer;
  transition: all 0.2s;
}
.draft-alert-btn:hover {
  background: #e0a800;
}

/* 仮押さえ行ハイライト */
.schedule-table tbody tr.draft-row {
  background: #fffde7;
}
.schedule-table tbody tr.draft-row:hover {
  background: #fff9c4;
}

/* 店舗・清掃員情報 */
.store-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.store-name {
  font-weight: 600;
  color: #111827;
}
.store-address {
  font-size: 0.8rem;
  color: #6b7280;
}
.client-name,
.brand-name {
  color: #111827;
  font-size: 0.9rem;
}
.schedule-id {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: #6b7280;
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}
.worker-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.worker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #6b7280;
}
.unassigned {
  color: #9ca3af;
  font-style: italic;
}

/* 操作ボタン */
.action-btns {
  display: flex;
  gap: 8px;
}
.action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.action-btn.edit { background: #dbeafe; color: #1d4ed8; }
.action-btn.edit:hover { background: #bfdbfe; }
.action-btn.delete { background: #fee2e2; color: #b91c1c; }
.action-btn.delete:hover { background: #fecaca; }

/* カレンダー */
.calendar-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}
.calendar-header h2 {
  font-size: 1.25rem;
  margin: 0;
  min-width: 150px;
  text-align: center;
  color: #111827;
}
.btn-icon {
  width: 36px;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon:hover {
  background: #f3f4f6;
  border-color: var(--primary);
  color: var(--primary);
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f9fafb;
  border-radius: 12px 12px 0 0;
  border: 1px solid #e5e7eb;
  border-bottom: none;
}
.calendar-day-header {
  padding: 12px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
}
.calendar-day-header.sun { color: #ef4444; }
.calendar-day-header.sat { color: #3b82f6; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #fff;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-top: none;
}
.calendar-day {
  min-height: 120px;
  padding: 8px;
  border-right: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.15s;
  color: #111827;
}
.calendar-day:hover {
  background: #f9fafb;
}
.calendar-day:nth-child(7n) {
  border-right: none;
}
.calendar-day.empty {
  background: #fafafa;
  cursor: default;
}
.calendar-day.empty:hover {
  background: #fafafa;
}
.calendar-day.today {
  background: #fef3c7;
}
.calendar-day.today:hover {
  background: #fde68a;
}
.calendar-day.sun .day-number { color: #ef4444; }
.calendar-day.sat .day-number { color: #3b82f6; }
.day-number {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #111827;
}
.day-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.day-event {
  font-size: 0.7rem;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity 0.15s;
}
.day-event:hover {
  opacity: 0.85;
}
.day-event.status-draft { background: #f59e0b; }
.day-event.status-scheduled { background: #3b82f6; }
.day-event.status-in_progress { background: #8b5cf6; }
.day-event.status-completed { background: #10b981; }
.day-event.status-cancelled { background: #6b7280; }
.day-event-more {
  font-size: 0.65rem;
  color: #6b7280;
  text-align: center;
  padding: 2px;
}

/* ダイアログ */
.schedule-dialog,
.delete-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 560px;
  width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.schedule-dialog::backdrop,
.delete-dialog::backdrop {
  background: rgba(0,0,0,0.5);
}
.dialog-content {
  padding: 32px;
  position: relative;
}
.dialog-content.dialog-sm {
  text-align: center;
}
.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #6b7280;
  cursor: pointer;
}
.dialog-content h3 {
  font-size: 1.25rem;
  margin: 0 0 24px;
  color: #111827;
}
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-field.half {
  flex: 0 0 calc(50% - 8px);
}
.form-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}
.required {
  color: #ef4444;
}
.form-field input,
.form-field select,
.form-field textarea {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95rem;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 103, 156, 0.1);
}

/* 店舗検索 */
.store-search-wrapper {
  position: relative;
}
.store-search-controls {
  display: flex;
  gap: 8px;
}
.store-category-filter {
  flex: 0 0 120px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
}
.store-search-controls input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95rem;
}
.store-search-controls input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 103, 156, 0.1);
}
.store-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  margin-top: 4px;
}
.store-search-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}
.store-search-item:hover {
  background: #f9fafb;
}
.store-search-item:last-child {
  border-bottom: none;
}
.store-search-item.no-results {
  color: #6b7280;
  cursor: default;
}
.store-search-item.no-results:hover {
  background: #fff;
}
.store-search-item-category {
  font-size: 0.75rem;
  color: #6b7280;
  margin-right: 8px;
  padding: 2px 6px;
  background: #f3f4f6;
  border-radius: 4px;
}

/* 清掃内容検索 */
.cleaning-items-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cleaning-items-search-wrapper {
  position: relative;
}
.cleaning-items-search-wrapper .store-search-controls {
  display: flex;
  gap: 8px;
}
.cleaning-items-search-wrapper input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95rem;
}
.cleaning-items-search-wrapper input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 103, 156, 0.1);
}
.cleaning-items-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  margin-top: 4px;
}
.cleaning-item-result {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}
.cleaning-item-result:hover {
  background: #f9fafb;
}
.cleaning-item-result:last-child {
  border-bottom: none;
}
.cleaning-item-result.no-results {
  color: #6b7280;
  cursor: default;
}
.cleaning-item-result.no-results:hover {
  background: #fff;
}
.cleaning-item-result .store-search-item-category {
  font-size: 0.75rem;
  color: #6b7280;
  margin-right: 8px;
  padding: 2px 6px;
  background: #f3f4f6;
  border-radius: 4px;
}
.cleaning-items-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}
.cleaning-item-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 0.875rem;
}
.cleaning-item-tag-remove {
  cursor: pointer;
  color: #6b7280;
  font-size: 0.75rem;
  padding: 2px;
}
.cleaning-item-tag-remove:hover {
  color: #ef4444;
}

.form-status {
  margin: 16px 0;
  font-size: 0.9rem;
}
.form-status.success { color: #047857; }
.form-status.error { color: #b91c1c; }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ページネーション */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.pagination button {
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}
.pagination button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .filter-row {
    flex-direction: column;
  }
  .filter-group {
    width: 100%;
  }
  .filter-group input,
  .filter-group select {
    width: 100%;
  }
  .form-row {
    flex-direction: column;
  }
  .form-field.half {
    flex: 1;
  }
}

