/* ==========================
   ✅ 기본 공통 설정
========================== */
body {
  font-family: 'Segoe UI', sans-serif;
  background: #FFF;
  color: #333;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.page-content {
  flex: 1 0; 
  width: calc(100% - 64px);
  min-width: 700px;
  min-height: 0; 
  padding: 32px;
}

.page-container {
  max-width: 1240px;
  /* margin: 40px auto; */
  margin : 0 auto;
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

@media (max-width: 718px) {
  .page-content {
    flex: 1 0; 
    width: 100%;
    min-width: 700px;
    min-height: 0; 
    padding: 32px 0;
  }
}

@media (max-width: 500px) {
  .page-content {
    width: 100%;
    min-width: 340px;
    padding: 0px;
  }
  .page-container {
    margin: 20px auto;
    padding: 4px;
    background: #fff;
    border-radius: 8px;
  }
}

.page-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 12px;
}

.button-wrapper {
  display: flex; 
  justify-content: center; 
  gap: 20px; 
  margin-top: 30px;
}

.validationMsg {
  color: red; 
  font-size: 0.9em; 
  margin-top: 4px;
}

/* ==========================
   ✅ 폼 그리드 구성 (한 줄에 여러 항목)
========================== */
.form-group {
  margin-bottom: 32px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 16px;
}

.form-item {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 100px;
}

.form-item label {
  
  width: 80px;
  min-width: 60px;
  font-size: 14px;
  font-weight: 500;
  margin-right: 8px;
  color: #333;
}

.form-item input,
.form-item select,
.form-item textarea {
  flex: 1;
  min-width: 80px;
}

.form-item textarea {
  resize: vertical;
  min-height: 80px;
}

/* ==========================
   ✅ 버튼 스타일
========================== */
.form-actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn {
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #bbb;
  font-size: 13px;
  cursor: pointer;
  background-color: #f2f3f5;
  color: #333;
  transition: background 0.2s, color 0.2s;
}

.btn:hover {
  background-color: #e0e1e3;
}

button:disabled,
button:disabled:hover {
  background-color: #f2f3f5; 
  color: #333;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background-color: #1976d2;
  color: #fff;
  border: 1px solid #1976d2;
}

.btn-primary:hover {
  background-color: #1565c0;
  border: 1px solid #1565c0;
}

.btn-danger {
  background-color: #ff4d4f;
  color: #fff;
  border: 1px solid #ff4d4f;
}

.btn-danger:hover {
  background-color: #d9363e;
  border: 1px solid #d9363e;
}

.btn-warning {
  background-color: #ffe066;
  color: #856404;
  border: 1px solid #ffe066;
}

.btn-warning:hover {
  background-color: #ffd43b;
  color: #856404;
  border: 1px solid #ffd43b;
}

.btn-info {
  background-color: #52c41a; 
  color: #fff;
  border: 1px solid #52c41a;
}

.btn-info:hover {
  background-color: #389e0f;
  border: 1px solid #389e0f;
}


.btn-outline {
  background: transparent;
  border: 1px solid #bbb;
  color: #333;
}

.btn-outline:hover {
  background: #f2f3f5;
}

.btn-register {
  width: 100px;
  margin: 0 12px 0 0;
}

.btn-excel {
  background-color: black;
  color: white;
  width: 110px;
}

.btn-deleteRow {
  height: 25px; 
  display: inline-flex; 
  align-items: center;
}


/* ==========================
   ✅ 입력 필드 스타일
========================== */
input,
select,
textarea {
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

a {
  color: #007bff;
  text-decoration: none;
}

select {
  cursor: pointer;
}

/* ==========================
   ✅ 유틸리티 클래스 (간격, 정렬 등)
========================== */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.pt-1 { padding-top: 8px; }
.pt-2 { padding-top: 16px; }
.pb-1 { padding-bottom: 8px; }
.pb-2 { padding-bottom: 16px; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #888; }
.text-bold { font-weight: bold; }

.w-100 { width: 100%; }
.max-w-600 { max-width: 600px; margin: 0 auto; }

.bg-light { background-color: #f8f9fa; }
.bg-white { background-color: #fff; }
.border { border: 1px solid #ddd; }
.rounded { border-radius: 4px; }
.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }

.hidden { display: none !important; }

/* ==========================
   ✅ 반응형 대응 예시
========================== */
@media (max-width: 500px) {
  .form-item {
    flex: 1 1 auto;
  }
  .form-actions {
    justify-content: center;
  }
}

/* ==========================
   ✅ GNB 메뉴
========================== */

#gnb {
    background: #2d3e50;
    padding: 0;
    margin: 0;
  }

.gnb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  gap: 0; /* 메뉴와 로고 사이 여백 최소화 */
  border-bottom: 2px solid #2d3e50;
}

.gnb-logo {
  min-width: 140px;
  padding: 0 24px 0 24px;
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
}
.logo-link {
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  font-weight: bold;
}
.gnb-menu {
  display: flex;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-left: 0;
  flex:1;
}
.gnb-item {
  position: relative;
  overflow: hidden;
}
.gnb-menu > .gnb-item > a {
  display: block;
  padding: 0px 32px;
  color: #fff;
  background: #2d3e50;
  text-decoration: none;
  font-weight: 500;
  line-height:54px;
  transition: background 0.2s, border-bottom 0.2s;
}
.gnb-menu > .gnb-item > a:hover {
  border-bottom: 2px solid #4fc3f7;
  color:#fff;
}
.submenu, .subsubmenu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  background: #fff;
  min-width: 220px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  border-radius: 4px;
  z-index: 100;
  padding: 8px 0;
  list-style: none;
}
.submenu .submenu-item {
  position: relative;
}
.submenu .submenu-item > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 20px;
  color: #222;
  text-decoration: none;
  background: #fff;
  border: none;
  border-radius: 0;
  transition: background 0.2s;
}
.submenu .submenu-item > a:hover {
  background: #f0f7fa;
  color: #1976d2;
}
.submenu .submenu-item > .subsubmenu {
  left: 100%;
  top: 0;
}
.subsubmenu {
  list-style: none;
}
.subsubmenu li {
  list-style: none;
}
.subsubmenu li a {
  display: block;
  padding: 10px 24px 10px 20px;
  color: #222;
  text-decoration: none;
  background: #fff;
  border: none;
  border-radius: 0;
  transition: background 0.2s;
}
.subsubmenu li a:hover {
  background: #e3f2fd;
  color: #1976d2;
}
.gnb-item:hover > .submenu,
.submenu-item:hover > .subsubmenu {
  display: block;
}

