/* Teacher leave: timetable overlay (screen only) and 학원 운영 › 휴가 일정 */
:root {
  --leave-ink: var(--jj-gray-700);
  --leave-bg: var(--jj-gray-150);
  --leave-tag: var(--jj-gray-600);
  --substitute: #7a4bd8;
  --substitute-bg: #f4efff;
}

/* Timetable cards. The leave line replaces the meta line to keep card height. */
.class-card.on-leave,
.master-table td.has-tint .class-card.on-leave {
  background: repeating-linear-gradient(
    135deg,
    var(--jj-gray-100) 0 6px,
    var(--jj-gray-150) 6px 12px
  );
  border-color: var(--jj-gray-300);
  border-left-color: var(--jj-gray-400);
}
.class-card.on-leave .class-open strong,
.class-card.on-leave .student-chips {
  opacity: 0.55;
}
.class-card.has-substitute,
.master-table td.has-tint .class-card.has-substitute {
  border-left-color: var(--substitute);
  background: var(--jj-gray-50);
}
.class-card.on-leave .class-meta,
.class-card.has-substitute .class-meta {
  display: none;
}
.leave-line {
  /* Keep clear of the round "학생 추가" button at the card's right edge. */
  padding-right: 28px;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 19px;
  margin: 2px 0 4px;
  font-size: 11px;
  line-height: 1;
  color: var(--leave-ink);
  white-space: nowrap;
}
.leave-line small {
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leave-who {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leave-tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--leave-tag);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.substitute-tag {
  background: var(--substitute);
}
.leave-line.is-substitute .leave-who {
  color: var(--substitute);
}
.leave-action {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 19px;
  min-height: 19px;
  margin-left: auto;
  padding: 0 6px;
  border: 1px solid var(--jj-gray-300);
  border-radius: var(--jj-radius-xs);
  background: #fff;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}
.leave-line.is-substitute .leave-action {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 2px;
}
.leave-action svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
}
.leave-action:hover {
  border-color: var(--accent);
  background: var(--jj-primary-50);
}
.ms-class.on-leave {
  background: repeating-linear-gradient(
    135deg,
    var(--jj-gray-100) 0 6px,
    var(--jj-gray-150) 6px 12px
  );
  border-left-color: var(--jj-gray-400);
}
.ms-class.on-leave strong {
  opacity: 0.6;
}
.ms-class.has-substitute {
  border-left-color: var(--substitute);
}
.ms-leave-tag {
  align-self: flex-start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.teacher-leave-mark {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--leave-bg);
  color: var(--leave-ink);
  font-size: 10px;
  font-weight: 700;
  vertical-align: 1px;
  white-space: nowrap;
}
.leave-warning {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: 0 0 10px;
  padding: 7px 10px;
  border-radius: var(--jj-radius-control);
  background: var(--jj-warning-bg);
  color: var(--jj-warning-fg);
  font-size: 12px;
}
.leave-warning svg {
  width: 15px;
  height: 15px;
  flex: none;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
.leave-dialog-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 4px;
  padding: 9px 11px;
  border-radius: var(--jj-radius-control);
  background: var(--jj-gray-50);
  font-size: 13px;
}
.leave-dialog-context > span:first-of-type {
  color: var(--muted);
}
.leave-dialog-context small {
  color: var(--muted);
}
.leave-substitute-dialog .danger-text {
  margin-right: auto;
  color: var(--jj-danger-fg);
}
.tool-popover > a.tool-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: var(--jj-radius-xs);
  color: inherit;
  font-size: 13px;
  text-decoration: none;
}
.tool-popover > a.tool-link:hover {
  background: var(--jj-gray-100);
  color: var(--jj-primary);
}
@media print {
  .leave-line,
  .teacher-leave-mark {
    display: none !important;
  }
}

