:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #f1f5f9;
  --line: #dbe3ec;
  --line-strong: #c8d3df;

  --text: #172033;
  --text-soft: #5f6b7a;
  --text-faint: #8994a3;

  --primary: #1f5fae;
  --primary-dark: #194f91;
  --primary-soft: #eaf2fb;

  --success: #17865f;
  --success-soft: #e7f6f0;

  --warning: #b87412;
  --warning-soft: #fff4df;

  --danger: #c84c4c;
  --danger-soft: #fdecec;

  --shadow-sm: 0 4px 14px rgba(30, 45, 70, 0.06);
  --shadow-md: 0 14px 34px rgba(30, 45, 70, 0.12);
  --shadow-lg: 0 24px 70px rgba(18, 30, 50, 0.22);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --header-height: 72px;
  --content-width: 1480px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 1180px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Pretendard,
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    Arial,
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.app-header__inner,
.top-tabs__inner,
.app-main {
  width: min(calc(100% - 48px), var(--content-width));
  margin: 0 auto;
}

.app-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d5da8, #2e79c9);
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.03em;
  box-shadow: 0 8px 18px rgba(31, 95, 174, 0.24);
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand__text strong {
  color: #1a2740;
  font-size: 18px;
  letter-spacing: 0.06em;
}

.brand__text small {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-action {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: #4d5a6c;
  font-size: 13px;
  font-weight: 700;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.header-action:hover {
  background: var(--surface-muted);
  color: var(--primary);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.header-user__name {
  color: #29364a;
  font-weight: 800;
}

.header-action--logout {
  color: var(--text-soft);
}

.top-tabs {
  position: sticky;
  top: var(--header-height);
  z-index: 70;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.top-tabs__inner {
  display: flex;
  align-items: stretch;
  height: 52px;
}

.top-tab {
  position: relative;
  min-width: 92px;
  padding: 0 22px;
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 800;
}

.top-tab::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: -1px;
  left: 20px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
}

.top-tab:hover,
.top-tab.is-active {
  color: var(--primary);
}

.top-tab.is-active::after {
  background: var(--primary);
}

.app-main {
  padding: 28px 0 56px;
}

.page-view {
  display: none;
}

.page-view.is-active {
  display: block;
}

.content-section {
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading--with-action {
  align-items: center;
}

.section-heading__eyebrow {
  margin: 0 0 3px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.section-heading__title {
  margin: 0;
  color: #1b2840;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.shift-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-soft);
}

.shift-summary__label {
  font-size: 12px;
  font-weight: 700;
}

.shift-summary__value {
  color: #24334c;
  font-size: 14px;
}

/* =========================================================
   근무자 현황
========================================================= */

.shift-member-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.shift-member-card {
  position: relative;
  min-width: 0;
  padding: 14px 12px 12px;
  border: 1px solid #d9dee7;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.shift-member-card__role {
  margin-bottom: 10px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.shift-member-card__body {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-bottom: 12px;
}

.shift-member-card__name {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shift-member-card__team {
  flex: 0 0 auto;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.shift-member-card__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.shift-member-card__status.is-complete {
  color: #166534;
  background: #dcfce7;
}

.shift-member-card__status.is-writing {
  color: #1d4ed8;
  background: #dbeafe;
}

.shift-member-card__status.is-empty {
  color: #6b7280;
  background: #f3f4f6;
}

@media (max-width: 1200px) {
  .shift-member-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shift-member-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .shift-member-card {
    padding: 12px 10px 10px;
  }

  .shift-member-card__role {
    margin-bottom: 8px;
    font-size: 12px;
  }

  .shift-member-card__name {
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .shift-member-grid {
    grid-template-columns: 1fr;
  }
}

.date-navigation-section {
  display: grid;
  grid-template-columns: 46px minmax(380px, 1fr) 46px auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.date-nav-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: #42516a;
  font-size: 28px;
  line-height: 1;
  transition:
    border-color 0.16s ease,
    background 0.16s ease;
}

.date-nav-button:hover {
  border-color: #aebdce;
  background: var(--surface-soft);
}

.date-navigation__center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.date-navigation__label {
  margin: 0;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
}

.date-navigation__date {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  color: #22324c;
}

.date-navigation__date strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.shift-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 27px;
  padding: 0 9px;
  border-radius: 999px;
  background: #223c5f;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.today-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 9px;
  background: #edf2f7;
  color: #4a5a70;
  font-size: 13px;
  font-weight: 900;
}

.primary-button,
.secondary-button,
.approval-button,
.add-entry-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 900;
  transition:
    transform 0.14s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.primary-button {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 7px 16px rgba(31, 95, 174, 0.18);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #49576b;
}

.secondary-button:hover {
  background: var(--surface-soft);
}

.approval-button {
  background: #203b60;
  color: #fff;
}

.approval-button:hover {
  background: #172f50;
}

.primary-button:active,
.secondary-button:active,
.approval-button:active,
.add-entry-button:active {
  transform: translateY(1px);
}

.log-table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.log-table th,
.log-table td {
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.log-table th {
  height: 46px;
  padding: 0 13px;
  background: #f1f5f9;
  color: #4b5b71;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.log-table td {
  padding: 14px 13px;
  color: #334158;
}

.log-table tbody tr:last-child td {
  border-bottom: 0;
}

.log-table tbody tr:hover {
  background: #fbfcfe;
}

.log-table th:nth-child(1),
.log-table td:nth-child(1) {
  width: 90px;
}

.log-table th:nth-child(2),
.log-table td:nth-child(2) {
  width: 100px;
}

.log-table th:nth-child(3),
.log-table td:nth-child(3) {
  width: 110px;
}

.log-table th:nth-child(4),
.log-table td:nth-child(4) {
  width: 72px;
}

.log-table th:nth-child(6),
.log-table td:nth-child(6) {
  width: 130px;
}

.log-row__role,
.log-row__author {
  text-align: center;
}

.log-row__role {
  font-weight: 900;
  color: #2a3c56;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.status-badge.is-approved {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.is-writing {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-badge.is-saved {
  background: var(--primary-soft);
  color: var(--primary);
}

/* =========================================================
   업무일지 메인 목록
   첨부 표시 + 업무내용 미리보기
========================================================= */


/* 메인 목록 셀 정렬 */

.log-row__author-cell,
.log-row__status-cell,
.log-row__attachment-cell,
.log-row__actions-cell {
  text-align: center;
}

.log-row__preview-cell {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
  text-align: left;
}


/* 첨부파일 표시 */

.attachment-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  padding: 0 7px;
  border: 1px solid #cddaea;
  border-radius: 8px;
  background: #edf4fb;
  color: var(--primary);
  font-size: 16px;
  line-height: 1;
  cursor: default;
}

.attachment-indicator.is-empty {
  border-color: transparent;
  background: transparent;
  color: #a7b0bc;
  font-size: 13px;
}


/* 업무내용 전체 버튼 */

.log-preview {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.log-preview:hover .log-preview__text {
  color: var(--primary);
}


/* 업무내용 한 줄 */

.log-preview__group {
  width: 100%;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
}


/* 운전현황·TM·인계사항·비고 제목 */

.log-preview__title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #edf2f7;
  color: #42536a;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
  white-space: nowrap;
}

.log-preview__group.is-operation .log-preview__title {
  background: #eaf2fb;
  color: var(--primary);
}

.log-preview__group.is-maintenance .log-preview__title {
  background: #e7f6f0;
  color: var(--success);
}

.log-preview__group.is-handover .log-preview__title {
  background: #fff4df;
  color: var(--warning);
}

.log-preview__group.is-note .log-preview__title {
  background: #f1f3f5;
  color: #667181;
}


/* 제목 오른쪽의 실제 업무내용 */

.log-preview__content {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding-top: 2px;
  color: #34445a;
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
}


/* TAG 표시 */

.log-preview__tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family:
    Consolas,
    "Courier New",
    monospace;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
}


/* 업무내용 글씨 */

.log-preview__text {
  min-width: 0;
  display: block;
  overflow: hidden;
  color: #34445a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.16s ease;
}


/* 표시할 내용이 없을 때 */

.log-preview__empty {
  display: block;
  padding: 5px 0;
  color: var(--text-faint);
  font-size: 12px;
  text-align: left;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.table-action-button {
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #506076;
  font-size: 12px;
  font-weight: 800;
}

.table-action-button:hover {
  border-color: #aebdce;
  color: var(--primary);
}

.empty-state {
  padding: 52px 20px;
  color: var(--text-soft);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: #344257;
  font-size: 16px;
}

.empty-state p {
  margin: 0;
}

.search-form {
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.search-form__grid {
  display: grid;
  grid-template-columns:
    minmax(140px, 0.8fr)
    minmax(140px, 0.8fr)
    minmax(120px, 0.65fr)
    minmax(120px, 0.65fr)
    minmax(140px, 0.75fr)
    minmax(280px, 1.7fr);
  gap: 12px;
}

.search-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.search-result-header {
  margin-bottom: 10px;
  color: #344257;
}

.search-result-header span {
  color: var(--primary);
}

.search-result-table th:nth-child(1),
.search-result-table td:nth-child(1) {
  width: 110px;
}

.search-result-table th:nth-child(2),
.search-result-table td:nth-child(2) {
  width: 70px;
}

.search-result-table th:nth-child(3),
.search-result-table td:nth-child(3),
.search-result-table th:nth-child(4),
.search-result-table td:nth-child(4) {
  width: 90px;
}

.search-result-table th:nth-child(5),
.search-result-table td:nth-child(5) {
  width: 100px;
}

.search-result-table th:nth-child(6),
.search-result-table td:nth-child(6) {
  width: 150px;
}

.search-result-table th:nth-child(8),
.search-result-table td:nth-child(8) {
  width: 76px;
}

.form-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.form-field__label {
  color: #4f5f74;
  font-size: 12px;
  font-weight: 900;
}

.form-field input,
.form-field select,
.form-field textarea,
.large-textarea,
.editor-section > textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.form-field input,
.form-field select {
  min-height: 41px;
  padding: 0 11px;
}

.form-field textarea,
.large-textarea,
.editor-section > textarea {
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.65;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.large-textarea:focus,
.editor-section > textarea:focus {
  border-color: #6b9bcf;
  box-shadow: 0 0 0 3px rgba(31, 95, 174, 0.1);
}

.form-field--wide {
  grid-column: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(18, 27, 42, 0.56);
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-panel {
  width: min(1120px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.log-detail-modal {
  width: min(920px, calc(100vw - 56px));
}

.modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.modal-header__eyebrow {
  margin: 0 0 2px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.modal-header__title {
  margin: 0;
  color: #1b2840;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.modal-close-button {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #f1f4f7;
  color: #596678;
  font-size: 25px;
  line-height: 1;
}

.modal-close-button:hover {
  background: #e8edf2;
}

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 22px 26px;
  background: #f7f9fb;
}

.editor-section {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.editor-section:last-child {
  margin-bottom: 0;
}

.editor-section__heading {
  margin-bottom: 14px;
}

.editor-section__heading--with-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.editor-section__heading h3 {
  margin: 0;
  color: #27364d;
  font-size: 16px;
}

.editor-section__heading p {
  margin: 3px 0 0;
  color: var(--text-faint);
  font-size: 12px;
}

.basic-info-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 1fr 1.2fr;
  gap: 12px;
}

.add-entry-button {
  flex: 0 0 auto;
  border: 1px solid #bfd0e2;
  background: #edf4fb;
  color: var(--primary);
}

.add-entry-button:hover {
  background: #e3eef9;
}

/* =========================================================
   현재 운전현황 v2
========================================================= */

.operation-status-section {
  overflow: visible;
}


/* =========================================================
   상단 제목과 수정 버튼
========================================================= */

.operation-status-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.operation-status-heading > div {
  min-width: 0;
}

.operation-status-edit-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #b8cbe0;
  border-radius: 9px;
  background: #eef5fc;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.operation-status-edit-button:hover {
  border-color: #8eafd2;
  background: #e2eef9;
}

.operation-status-edit-button.is-active {
  border-color: #d3a249;
  background: #fff4dc;
  color: #92610e;
}


/* =========================================================
   현재 적용 중인 운전현황 카드
========================================================= */

.operation-status-current-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid #c9d9e9;
  border-radius: 12px;
  background:
    linear-gradient(
      135deg,
      #f7fbff 0%,
      #ffffff 65%
    );
}

.operation-status-current-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--primary);
}

.operation-status-current-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.operation-status-current-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.operation-status-current-title strong {
  color: #263750;
  font-size: 13px;
}

.operation-status-live-dot {
  position: relative;
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow:
    0 0 0 4px rgba(23, 134, 95, 0.12);
}

.operation-status-live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(23, 134, 95, 0.35);
  border-radius: 50%;
}


/* =========================================================
   상태 배지
========================================================= */

.operation-status-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.operation-status-state-badge.is-normal {
  background: var(--success-soft);
  color: var(--success);
}

.operation-status-state-badge.is-planned {
  background: var(--warning-soft);
  color: var(--warning);
}

.operation-status-state-badge.is-emergency,
.operation-status-state-badge.is-stopped {
  background: var(--danger-soft);
  color: var(--danger);
}

.operation-status-state-badge.is-other {
  background: var(--primary-soft);
  color: var(--primary);
}


/* =========================================================
   현재 운전현황 본문
========================================================= */

.operation-status-current-content {
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid #dae5ef;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.88);
  color: #2f4057;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}


/* =========================================================
   마지막 수정 정보
========================================================= */

.operation-status-current-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
  color: var(--text-faint);
  font-size: 11px;
}

.operation-status-current-meta strong {
  color: #5b6879;
  font-size: 11px;
}

.operation-status-meta-divider {
  color: #abb4bf;
}


/* =========================================================
   운전현황 수정 영역
========================================================= */

.operation-status-editor {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #d5dee8;
  border-radius: 12px;
  background: #f8fafc;
}

.operation-status-editor[hidden] {
  display: none !important;
}

.operation-status-editor-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.operation-status-editor-content textarea {
  min-height: 132px;
  max-height: 260px;
  resize: vertical;
}

.operation-status-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}


/* =========================================================
   수정 중 상태
========================================================= */

.operation-status-section.is-editing
.operation-status-current-card {
  border-color: #e0b765;
  background: #fffdf8;
}

.operation-status-section.is-editing
.operation-status-current-card::before {
  background: #d59a2c;
}


/* =========================================================
   반응형
========================================================= */

@media (max-width: 760px) {
  .operation-status-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .operation-status-edit-button {
    align-self: flex-end;
  }

  .operation-status-current-card {
    padding: 15px;
  }

  .operation-status-current-header {
    align-items: flex-start;
  }

  .operation-status-editor-grid {
    grid-template-columns: 1fr;
  }

  .operation-status-editor-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .operation-status-editor-actions button {
    width: 100%;
  }
}

/* =========================================================
   작업 · 정비 · 인계 내역 v2
========================================================= */

.log-entry-section {
  overflow: visible;
}


/* =========================================================
   입력 패널
========================================================= */

.log-entry-input-panel {
  padding: 18px;
  border: 1px solid #d7e0e9;
  border-radius: 13px;
  background: #f7f9fc;
}

.log-entry-input-top-row {
  display: grid;
  grid-template-columns:
    210px
    170px
    minmax(280px, 1fr)
    auto;
  align-items: end;
  gap: 12px;
  width: 100%;
}

.log-entry-field--time,
.log-entry-field--category,
.log-entry-field--tag {
  min-width: 0;
}


/* =========================================================
   시간 입력
========================================================= */

.log-entry-time-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.log-entry-time-group input {
  width: 100%;
  min-width: 0;
}

.current-time-check {
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #c8d4e1;
  border-radius: 9px;
  background: #fff;
  color: #536276;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.current-time-check:hover {
  border-color: #9eb8d3;
  background: #f2f7fc;
}

.current-time-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
}


/* =========================================================
   TAG 입력
========================================================= */

.log-entry-field--tag[hidden] {
  display: none !important;
}

.tag-input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.tag-input-group input {
  width: 100%;
  min-width: 0;
}

.navigator-button {
  min-height: 41px;
  padding: 0 13px;
  border: 1px solid #b8cbe0;
  border-radius: 9px;
  background: #eef5fc;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  transition:
    border-color 0.16s ease,
    background 0.16s ease;
}

.navigator-button:hover {
  border-color: #91afd0;
  background: #e1edf9;
}


/* =========================================================
   내용 입력
========================================================= */

.log-entry-content-field {
  display: block;
  margin-top: 14px;
}

.log-entry-content-field textarea {
  width: 100%;
  min-height: 88px;
  max-height: 180px;
  padding: 11px 12px;
  line-height: 1.6;
  resize: vertical;
  overflow-y: auto;
}


/* =========================================================
   입력 버튼
========================================================= */

.log-entry-input-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.log-entry-input-actions button {
  min-height: 41px;
}

.log-entry-input-actions .add-entry-button {
  min-width: 92px;
  padding: 0 17px;
}

#cancelLogEntryEditButton {
  min-width: 64px;
  padding: 0 13px;
}

.add-entry-button {
  border: 1px solid #9eb9d7;
  border-radius: 9px;
  background: #eaf3fc;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.add-entry-button:hover {
  border-color: #7fa4ca;
  background: #dcebf9;
}


/* =========================================================
   누적 목록
========================================================= */

.log-entry-table-panel {
  margin-top: 20px;
}

.log-entry-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.log-entry-table-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.log-entry-table-header strong {
  color: #2c3b52;
  font-size: 14px;
}

#logEntryCount {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}


/* =========================================================
   누적 테이블
========================================================= */

.log-entry-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.log-entry-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

.log-entry-table__time {
  width: 92px;
}

.log-entry-table__category {
  width: 130px;
}

.log-entry-table__content {
  width: auto;
}

.log-entry-table__actions {
  width: 118px;
}

.log-entry-table th,
.log-entry-table td {
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.log-entry-table th {
  height: 43px;
  padding: 0 12px;
  background: #f3f6f9;
  color: #627083;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.log-entry-table td {
  min-height: 54px;
  padding: 10px 12px;
  color: #35445a;
  font-size: 12px;
}

.log-entry-table tbody tr:last-child td {
  border-bottom: 0;
}

.log-entry-table tbody tr:hover {
  background: #f9fbfd;
}

.log-entry-table td:nth-child(1),
.log-entry-table td:nth-child(2),
.log-entry-table td:nth-child(4) {
  text-align: center;
}

.log-entry-empty-row td {
  height: 74px;
  color: #8a96a5;
  text-align: center !important;
}


/* =========================================================
   내용 표시
========================================================= */

.log-entry-content {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  text-align: left;
}

.log-entry-content__tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 7px;
  background: #eaf3fc;
  color: var(--primary);
  font-family:
    Consolas,
    "Courier New",
    monospace;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
}

.log-entry-content__tag:hover {
  background: #dceafa;
  text-decoration: underline;
}

.log-entry-content__text {
  min-width: 0;
  color: #35445a;
  line-height: 1.6;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}


/* =========================================================
   수정 · 삭제 버튼
========================================================= */

.log-entry-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.log-entry-edit-button,
.log-entry-delete-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
  font-weight: 900;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.log-entry-edit-button {
  color: var(--primary);
}

.log-entry-edit-button:hover {
  border-color: #9eb9d7;
  background: var(--primary-soft);
}

.log-entry-delete-button {
  color: var(--danger);
}

.log-entry-delete-button:hover {
  border-color: #e5b6b6;
  background: var(--danger-soft);
}


/* =========================================================
   수정 중 표시
========================================================= */

.log-entry-table tr.is-editing {
  background: #fff8e8;
}

.log-entry-table tr.is-editing:hover {
  background: #fff8e8;
}

.log-entry-input-panel.is-editing {
  border-color: #e3b560;
  background: #fffbf2;
}

.log-entry-input-panel.is-editing .add-entry-button {
  border-color: #dca745;
  background: #fff0ce;
  color: #95600b;
}


/* =========================================================
   반응형
========================================================= */

@media (max-width: 1100px) {
  .log-entry-input-top-row {
    grid-template-columns:
      minmax(190px, 1fr)
      minmax(150px, 0.8fr)
      minmax(260px, 1.4fr);
  }

  .log-entry-input-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .log-entry-input-panel {
    padding: 14px;
  }

  .log-entry-input-top-row {
    grid-template-columns: 1fr;
  }

  .log-entry-input-actions {
    grid-column: auto;
  }

  .log-entry-input-actions .secondary-button,
  .log-entry-input-actions .add-entry-button {
    flex: 1 1 0;
  }

  .log-entry-time-group {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .log-entry-content-field textarea {
    min-height: 104px;
  }
}

.file-dropzone {
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  border: 1.5px dashed #b9c8d8;
  border-radius: 11px;
  background: #f8fafc;
  color: #56667b;
  text-align: center;
  transition:
    border-color 0.16s ease,
    background 0.16s ease;
}

.file-dropzone:hover {
  border-color: #6f9dcc;
  background: #f3f8fd;
}

.file-dropzone__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
}

.file-dropzone strong {
  color: #3d4d63;
}

.file-dropzone small {
  color: var(--text-faint);
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.modal-footer {
  flex: 0 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.modal-footer__left,
.modal-footer__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 400;
  max-width: 420px;
  padding: 13px 16px;
  border-radius: 10px;
  background: #21344f;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1320px) {
  .shift-member-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .search-form__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-field--wide {
    grid-column: span 2;
  }

}

@media print {
  body {
    background: #fff;
  }

  .app-header,
  .top-tabs,
  .date-navigation-section,
  .header-actions,
  .section-heading--with-action .primary-button,
  .row-actions,
  .modal-footer,
  .modal-close-button {
    display: none !important;
  }

  .app-main,
  .content-section,
  .modal-panel,
  .modal-body,
  .editor-section {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .modal-backdrop.is-open {
    position: static;
    display: block;
    padding: 0;
    background: transparent;
  }

  .modal-panel {
    max-height: none;
    overflow: visible;
  }

  .modal-body {
    overflow: visible;
    background: #fff;
  }
}

/* 현재시간 체크 */

.log-entry-time-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.log-entry-time-group #logEntryTime {
  min-width: 0;
  flex: 1 1 auto;
}

.current-time-check {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 41px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.current-time-check:hover {
  border-color: #9db5cf;
  background: var(--surface-soft);
}

.current-time-check:has(input:checked) {
  border-color: #8bb1dc;
  background: var(--primary-soft);
  color: var(--primary);
}

.current-time-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
}

/* =========================================================
   업무일지 상세보기
========================================================= */

.log-detail-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.log-detail-summary-card,
.log-detail-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15,23,42,.05);
  overflow: hidden;
}

.log-detail-summary-card__heading,
.log-detail-card__heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 20px;
  border-bottom:1px solid var(--line);
  background:#f8fafc;
}

.log-detail-section-label{
  display:block;
  margin-bottom:3px;
  color:var(--primary);
  font-size:10px;
  font-weight:900;
  letter-spacing:.12em;
}

.log-detail-summary-card h3,
.log-detail-card h3{
  margin:0;
  font-size:18px;
  color:#22324c;
}

.detail-summary-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  padding:18px;
}

.detail-summary-item{
  padding:12px;
  border-radius:10px;
  background:#f8fafc;
}

.detail-summary-item span{
  display:block;
  margin-bottom:4px;
  color:#7b8797;
  font-size:11px;
  font-weight:700;
}

.detail-summary-item strong{
  color:#22324c;
  font-size:14px;
}

.log-detail-card__content{
  padding:18px 20px;
}

.detail-multiline{
  white-space:pre-wrap;
  line-height:1.75;
}

.detail-entry-list{
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:18px;
}

.detail-entry-card{
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
}

.detail-entry-card__header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  background:#fafbfd;
}

.detail-entry-card__meta{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.detail-entry-card__number{
  width:24px;
  height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:var(--primary);
  color:#fff;
  font-size:11px;
  font-weight:900;
}

.detail-entry-card__category{
  padding:3px 8px;
  border-radius:6px;
  background:#edf2f7;
  font-size:11px;
  font-weight:900;
}

.detail-entry-card__time{
  color:#6b7686;
  font-size:12px;
  font-weight:700;
}

.detail-entry-card__content{
  padding:16px;
  white-space:pre-wrap;
  line-height:1.7;
}

.detail-tag-button{
  padding:4px 8px;
  border:0;
  border-radius:6px;
  background:var(--primary-soft);
  color:var(--primary);
  font-family:Consolas,"Courier New",monospace;
  font-size:11px;
  font-weight:800;
}

.detail-tag-button:hover{
  background:#dbeafb;
}

.detail-attachment-list{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  padding:18px;
}

.detail-attachment-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#eef5fc;
  color:#23466d;
  font-size:13px;
}

.detail-empty-card{
  padding:30px;
  color:#8a94a3;
  text-align:center;
}

.log-detail-count{
  color:#6f7d90;
  font-size:12px;
  font-weight:800;
}

/* =========================================================
   근무자 카드 업무일지 작성 기능
========================================================= */

#openLogEditorButton {
  display: none;
}

.shift-member-card {
  position: relative;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease,
    background 0.16s ease;
}

.shift-member-card:hover {
  border-color: #8db2da;
  background: #f8fbff;
  box-shadow: 0 7px 18px rgba(31, 93, 163, 0.1);
  transform: translateY(-2px);
}

.shift-member-card:focus-visible {
  outline: 3px solid rgba(31, 111, 198, 0.2);
  outline-offset: 3px;
}

.shift-member-card::after {
  content: "업무일지";
  position: absolute;
  top: 10px;
  right: 10px;
  opacity: 0;
  color: var(--primary);
  font-size: 9px;
  font-weight: 900;
  transition: opacity 0.16s ease;
}

.shift-member-card:hover::after,
.shift-member-card:focus-visible::after {
  opacity: 1;
}

.shift-member-card[data-log-state="existing"] {
  border-color: #b9d8ca;
}

.shift-member-card[data-log-state="existing"]:hover {
  border-color: #68ad8d;
  background: #f5fcf8;
}

@media (max-width: 760px) {
  .shift-member-card::after {
    display: none;
  }

  .shift-member-card:hover {
    transform: none;
  }
}