.arrow-right {
  display: inline-block;
  margin-left: 8px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 7px solid #888;
  vertical-align: middle;
}
.has-sub > a {
  position: relative;
}
.gnb-user {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
}
.user-label {
  color: #fff;
  font-size: 15px;
  margin-right: 0;
  cursor: pointer;
}
.user-info {
  display: none;
}
.logout-link {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background 0.2s;
}
.logout-link:hover {
  background: #223042;
}
.logout-icon {
  font-size: 16px;
  margin-right: 2px;
}

.page-title-line { 
  height: 2px; 
  background-color: #536c87; 
  border: none; 
  width: 100%;
}

@media (max-width: 985px) { 
  #gnb {
    display: block;
    min-width: 730px;
  }
  .gnb-menu > .gnb-item > a {
    padding: 0 8px;
  }
  .gnb-logo {
    min-width: 90px;
    padding: 0 24px 0 24px;
  }
  .logo-link {
    font-size: 20px;
  }
  div.gnb-user {
    gap: 8px;
    padding: 14px 8px;
    border-bottom: 2px;
  }
  .user-label {
    margin-right: 0;
  }
  .user-info {
    display: none;
  }
  .logout-link {
    padding: 0;
  }
}

@media (max-width: 650px) {
  .user-label {
    display: none;
  }  
  .user-info {
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    margin-right: 0;
    display:block;
  }
  .gnb-menu > .gnb-item > a {
    padding: 0px 8px;
  }
}

@media (max-width: 500px) {
  #gnb {
    display: block;
    min-width: 360px;
  }
}

.menu-icon {
  display: none;
  font-size: 1.5em;
}

#menu-toggle {
  display: none;
}

@media (max-width: 650px) {
  .gnb-menu {
    flex-direction: column;
    background-color: #2d3e50;
    position: absolute;
    top: 56px;
    width: 215px;
    display: none;
    padding: 0;
    margin: 0;
  }

  .menu-icon {
      color: white;
      display: block;
      margin-left: 15px;
  }

  #menu-toggle:checked ~ .gnb-menu {
    display: flex;
  }
  
  .gnb-menu {
    height: auto;
  }

  .gnb-item {
    height: 42px;
    border-bottom: 2px solid white;
  }

  .gnb-menu > .gnb-item > a {
    padding-left: 14px;
    line-height: 42px;
  }
}
    
/* ==========================
✅ 그리드 스타일
========================== */
      
