.work-planner-page .planner-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.work-planner-page .planner-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--opus-spacing-md);
  padding: 6px 12px;
  background: var(--opus-bg-white);
  border: 2px solid var(--opus-accent);
  border-radius: var(--opus-border-radius);
  box-shadow: var(--opus-shadow-sm);
}

.work-planner-page .planner-header-nav {
  width: 100%;
}

.work-planner-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.work-controls .week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.week-range {
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fdfbf6;
}

.work-priorities {
  border: 1px solid #e2dfd6;
  background: #fdfbf6;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

.section-title {
  margin: 0 0 8px;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #595241;
}

.priority-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.priority-cell {
  min-height: 42px;
  border: 2px solid #d4c7b1;
  background: #ffffff;
  padding: 8px 10px;
  font-family: var(--form-font-family);
  font-size: 0.9rem;
  color: #3f3f3f;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.priority-cell:focus,
.work-slot-entry:focus,
.work-all-day:focus {
  outline: 2px solid #f1c27d;
  outline-offset: 2px;
  background: #fffdf6;
}

.work-grid-card {
  border: 1px solid #e2dfd6;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.05);
}

.work-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.work-grid-title {
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3f3f3f;
}

.work-grid-subtitle {
  font-size: 0.85rem;
  color: #7a7366;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #00326b;
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  background: #00326b;
}

.work-day {
  border-left: 0;
  border-right: 0;
  display: grid;
  grid-template-rows: 72px 96px 1fr auto;
  min-height: 100%;
  overflow: hidden;
  background: #ffffff;
}

.work-day:first-child {
  border-left: 1px solid #00326b;
}

.work-day:not(:last-child) {
  border-right: 1px solid #00326b;
}

.work-day:last-child {
  border-right: 1px solid #00326b;
}

.work-day-header {
  background: #ff9aa1;
  border: 1px solid #00326b;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  box-sizing: border-box;
  color: #0a2f5f;
  text-align: center;
  align-items: center;
}

.work-day-name {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: inherit;
  font-size: 0.78rem;
}

.work-day-date {
  font-size: 0.9rem;
  color: inherit;
}

.work-day:nth-child(1) .work-day-header {
  background: #ff9aa1;
  color: #0a2f5f;
}

.work-day:nth-child(2) .work-day-header {
  background: #f6c27d;
  color: #0a2f5f;
}

.work-day:nth-child(3) .work-day-header {
  background: #a9dce1;
  color: #0a2f5f;
}

.work-day:nth-child(4) .work-day-header {
  background: #3f6f8a;
  color: #fdfbf6;
}

.work-day:nth-child(5) .work-day-header {
  background: #ff8f95;
  color: #0a2f5f;
}

.work-day:nth-child(6) .work-day-header {
  background: #f6c27d;
  color: #0a2f5f;
}

.work-day:nth-child(7) .work-day-header {
  background: #a6d6db;
  color: #0a2f5f;
}

.work-all-day {
  min-height: 44px;
  padding: 10px;
  border: 1px solid #00326b;
  border-top: 0;
  font-family: var(--form-font-family);
  font-size: 0.9rem;
  color: #3f3f3f;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  max-height: none;
}

.work-day-grid {
  display: grid;
  grid-auto-rows: 40px;
  border-top: 1px solid #00326b;
}

.work-slot {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  box-sizing: border-box;
  height: 40px;
  border-bottom: 1px solid #00326b;
  padding: 4px 6px;
  gap: 6px;
  overflow: hidden;
}

.work-slot-time {
  font-size: 10pt;
  color: #6f6658;
  letter-spacing: 0;
  line-height: 1.05;
  flex: 0 0 60px;
  text-align: right;
  padding-top: 2px;
  padding-left: 0;
  white-space: nowrap;
}

.work-slot-entry {
  font-size: 0.8rem;
  color: #3f3f3f;
  border: 1px dashed transparent;
  padding: 2px 6px;
  border-radius: 4px;
  min-height: 20px;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--form-font-family) !important;
  line-height: 1.05;
  max-height: 28px;
  overflow: hidden;
  flex: 1;
}

.work-slot-entry:not(:empty) {
  border-color: #e8e0cf;
  background: #fffcf6;
}

.work-all-day.work-slot-entry {
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.weekly-tasks-row {
  grid-column: 1 / span 7;
  background: #fffdf2;
  border-top: 1px solid #00326b;
  padding: 10px 16px;
  font-family: var(--form-font-family);
}

.weekly-tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px dashed #d86b6b;
  padding-bottom: 4px;
}

.weekly-tasks-title {
  margin: 0;
  font-size: 0.85rem;
  color: #d86b6b;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  border-bottom: none;
}

.weekly-progress-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 200px;
}

.progress-bar-wrap {
  height: 6px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
  flex: 1;
}

.progress-bar-fill {
  height: 100%;
  background: #d86b6b;
  transition: width 0.3s ease;
}

.progress-percent {
  font-size: 0.75rem;
  font-weight: 700;
  color: #d86b6b;
  min-width: 35px;
  text-align: right;
}

.weekly-tasks-list {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 3;
  column-gap: 24px;
}

.weekly-tasks-list li {
  font-size: 0.85rem;
  line-height: 1.4;
  color: #3f3f3f;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
  break-inside: avoid;
}

.weekly-tasks-list li.completed {
  color: #888;
  text-decoration: line-through;
}

.weekly-tasks-list li.completed::before {
  content: "☑";
}

.weekly-tasks-list li::before {
  content: "☐";
  color: #d86b6b;
}

.work-save-hint {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #8b8373;
  text-align: right;
}

.calendar-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 0;
  max-height: 100%;
  overflow: hidden;
  flex: 1;
}

.work-slot .calendar-events:empty {
  display: none;
}

.work-all-day .calendar-events {
  flex: 1;
  justify-content: flex-start;
  gap: 6px;
}

/* Conflict Alert Card */
.conflict-alert-card {
  background: #2c2c2c;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  padding: 16px;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  margin-bottom: 16px;
  max-width: 500px;
}

.conflict-alert-card .accent-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #ff6b6b;
}

.conflict-alert-card .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #99b3c5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  flex-shrink: 0;
}

.conflict-alert-card .content {
  flex-grow: 1;
}

.conflict-alert-card .title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.conflict-alert-card .subtitle {
  color: #a0a0a0;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.conflict-alert-card .datetime {
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.conflict-alert-card .warning {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.conflict-alert-card .warning-icon {
  background: #ff4d4d;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.conflict-alert-card .warning-text {
  font-weight: 700;
  font-size: 0.95rem;
}

.conflict-alert-card .actions {
  display: flex;
  gap: 8px;
}

.conflict-alert-card .btn {
  background: #444;
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.work-all-day .calendar-event {
  flex: 0 0 auto;
  min-height: 18px;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-event {
  font-size: 7pt;
  padding: 1px 4px;
  border-radius: 999px;
  border: 1px solid;
  line-height: 1.05;
  word-wrap: break-word;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  display: inline-block;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.calendar-events.single-event .calendar-event {
  white-space: normal;
  text-overflow: unset;
  overflow: visible;
  display: block;
}

.calendar-event-text {
  display: inline-block;
  line-height: 1.1;
  text-align: center;
}

.calendar-event-text.calendar-event-small {
  font-size: 8pt;
}

@media (max-width: 1100px) {
  .work-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}
