/* 상시업무 상세 — detail-theme 와 동일 ref-hub 팔레트 */

.routine-detail {
  --rd-header-bg: linear-gradient(180deg, #37a184 0%, #29724f 20%, #07412e 100%);
  --rd-emerald-deep: #1e3a5f;
  --rd-bg-page: #f2f5f9;
  --rd-bg-card: #ffffff;
  --rd-bg-card-hover: #f8fafc;
  --rd-bg-stage-selected: #f5faff;
  --rd-border-card: #e8edf2;
  --rd-border-selected: #4a90d9;
  --rd-text-main: #1e3a5f;
  --rd-text-muted: #64748b;

  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--rd-bg-page);
  color: var(--rd-text-main);
  font-family: "Pretendard Variable", Pretendard, -apple-system, sans-serif;
}

.routine-detail__header {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  height: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: var(--rd-header-bg);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.routine-detail__header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 45%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.routine-detail__tabs {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
}

.routine-detail__tab {
  flex-shrink: 0;
  padding: 6px 16px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
}

.routine-detail__tab:hover {
  background: rgba(255, 255, 255, 0.2);
}

.routine-detail__tab.is-active {
  background: var(--rd-bg-card);
  color: var(--rd-emerald-deep);
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.routine-detail__tab.is-empty {
  opacity: 0.45;
  cursor: default;
}

.routine-detail__meta {
  position: relative;
  z-index: 1;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  flex-shrink: 0;
}

.routine-detail__meta-item {
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.routine-detail__meta-item strong {
  color: #fff;
  font-weight: 700;
}

.routine-detail__meta-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.25);
}

.routine-detail__status {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.routine-detail__main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 3fr;
  grid-template-rows: 1fr;
}

.routine-detail__aside {
  display: grid;
  grid-template-rows: 2fr 1fr;
  background: var(--rd-bg-card);
  border-right: 1px solid var(--rd-border-card);
  min-height: 0;
  overflow: hidden;
}

.routine-detail__section {
  display: flex;
  flex-direction: column;
  padding: 16px;
  min-height: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--rd-border-card);
}

.routine-detail__section:last-child {
  border-bottom: none;
}

.routine-detail__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.routine-detail__section-label {
  font-size: 18px;
  font-weight: 900;
  color: var(--rd-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.routine-detail__add-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: #4a90d9;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.routine-detail__add-btn:hover {
  background: #2563ab;
}

.routine-detail__stage-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.routine-detail__stage-card {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--rd-border-card);
  background: var(--rd-bg-card-hover);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.routine-detail__stage-card:hover {
  border-color: #cbd5e1;
  background: var(--rd-bg-card);
}

.routine-detail__stage-card.is-selected {
  border-color: var(--rd-border-selected);
  background: var(--rd-bg-stage-selected);
  box-shadow: 0 0 0 1px var(--rd-border-selected);
}

.routine-detail__stage-title {
  font-size: 24px;
  font-weight: 400;
  color: #1e293b;
  line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.routine-detail__stage-card.is-selected .routine-detail__stage-title {
  color: var(--rd-emerald-deep);
  font-weight: 500;
}

.routine-detail__stage-overview {
  font-size: 20px;
  font-weight: 400;
  color: var(--rd-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.routine-detail__content-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  margin: 0;
}

.routine-detail__content-item {
  display: flex;
  gap: 8px;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
  color: #334155;
}

.routine-detail__content-bullet {
  color: #4a90d9;
  font-weight: 700;
  flex-shrink: 0;
}

.routine-detail__content-text {
  flex: 1;
  word-break: break-word;
}

.routine-detail__empty {
  font-size: 16px;
  color: var(--rd-text-muted);
  font-style: italic;
}

.routine-detail__panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  min-height: 0;
}

.routine-detail__preview {
  flex: 1;
  min-height: 0;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #f1f5f9;
}

.routine-detail__preview-title {
  font-size: 16px;
  font-weight: 800;
  color: #475569;
  margin: 0 0 4px;
}

.routine-detail__results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.routine-detail__result-card {
  background: var(--rd-bg-card);
  border: 1px solid var(--rd-border-card);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--rd-text-main);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
}

.routine-detail__result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.routine-detail__result-icon {
  font-size: 36px;
  margin-bottom: 10px;
  line-height: 1;
}

.routine-detail__result-name {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  word-break: break-all;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.3;
}

.routine-detail .grid {
  background: var(--rd-bg-page);
}

.routine-detail__panel .milestone-timeline {
  flex-shrink: 0;
}

.routine-detail__panel .milestone-timeline--gantt,
.routine-detail__panel .milestone-timeline--portfolio,
.detail-panel--gantt .milestone-timeline--gantt,
.detail-panel--portfolio .milestone-timeline--portfolio {
  flex: 1;
  min-height: 0;
  flex-shrink: 1;
}