/* 휴가 일정 (leave.html and 학원 운영 › 직원 업무 › 휴가 일정) — 디자인 시스템 v2 */
#leave-root {
  max-width: none;
  padding: 0;
}
.leave-page > .jj-page-header {
  margin-bottom: 20px;
}
.leave-toolbar.ops-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}
.leave-toolbar .jj-chips {
  margin-right: 8px;
}
.leave-toolbar .jj-chips > button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--jj-border);
  border-radius: var(--jj-radius-pill);
  background: var(--jj-surface);
  color: var(--jj-gray-700);
  font-size: 13px;
  font-weight: 500;
}
.leave-toolbar .jj-chips > button[aria-pressed="true"] {
  border-color: var(--jj-gray-900);
  background: var(--jj-gray-900);
  color: var(--jj-white);
  font-weight: 600;
}
.leave-toolbar .jj-chips > button b {
  margin: 0;
  padding: 0;
  background: none;
  min-width: 0;
}
.leave-toolbar [data-leave-new] {
  margin-left: 0;
}
.leave-toolbar > a.button {
  margin-left: auto;
}
.leave-toolbar .button,
.leave-toolbar > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--jj-control-h);
  padding: 0 14px;
  border-radius: var(--jj-radius-control);
  font-size: 14px;
}
.leave-toolbar > a.button {
  border: 1px solid var(--jj-border-strong);
  background: var(--jj-surface);
  color: var(--jj-gray-800);
  font-weight: 600;
  text-decoration: none;
}
.leave-toolbar svg {
  width: 18px;
  height: 18px;
}
.ops-content .leave-toolbar .leave-filter,
.leave-toolbar .leave-filter {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--jj-text-secondary);
}
.leave-filter span {
  white-space: nowrap;
}
.leave-toolbar .leave-filter select,
.leave-toolbar .leave-filter input {
  width: auto;
  min-height: var(--jj-control-h);
  padding: 0 36px 0 12px;
  border-radius: var(--jj-radius-control);
  font-size: 14px;
}
.leave-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--jj-border);
  border-radius: var(--jj-radius-card);
  background: var(--jj-surface);
}
.leave-list:has(> .leave-empty) {
  overflow: visible;
}
.leave-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  min-height: 64px;
  padding: 14px 16px 14px 20px;
  border-bottom: 1px solid var(--jj-divider);
  background: var(--jj-surface);
  transition: background-color var(--jj-duration-fast) var(--jj-ease);
}
.leave-row:last-child {
  border-bottom: 0;
}
.leave-row:hover {
  background: var(--jj-gray-50);
}
.leave-row.is-cancelled {
  background: var(--jj-gray-50);
  color: var(--jj-text-tertiary);
}
.leave-row.is-cancelled .leave-title strong,
.leave-row.is-cancelled .leave-meta {
  text-decoration: line-through;
}
.leave-date {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.leave-date strong {
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
}
.leave-date small {
  color: var(--jj-text-tertiary);
  font-size: 12px;
  line-height: 16px;
}
.leave-body p {
  margin: 0;
}
.leave-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 15px;
  line-height: 22px;
}
.leave-title strong {
  font-weight: 600;
}
.leave-meta {
  margin-top: 2px !important;
  font-size: 13px;
  line-height: 18px;
  color: var(--jj-text-secondary);
  overflow-wrap: anywhere;
}
.leave-subs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 6px !important;
  font-size: 12px;
  color: var(--jj-text-secondary);
}
.leave-subs svg {
  width: 14px;
  height: 14px;
}
.leave-subs b {
  color: var(--substitute);
}
.leave-author {
  margin-top: 4px !important;
  font-size: 12px;
  line-height: 16px;
  color: var(--jj-text-tertiary);
}
.leave-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.leave-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--jj-control-h-sm);
  padding: 0 10px;
  font-size: 13px;
}
.leave-actions svg {
  width: 16px;
  height: 16px;
}
.leave-empty {
  padding: 8px 0;
}
/* 휴가 등록·수정: shared dialog frame (ui-kit .jj-dialog) — the list stays
   full width and the actions are pinned in the footer. */
.leave-editor-dialog {
  --jj-dialog-w: 480px;
}
.leave-editor-body {
  display: grid;
  gap: 16px;
  padding: 20px;
}
.leave-editor-body > * {
  margin: 0;
}
.leave-editor-hint {
  color: var(--jj-text-tertiary);
  font-size: 13px;
  line-height: 18px;
}
.leave-editor-dialog .ops-form-message {
  color: var(--jj-danger-fg);
  font-size: 13px;
  font-weight: 600;
}
.leave-editor-dialog .jj-dialog-header .jj-btn {
  color: var(--jj-gray-600);
}
.leave-editor-dialog input[type="date"],
.leave-editor-dialog input[type="time"] {
  min-width: 0;
}
.leave-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.leave-optional {
  color: var(--jj-text-tertiary);
  font-size: 12px;
  font-weight: 400;
}
.leave-month {
  margin-left: 4px;
}
@media (max-width: 640px) {
  .leave-row {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 16px;
  }
  .leave-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .leave-toolbar .jj-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    width: 100%;
    margin: 0;
  }
  .leave-toolbar .jj-chips > button {
    flex: none;
  }
  .ops-content .leave-toolbar .leave-filter,
  .leave-toolbar .leave-filter {
    flex: 1 1 140px;
  }
  .leave-toolbar .leave-filter select,
  .leave-toolbar .leave-filter input {
    width: 100%;
  }
  .leave-toolbar .leave-month {
    flex: 1 1 100%;
    margin: 0;
  }
  .leave-month > strong {
    flex: 1;
  }
  .leave-toolbar > a.button {
    margin-left: 0;
  }
  .leave-toolbar > a.button,
  .leave-toolbar > [data-leave-new] {
    flex: 1;
  }
}
.leave-decide .primary {
  min-width: 72px;
}
