/* Teacher leave: timetable overlay (screen only) and 학원 운영 › 휴가 일정 */
:root {
  --leave-ink: #5b6576;
  --leave-bg: #eef0f4;
  --leave-tag: #6b7280;
  --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,
    #f3f4f7 0 6px,
    #eceef3 6px 12px
  );
  border-color: #d9dde5;
  border-left-color: #b7bdc9;
}
.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: #fbf9ff;
}
.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 #cfd5e1;
  border-radius: 5px;
  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: #eef2ff;
}
.ms-class.on-leave {
  background: repeating-linear-gradient(
    135deg,
    #f3f4f7 0 6px,
    #eceef3 6px 12px
  );
  border-left-color: #b7bdc9;
}
.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: 7px;
  background: #fff5df;
  color: #83500a;
  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: 8px;
  background: #f5f7fb;
  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: #b42318;
}
.tool-popover > a.tool-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 5px;
  color: inherit;
  font-size: 13px;
  text-decoration: none;
}
.tool-popover > a.tool-link:hover {
  background: #eef2fb;
  color: #3155e7;
}
@media print {
  .leave-line,
  .teacher-leave-mark {
    display: none !important;
  }
}

/* 학원 운영 › 휴가 일정 */
.leave-toolbar {
  flex-wrap: wrap;
  gap: 8px;
}
.leave-toolbar [data-leave-new] {
  margin-left: auto;
}
.leave-toolbar .button,
.leave-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.leave-toolbar svg {
  width: 16px;
  height: 16px;
}
.ops-content .leave-toolbar .leave-filter {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.leave-filter span {
  white-space: nowrap;
}
.leave-filter select,
.leave-filter input {
  min-height: 36px;
}
.leave-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.leave-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface, #fff);
}
.leave-row.is-cancelled {
  background: #f7f8fa;
  color: var(--muted);
}
.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;
}
.leave-date strong {
  font-size: 20px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.leave-date small {
  color: var(--muted);
  font-size: 12px;
}
.leave-body p {
  margin: 0;
}
.leave-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 15px;
}
.leave-type {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  background: #e8edff;
  color: #3155e7;
}
.leave-type.type-half {
  background: #e6f6f1;
  color: #0f7a5c;
}
.leave-type.type-sick {
  background: #fdecec;
  color: #b42318;
}
.leave-type.type-other {
  background: var(--leave-bg);
  color: var(--leave-ink);
}
.leave-type.is-cancelled {
  background: #eceef2;
  color: var(--muted);
}
.leave-meta {
  margin-top: 3px !important;
  font-size: 13px;
  color: #3a4659;
  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(--leave-ink);
}
.leave-subs svg {
  width: 14px;
  height: 14px;
}
.leave-subs b {
  color: var(--substitute);
}
.leave-author {
  margin-top: 4px !important;
  font-size: 11px;
  color: var(--muted);
}
.leave-actions {
  display: flex;
  gap: 6px;
}
.leave-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}
.leave-actions svg {
  width: 14px;
  height: 14px;
}
.leave-editor form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.leave-type-choice {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}
.leave-type-choice legend {
  margin-bottom: 6px;
  font-size: 13px;
}
.leave-type-choice label {
  position: relative;
  display: block;
}
.leave-type-choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  min-height: 0;
}
.leave-type-choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.leave-type-choice input:checked + span {
  border-color: var(--accent);
  background: #eef2ff;
  color: var(--accent);
}
.leave-type-choice input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.leave-dates,
.leave-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.leave-times[hidden] {
  display: none;
}
.leave-allday {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.leave-allday input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
}
.leave-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
@media (max-width: 640px) {
  .leave-row {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
  }
  .leave-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .leave-toolbar [data-leave-new] {
    margin-left: 0;
  }
  .ops-content .leave-toolbar .leave-filter {
    flex: 1 1 140px;
  }
  .leave-filter select,
  .leave-filter input {
    width: 100%;
  }
}
.leave-status {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #e6f6f1;
  color: #0f7a5c;
}
.leave-status.status-pending {
  background: #fff4dc;
  color: #9a5b00;
}
.leave-status.status-rejected,
.leave-status.status-cancelled {
  background: #eceef2;
  color: var(--muted);
}
.leave-decide .primary {
  min-width: 72px;
}
.leave-page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.leave-page-heading {
  margin-bottom: 16px;
}
.leave-page-heading h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 22px;
}
.leave-page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