.page-layout {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.grid-container {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.grid-container .grid-toolbar {
  display: flex;
  justify-content: space-between;
  padding: 4px;
  /* border-bottom: 1px solid #ddd; */
}

.grid-container .grid-toolbar .btn-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.grid-container .grid-toolbar .title-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.grid-container .grid-toolbar .title-bar .title {
  font-size: 14px;
  font-weight: bold;
  color: #333;
}

.grid-container .grid {
  flex: 1;
  border: 1px solid #ddd;
}

.gridSetting {
  display: flex; 
  align-items: center; 
  gap: 8px; 
  flex-wrap: wrap; 
  margin-bottom: 4px;
  justify-content: space-between;
}

/* ==========================
    ✅ Tabulator 그리드 스타일
========================== */
.tabulator .tabulator-header .tabulator-col {
  background: #F8F8F8;
  border-right: 1px solid #DDD;
  color: #333;
  font-weight: bold;
  border-bottom: 2px solid #F8F8F8;
}

/* hover 제거 */
.tabulator-row {
  transition: none !important;
}

.tabulator-row:hover:not(.tabulator-selected) {
  background-color: transparent !important;
}


.tabulator-table .tabulator-selected .tabulator-cell input,
.tabulator-table .tabulator-selected .tabulator-cell select {
  background-color: white !important;
}

/* ==========================
   ✅ 테이블형 폼 스타일 (table 기반)
========================== */
.form-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  margin-bottom: 12px;
  background: #fff;
  table-layout: fixed;
  min-width: 606px; 
}
.form-table th,
.form-table td {
  padding: 12px 16px;
  border: 1px solid #eee;
  text-align: left;
  vertical-align: middle;
  font-size: 15px;
}

/* 승인일자 행의 두 번째 td 오른쪽 선 제거 */
.form-table tr:first-child td[colspan="2"] {
  border-right: none;
}

/* 혹시 나중에 td[colspan="3"] 왼쪽에 선이 남으면 이걸로 제거 */
.form-table tr:first-child td[colspan="3"] {
  border-left: none;
}

.form-table th {
  background: #F8F8F8;
  color: #333;
  font-weight: 500;
  width: 120px;
  white-space: nowrap;
}
.form-table td input,
.form-table td select,
.form-table td textarea {
  width: 100%;
  box-sizing: border-box;
}

/* ==========================
   ✅ 튤팁
========================== */
.warn-icon {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #f5c542;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
}
.warn-box {
  text-align: end;
  margin-top: 10px;
  font-size: 13px;
  color: #333;
}

/* ==========================
   ✅ 모달
========================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  z-index: 999;
}

.modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  width: 1500px;
  max-width: 95vw;
  max-height: 90vh;
  min-height: 700px;
  overflow: hidden; /* ✅ 전체 스크롤 제거 */
}

.modal-box .modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 20px;
  font-weight: bold;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
}
.modal-box .modal-close:hover {
  color: #000;
}

.modal-body {
  display: flex;
  flex-wrap: nowrap;
  gap: 24px;
  height: calc(90vh - 80px); /* 헤더 고려해서 스크롤 영역 제한 */
  overflow: hidden;
}

.receipt-box {
  flex: 0 0 400px;
  border: 1px solid #000;
  padding: 16px;
  overflow-y: auto;
  min-height: 520px;
  max-height: calc(90vh - 100px); /* ✅ 추가: 스크롤 동작 위해 */
}

.voucher-form {
  flex: 1;
  min-width: 600px;
  overflow-y: auto;
  padding-right: 8px;
}

/* ✅ 모달 박스 (좁은) */
.modal-box.small-modal {
  width: 550px;
  min-height: 200px;
}

.modal-box.small-vh-modal {
  width: 450px;
  min-height: max-content;
  max-height: max-content;
}

.modal-box.small-vh-modal .modal-body {
  min-height: max-content;
  max-height: max-content;
}

.modal-box .justify-center {
  justify-content: center;
  display: flex;
  align-items:center;
}
.modal-box .modal-footer {
  margin-top: 12px;
}

/* ==========================
   ✅ 모달 내부 테이블 대응
========================== */

/* ✅ form-table 내부 테이블에 auto layout 적용 */
.form-table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto; /* 중요: 이거 있어야 colspan 작동 */
}

/* ✅ 기본 셀 스타일 */
.form-table th,
.form-table td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  border: 1px solid #ddd;
  font-size: 14px;
  font-weight: normal;
}

/* ✅ th 강조 */
.form-table th {
  background-color: #f7f7f7;
  font-weight: bold;
}

.iMust{position:relative;}
.iMust:before{content:"*";color:#ec193a;font-size:13px;padding:0 0 0 3px;vertical-align:top;}
.iMust span{display:none;}

.iGridMust{position:relative;}
.iGridMust:before{content:"*";color:#ec193a;font-size:13px;padding:0 0 0 3px;vertical-align:top;}
.iGridMust span{display:none;}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(1px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.loading-overlay.hidden { display: none !important; }

.loading-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 18px 24px;
  text-align: center;
  min-width: 280px;
}
.loading-box .loading-msg {
  font-size: 14px;
  color: #333;
  margin-top: 8px;
  white-space: pre-line;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e5e7eb;
  border-top-color: #1976d2;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert-overlay, .confirm-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  z-index: 9999 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alert-box, .confirm-box {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  font-size: 14px;
  color: #333;
}
 
.alert-box .msg,
.confirm-box .msg {
  margin-bottom: 24px;
  line-height: 1.5;
  white-space: pre-wrap;
}
 
.alert-box .btn-group,
.confirm-box .btn-group {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
 
.alert-box .btn,
.confirm-box .btn {
  min-width: 70px;
}

.layerForm {
  z-index: 9990 !important;
}

@media (max-width: 500px) {
  .form-table:not(.no-responsive),
  .form-table:not(.no-responsive) thead,
  .form-table:not(.no-responsive) tbody,
  .form-table:not(.no-responsive) tr {
    display: block;
    min-width: 352px;
    width: 100%;
  }

  .form-table:not(.no-responsive) th,
  .form-table:not(.no-responsive) td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .form-table:not(.no-responsive) th {
    border-bottom: none;
  }
}