  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: 42%; 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%; table-layout: fixed; }

  .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; overflow: hidden; }
  .pivot-table th:not(.port-header):not(.height-header),
  .pivot-table td:not(.port-cell):not(.height-cell) {
    min-width: 42px;
    max-width: 72px;
    word-break: keep-all;
  }
  .pivot-table th.length-range-header {
    font-size: 0.68em;
    line-height: 1.05;
    white-space: normal;
  }
  .pivot-qty-bundle,
  .pivot-qty-pcs,
  .pivot-qty-pcs-only,
  .pivot-qty-pcs-under,
  .pivot-qty-divider {
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    vertical-align: baseline;
  }
  .pivot-qty-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.05;
    white-space: nowrap;
    vertical-align: middle;
  }
  .pivot-qty-pcs-under {
    font-size: 0.88em;
    margin-top: 1px;
  }
  .pivot-qty-pcs-only {
    font-size: 1em;
  }
  .pivot-qty-divider {
    font-size: 0.72em;
  }
  .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: fixed !important; }
    .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;
        overflow: hidden !important; word-break: keep-all !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 파일에 추가할 코드 끝 ========== */

/* ========== hbeam.css 파일 맨 아래에 추가 ========== */

/* 제목과 필터 그룹을 한 줄로 정렬 */
.header-row {
    display: flex;           /* 가로 배치 */
    align-items: center;     /* 세로 중앙 정렬 */
    flex-wrap: wrap;         /* 화면이 너무 좁으면 줄바꿈 허용 (선택사항) */
    margin-bottom: 15px;     /* 테이블과의 간격 */
    gap: 10px;               /* 제목과 필터 사이 간격 */
}

/* 필터 그룹 내부 요소들도 가로 정렬 유지 */
.header-row .filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;              /* 각 입력 요소 사이 간격 */
}

/* 체크박스와 라벨이 떨어지지 않게 묶어주는 스타일 (선택사항) */
.header-row label {
    margin-bottom: 0;       /* 라벨 하단 여백 제거 */
    margin-left: 10px;      /* 라벨 왼쪽 여백 (필요 시 조절) */
    white-space: nowrap;    /* 글자가 줄바꿈되지 않게 함 */
}
/* ========== 피벗 테이블 컨트롤 영역 스타일 (hbeam.css 맨 아래 추가) ========== */

.pivot-controls-container {
    background-color: #2c2c2c; /* 배경색 (다크 모드 기준) */
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 각 줄(Row) 공통 스타일 */
.control-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* 화면이 작으면 내부 요소 줄바꿈 허용 */
    gap: 20px;       /* 요소 간 간격 */
}

/* 윗줄 (필터) 스타일 */
.top-row {
    margin-bottom: 15px; /* 아랫줄과의 간격 */
    padding-bottom: 15px;
    border-bottom: 1px dashed #555; /* 구분선 */
}

/* 아랫줄 (옵션) 스타일 */
.bottom-row {
    font-size: 0.95em;
    color: #ddd;
}

/* 입력 요소 래퍼 */
.input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 체크박스 라벨 스타일 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}
.checkbox-label:hover {
    color: #fff;
}

/* 합계 표시 강조 스타일 */
.highlight-label {
    color: #ffeb3b; /* 노란색 강조 */
    font-weight: bold;
}

/* 셀렉트 박스 및 입력창 스타일 보정 */
.pivot-controls-container select,
.pivot-controls-container input[type="date"],
.pivot-controls-container input[type="number"] {
    background-color: #444;
    color: white;
    border: 1px solid #666;
    padding: 5px 10px;
    border-radius: 4px;
}
.batch-instruction {
    margin-left: 20px;
    font-size: 0.95em;
    color: #ffd54f; /* 눈에 띄는 연한 노란색 계열 */
    background-color: rgba(255, 213, 79, 0.1); /* 아주 연한 배경색 */
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px dashed rgba(255, 213, 79, 0.3);
    display: inline-block;
    vertical-align: middle;
}

/* 모바일 등 화면이 좁아질 때 줄바꿈 처리 */
@media (max-width: 768px) {
    .batch-controls {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .batch-instruction {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* 복사 시 입력칸이 빛나는 효과 */
.copy-glow {
    animation: glow-animation 0.8s ease-out;
}

@keyframes glow-animation {
    0% {
        border-color: #007bff;
        box-shadow: 0 0 12px rgba(0, 123, 255, 0.7);
        background-color: #e7f1ff;
    }
    100% {
        border-color: #ccc;
        box-shadow: none;
        background-color: #444; /* 기존 배경색에 맞춰 조정하세요 */
    }
}
/* 복사 성공 시: 글자색 황금색 + 테두리 강조 */
.copy-gold-effect {
    animation: gold-flash 1.2s ease-out;
}
/* 복사된 상태를 유지하는 스타일 */
.copied-gold-fixed {
    color: #FFD700 !important; /* 글자색 황금색 */
    font-weight: bold !important;
    background-color: rgba(255, 215, 0, 0.1) !important; /* 배경에 아주 연한 황금색 틴트 */
    border: 1px solid #FFD700 !important; /* 테두리 황금색 고정 */
}
@keyframes gold-flash {
    0% {
        color: #FFD700; /* 황금색 */
        text-shadow: 0 0 8px rgba(255, 215, 0, 0.9);
        box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.5);
        border-color: #FFD700;
        background-color: #555; /* 일시적으로 배경을 조금 밝게 */
    }
    100% {
        color: inherit; /* 원래 글자색으로 복귀 */
        text-shadow: none;
        box-shadow: none;
        border-color: #ccc;
        background-color: #444; /* 원래 배경색 */
    }
}

/* NEW 기능을 포함하는 라벨 스타일 */
.new-feature-label {
    position: relative; /* 자식 요소(배지)의 기준점이 됩니다. */
    overflow: visible; /* 배지가 라벨 영역 밖으로 나가도 보이게 합니다. */
}

/* 만화 스타일 NEW 배지 */
.new-badge {
    position: absolute;
    top: -12px;  /* 라벨 위쪽으로 배치 */
    left: 33px;   /* 왼쪽으로 살짝 이동 */
    
    /* 텍스트 스타일 */
    color: #ff0000; /* 빨간색 글씨 */
    font-size: 14px;
    font-weight: 900;
    font-family: 'Impact', 'Comic Sans MS', sans-serif; /* 만화 느낌의 두꺼운 폰트 */
    font-style: italic;
    line-height: 1;
    white-space: nowrap;

    /* 만화책 효과 테두리 및 그림자 */
    /* 여러 겹의 text-shadow를 사용하여 노란색 테두리와 검은색 입체감을 만듭니다. */
    text-shadow: 
        2px 2px 0 #ffeb3b, 
       -2px -2px 0 #ffeb3b, 
        2px -2px 0 #ffeb3b, 
       -2px 2px 0 #ffeb3b, /* 노란색 테두리 */
        4px 4px 0 #000000; /* 검은색 입체 그림자 */

    /* 약간 기울여서 역동적인 느낌 주기 */
    transform: rotate(-8deg);

    /* 둥둥 떠다니는 애니메이션 적용 */
    animation: float-bounce 1.5s ease-in-out infinite alternate;
    
    z-index: 10; /* 다른 요소들 위에 표시 */
    pointer-events: none; /* 마우스 클릭이 통과되도록 설정 */
}

/* 둥둥 떠다니는 애니메이션 키프레임 */
@keyframes float-bounce {
    from {
        transform: translateY(0) rotate(-8deg);
    }
    to {
        transform: translateY(-6px) rotate(-8deg); /* 위로 살짝 올라감 */
    }
}
