  body {
    font-family: sans-serif; padding: 10px; background-color: #1a1a1a;
    color: #e0e0e0; margin: 0; min-height: 100vh;
  }
  h1, h2, h3 { text-align: center; color: #87CEFA; }
  h2 { font-size: 1.7em; margin-bottom: 15px;}
  h3 { color: #90EE90; margin-top: 15px; font-size: 1.2em; margin-bottom: 10px;}

  nav#navigationBar {
    background-color: rgba(68, 68, 68, 0.85); padding: 8px; margin-bottom: 12px;
    display: flex; justify-content: center; flex-wrap: wrap;
  }
  nav#navigationBar button {
    background-color: #007bff; color: white; border: none; padding: 8px 12px; margin: 4px;
    border-radius: 5px; cursor: pointer; font-size: 0.85em; transition: background-color 0.2s ease;
  }
  nav#navigationBar button:hover { background-color: #0056b3; }
  nav#navigationBar button.active { background-color: #28a745; font-weight: bold; }

  label { display: block; margin-bottom: 4px; font-weight: bold; font-size: 0.9em;}
  input[type="text"], input[type="number"], input[type="date"], select {
    width: 100%; padding: 8px; margin-bottom: 0; 
    border: 1px solid #555; border-radius: 4px; box-sizing: border-box;
    background-color: #333; color: #e0e0e0; font-size: 0.95em;
  }
  select#portSelect, select#motherShipSelect, select#unitSystemSelect, select#itemNameSelect, 
  select#pivotUnitSystemSelect, select#pivotMotherShipSelect, select#printPortSelect { /* printPortSelect 추가 */
      width: auto; min-width: 120px; flex-grow: 1; margin-right: 5px;
  }
  .selector-button-group { display: flex; align-items: center; }
  .selector-button-group select { flex-grow: 1; margin-right: 5px; }
  .selector-button-group button.inline-btn { flex-shrink: 0; }
  .input-group { margin-bottom: 10px; } 
  .input-group label { margin-bottom: 2px; }
  .range-input-container { display: flex; align-items: center; gap: 5px; margin-bottom: 0;}
  .range-input-container input[type="number"] {
    flex-grow: 1; flex-shrink: 1; flex-basis: 0;
    max-width: 120px; min-width: 60px; margin-bottom: 0;
  }
  .range-input-container span { margin: 0 2px; flex-shrink:0; }
  .inline-controls { display: flex; gap:10px; align-items: flex-end; }
  .inline-controls .input-group { flex:1; margin-bottom: 10px; }

  .page-content {
    display: none; padding: 15px; background-color: rgba(40, 40, 40, 0.85);
    border-radius: 10px; margin: 0 10px 15px 10px; box-shadow: 0 3px 10px rgba(0,0,0,0.5);
  }
  button {
    background-color: #007bff; color: white; border: none; padding: 10px 15px; text-align: center;
    text-decoration: none; display: inline-block; font-size: 0.95em; margin: 5px 2px;
    cursor: pointer; border-radius: 5px; box-sizing: border-box;
    transition: background-color 0.2s ease, transform 0.1s ease;
  }
  button:hover { background-color: #0056b3;} button:active { transform: scale(0.98); }
  .action-buttons button { width: calc(50% - 4px); }
  button.inline-btn { width: auto; padding: 8px 10px; font-size: 0.85em; margin-left: 5px; vertical-align: middle;}
  button.clear-filter-btn { padding: 6px 8px; font-size: 0.8em; margin-left: 2px; background-color: #6c757d;}


  table {
    margin-top: 10px; width: 100%; table-layout: auto; border-collapse: collapse;
    background-color: rgba(50, 50, 50, 0.85); color: #f0f0f0;
  }
  th, td {
    border: 1px solid #777; padding: 6px 4px; text-align: center;
    font-size: 0.8em; line-height: 1.2; white-space: nowrap;
  }
  th {
    background-color: rgba(80, 80, 80, 0.85); color: #ffffff; position: sticky; 
    top: 0; z-index: 10;
  }
  td .actions-cell button { font-size: 0.7em; padding: 2px 5px; margin: 1px; background-color: #5a6268; }
  td .actions-cell button:hover { background-color: #474d52; }
  .total-row td, .pivot-table tfoot td { font-weight: bold; background-color: rgba(70,70,70,0.85); }
  hr { border-color: rgba(255,255,255,0.2); margin-top:15px; margin-bottom:15px;}
  .loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.9); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 99999; opacity: 1; transition: opacity 0.5s ease-out; }
  .loading-overlay.hidden { opacity: 0; visibility: hidden; transition-delay: 0.3s; }
  .loading-overlay p { color: #f0f0f0; margin-top: 20px; font-size:1.2em; }
  #appContainer { visibility: hidden; } #appContainer.visible { visibility: visible; }
  #toastNotification { visibility: hidden; min-width: 280px; max-width: 90%; background-color: rgba(20, 129, 211, 0.95); color: #fff; text-align: center; border-radius: 5px; padding: 16px; position: fixed; z-index: 2000; left: 50%; bottom: 30px; transform: translateX(-50%); font-size: 1em; opacity: 0; box-shadow: 0 2px 10px rgba(0,0,0,0.3); transition: opacity 0.4s ease, bottom 0.4s ease, visibility 0s linear 0.4s; }
  #toastNotification.show { visibility: visible; opacity: 1; bottom: 60px; transition: opacity 0.4s ease, bottom 0.4s ease, visibility 0s linear 0s; }
  
  .pivot-table-section { margin-bottom: 25px; padding-bottom: 15px; border-bottom: 2px dashed #555; }
  .pivot-table-section:last-child { border-bottom: none; margin-bottom: 10px; }
  .pivot-table-title { font-size: 1.3em; color: #FFD700; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #444;}

  .pivot-table { border-collapse: collapse; margin-top: 10px; width: 100%; }
  .pivot-table th, .pivot-table td { vertical-align: middle; padding: 5px 3px; font-size: 0.75em; border: 1px solid #666; }
  .pivot-table th.port-header, .pivot-table td.port-cell { min-width: 90px; text-align: left; padding-left: 5px; position: sticky; left: 0; background-color: rgba(80, 80, 80, 0.95); z-index: 5; }
  .pivot-table th.height-header, .pivot-table td.height-cell { min-width: 60px; text-align: left; padding-left: 5px; position: sticky; background-color: rgba(65, 65, 65, 0.95); z-index: 4; left: 90px; /* Adjust if port-header width changes */ }
  .pivot-table td div { margin-bottom: 0px; white-space: nowrap; text-align: center; font-size: 0.9em; }
  .pivot-table td { text-align: center; }
  .filter-group { margin-bottom: 5px; padding: 8px; background-color: rgba(0,0,0,0.2); border-radius: 5px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 15px;}
  .filter-group label { margin-right: 3px; white-space: nowrap; font-size: 0.85em;}
  .filter-group select, .filter-group input[type="date"], .filter-group input[type="checkbox"] { padding: 6px; font-size:0.85em; flex-grow:1; min-width:100px; width:auto;}
  .filter-group input[type="checkbox"] { width: auto; margin-left: -40px; transform: scale(0.9); }


  #pivotSummaryTableContainer { overflow-x: auto; max-height: 65vh; overflow-y: auto; } 
  #pivotSummaryPageActions { display: flex; justify-content: center; align-items:center; gap: 10px; margin-top: 15px; padding-bottom: 10px;}
  #pivotSummaryPageActions label { margin-bottom: 0; } /* Override general label margin */


  /* === 최종 수정된 인쇄용 스타일 === */
  @media print {
    body {
      background: white !important; color: black !important;
      padding: 10mm !important; margin: 0 !important; font-size: 10pt;
      -webkit-print-color-adjust: exact !important; 
      print-color-adjust: exact !important;
    }
    nav#navigationBar, #loadingOverlay, #toastNotification,
    .action-buttons, button.inline-btn, 
    #inputPage, #summaryPage, 
    #pivotSummaryPage .filter-group, 
    #pivotSummaryPageActions 
    {
      display: none !important;
    }
    .page-content { display: none !important; box-shadow: none !important; border: none !important; margin: 0 !important; padding: 0 !important; background: none !important; }
    
    body #pivotSummaryPage.page-content, 
    body #pivotSummaryPage h2, 
    body #pivotSummaryPage #pivotSummaryTableContainer,
    body #pivotSummaryPage .pivot-table-section, 
    body #pivotSummaryPage .pivot-table-title,  
    body #pivotSummaryPage .pivot-table
     {
      display: block !important; visibility: visible !important; background-color: white !important;
      color: black !important; position: static !important; 
      box-shadow: none !important; border: none !important;
      margin: 0 0 10mm 0 !important; padding: 0 !important;
    }
    body #pivotSummaryPage h2 {font-size: 16pt !important; margin-bottom: 8mm !important; text-align: center !important;}
    .pivot-table-title {font-size: 12pt !important; margin-top: 8mm; margin-bottom: 4mm; border-bottom: 1px solid black !important; font-weight: bold;}
    #pivotSummaryTableContainer { width: 100% !important; overflow: visible !important; max-height: none !important; margin-bottom:0 !important;}
    
    .pivot-table, .pivot-table *,
    .pivot-table tbody, .pivot-table thead, .pivot-table tfoot,
    .pivot-table tr, .pivot-table td, .pivot-table th {
        visibility: visible !important; background-color: white !important; color: black !important;
    }
    /* 테이블 요소 display 속성 명시적 설정 */
    .pivot-table { display: table !important; width: 100% !important; font-size: 7pt !important; border-collapse: collapse !important; margin-bottom: 5mm !important; table-layout: auto; }
    .pivot-table thead { display: table-header-group !important; }
    .pivot-table tbody { display: table-row-group !important; }
    .pivot-table tfoot { display: table-footer-group !important; }
    .pivot-table tr { display: table-row !important; page-break-inside: avoid; }
    .pivot-table th, .pivot-table td {
        display: table-cell !important; border: 1px solid #333 !important; padding: 2px !important;
        white-space: normal !important; text-align: center !important; vertical-align: top; position: static !important;
    }
    .pivot-table thead th, .pivot-table tfoot td,
    .pivot-table th.port-header, .pivot-table td.port-cell,
    .pivot-table th.height-header, .pivot-table td.height-cell {
        font-weight: bold; background-color: #f0f0f0 !important;
    }
    .pivot-table td div { text-align: center !important; white-space: nowrap; font-size:1em; }
    #appContainer { padding: 0 !important; margin: 0 !important; background-color: white !important; }
  }
  .modal {
    display: none; /* 평소에는 숨김 */
    position: fixed; /* 화면에 고정 */
    z-index: 1000; /* 다른 요소들보다 위에 표시 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* 내용이 길면 스크롤 */
    background-color: rgba(0, 0, 0, 0.7); /* 반투명 검은 배경 */
    
    /* 내용을 수직/수평 중앙 정렬 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #2c2c2c;
    color: white;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px; /* 팝업창 최대 너비 */
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.modal-content h2 {
    margin-top: 0;
    color: #FFD700; /* 제목 색상 */
}

.modal-content label {
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
}

.modal-content input,
.modal-content select {
    width: 100%; /* 입력창 너비를 100%로 설정 */
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

.close-button:hover,
.close-button:focus {
    color: white;
    text-decoration: none;
    cursor: pointer;
}
/* ========== hbeam.css 파일에 추가할 코드 시작 ========== */

/* 탭 버튼 스타일 (이전에 추가했다면 그대로 사용) */
.input-tabs {
    display: flex;
    border-bottom: 2px solid #555;
    margin-bottom: 15px;
}
.tab-link {
    background-color: #333;
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
    border-bottom: 2px solid transparent;
}
.tab-link.active {
    background-color: #007bff;
    border-bottom: 2px solid #fff;
}
.tab-link:hover {
    background-color: #444;
}
.tab-link.active:hover {
    background-color: #0056b3;
}
.tab-content {
    display: none;
    padding: 10px;
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 5px 5px;
    background-color: #2c2c2c;
}

/* 입력방식 2: 일괄 입력 컨트롤 */
.batch-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

/* 일괄 입력 테이블 스타일 */
.batch-table-container {
    max-height: 400px; /* 테이블이 너무 길어지는 것을 방지 */
    overflow-y: auto;
    border: 1px solid #444;
}
#batchListTable {
    width: 100%;
    border-collapse: collapse;
}
#batchListTable th, #batchListTable td {
    border: 1px solid #555;
    padding: 8px;
    text-align: center;
    vertical-align: top;
    white-space: nowrap; /* 라벨이 줄바꿈되지 않도록 */
}
#batchListTable th {
    background-color: #3a3a3a;
    position: sticky; /* 스크롤 시 헤더 고정 */
    top: 0;
}

/* 일괄 입력 테이블 안의 입력 필드 스타일 */
#batchListTable .range-input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
#batchListTable input[type="number"],
#batchListTable input[type="text"] {
    width: 80px;
    padding: 6px;
    background-color: #333;
    border: 1px solid #555;
    color: white;
    border-radius: 4px;
    text-align: center;
}
#batchListTable .range-input-container input {
    width: 60px; /* 범위 입력칸은 조금 더 작게 */
}
#batchListTable .delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* ========== hbeam.css 파일에 추가할 코드 끝 ========== */