/* ==========================================================================
   GAS ERP MANAGEMENT SYSTEM - STYLESHEET
   Accurately modeled after the Excel Dashboard & Management Sheets
   ========================================================================== */

:root {
  --primary-color: #1b4d3e;      /* Excel GAS 관리 헤더 색상 */
  --navy-header: #103254;        /* Excel 대시보드 테이블 헤더 색상 */
  --banner-yellow: #ffff00;      /* Excel 상단 공지 노란색 */
  --bg-light: #f4f6f9;
  --card-bg: #ffffff;
  --text-main: #212529;
  --text-muted: #6c757d;
  --border-color: #dcdfe6;
  
  /* Status Colors */
  --status-usable-bg: #d4edda;
  --status-usable-text: #155724;
  --status-inuse-bg: #8c1d1d;
  --status-inuse-text: #ffffff;
  --status-empty-bg: #e2e8f0;
  --status-empty-text: #2d3748;
  
  /* Location Pill Colors (Matching Excel) */
  --loc-dark-bg: #2d3748;
  --loc-blue-bg: #195bbd;
  --loc-purple-bg: #7f3b89;
  
  /* Font Family */
  --font-family: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", Pretendard, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.4;
  font-size: 13px;
}

/* Header */
.app-header {
  background-color: #0f172a; /* Slate Navy (Gas default) */
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid #0284c7; /* Gas theme blue accent */
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

body.theme-parts .app-header {
  background-color: #18181b !important; /* Charcoal Zinc (Parts theme) */
  border-bottom: 3px solid #ea580c !important; /* Industrial Orange accent */
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-box {
  background-color: #10b981; /* Emerald green for Gas */
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  padding: 3px 9px;
  border-radius: 5px;
  letter-spacing: 1px;
  transition: background-color 0.2s ease;
}

body.theme-parts .logo-box {
  background-color: #ea580c !important; /* Orange for Parts */
}

.header-title-box h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0;
}

.header-title-box .sub-text {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}

/* Header Sync Pill */
.header-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.15s ease;
}

.header-sync-pill:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

body.theme-parts .sync-dot {
  background: #ea580c !important;
  box-shadow: 0 0 6px #ea580c !important;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.1);
  padding: 3px;
  border-radius: 6px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #d1e7dd;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.tab-btn.active {
  background: #ffffff;
  color: #0f2c22;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.network-badge {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 11.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.network-badge:hover {
  background: rgba(255,255,255,0.25);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #2ecc71;
  border-radius: 50%;
  box-shadow: 0 0 6px #2ecc71;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.user-badge input {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #ced4da;
  font-size: 13px;
  width: 90px;
  font-weight: 600;
}

.btn-refresh {
  background: #27ae60;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-refresh:hover {
  background: #219653;
}

/* Notification Banner (Excel Style) */
.notice-banner {
  background-color: var(--banner-yellow);
  color: #000;
  padding: 6px 18px;
  border-bottom: 2px solid #e0e000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.notice-title-box {
  display: flex;
  align-items: center;
  gap: 5px;
}

.notice-title-icon {
  font-size: 14px;
}

.quarter-select {
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 800;
  color: #0f2c22;
  background-color: #ffffff;
  border: 1.5px solid #27ae60;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.quarter-select:hover {
  border-color: #1e7e34;
}

.notice-title-suffix {
  font-size: 13.5px;
  font-weight: 800;
  color: #111;
  margin-left: 2px;
}

.notice-title {
  font-size: 14px;
  font-weight: 800;
  color: #111;
}

.notice-desc {
  font-size: 12px;
  font-weight: 600;
  color: #c00000; /* Deep red notice text */
}

.auto-sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #333;
}

.sync-mode-badge {
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.12);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
}

.btn-sync-refresh {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #0f2c22;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sync-refresh:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.last-sync {
  color: #555;
}

/* Main Container */
.main-container {
  width: 98%;
  max-width: 1920px;
  margin: 8px auto;
  padding: 0 8px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.kpi-card {
  background: #ffffff;
  border-radius: 6px;
  padding: 6px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-total { border-top: 3px solid #795548; }
.kpi-unused { border-top: 3px solid #27ae60; }
.kpi-inuse { border-top: 3px solid #e74c3c; }
.kpi-empty { border-top: 3px solid #2980b9; }

.kpi-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.kpi-icon {
  font-size: 14px;
}

.kpi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-green { background-color: #27ae60; }
.dot-red { background-color: #e74c3c; }
.dot-blue { background-color: #2980b9; }

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: #495057;
}

.kpi-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.green-text { color: #1e7e34; }
.red-text { color: #bd2130; }
.blue-text { color: #1b6ec2; }

.kpi-value .unit {
  font-size: 13px;
  font-weight: 600;
  color: #6c757d;
  margin-left: 2px;
}

/* Dashboard 2-Column Grid */
.dashboard-body-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 8px;
}

@media (max-width: 1200px) {
  .dashboard-body-grid {
    grid-template-columns: 1fr;
  }
}

.panel-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 16px;
  overflow: hidden;
}

.panel-title {
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title.navy-title {
  background-color: var(--navy-header);
  color: #ffffff;
}

.panel-title.info-title {
  background-color: #e8f4fd;
  color: #0d47a1;
  border-bottom: 1px solid #bbdefb;
}


/* Dashboard Detail Header & Single-Line Compact Filter Bar */
.dash-detail-header {
  padding: 6px 14px;
  background-color: var(--navy-header);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 6px 6px 0 0;
  gap: 10px;
}

.dash-detail-header .panel-title {
  margin: 0;
  padding: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
}

.dash-filter-bar {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 6px 10px !important;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  overflow-x: auto;
  box-sizing: border-box;
  width: 100%;
}

.dash-filter-bar .filter-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  font-size: 13px !important;
  color: #334155;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.dash-filter-bar .filter-group label {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #475569 !important;
  margin: 0 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.dash-filter-bar select {
  height: 34px !important;
  padding: 4px 8px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 5px !important;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  flex-shrink: 0 !important;
  box-sizing: border-box;
}

.dash-filter-bar select#dashFilterStatus {
  width: 82px !important;
}

.dash-filter-bar select#dashFilterQuarter {
  width: 92px !important;
}

.dash-filter-bar select#dashFilterLocation {
  width: 98px !important;
}

.dash-filter-bar select#dashFilterGas {
  width: 88px !important;
}

.dash-filter-bar select#dashSortSelect {
  width: 110px !important;
}

.dash-filter-bar .search-group {
  display: inline-flex !important;
  align-items: center !important;
  flex: 1 1 145px !important;
  min-width: 135px !important;
  max-width: 185px !important;
  margin-left: 2px !important;
}

.dash-filter-bar .search-group input {
  width: 100% !important;
  height: 34px !important;
  padding: 4px 10px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  border: 1.5px solid #94a3b8 !important;
  border-radius: 5px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  outline: none;
  box-sizing: border-box;
}

.dash-filter-bar .search-group input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

.panel-header-flex {
  background-color: var(--navy-header);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-header-flex .panel-title {
  padding: 0;
  background: none;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #ffffff;
}

.filter-group select, .search-group input {
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid #ced4da;
  font-size: 13px;
  background: #fff;
  color: #333;
}

.search-group input {
  width: 160px;
}

/* Tables */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.detail-table-scroll {
  max-height: 520px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
}

th, td {
  padding: 4px 6px;
  border: 1px solid #e2e8f0;
}

/* Summary Table Styling */
.summary-table thead th {
  background-color: var(--navy-header);
  color: #ffffff;
  font-weight: 700;
  padding: 10px;
}

.summary-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

.summary-table tbody tr:hover {
  background-color: #edf2f7;
}

.summary-total-row {
  background-color: #e2e8f0;
  font-weight: 800;
}

.summary-total-row td {
  border-top: 2px solid #cbd5e0;
}

/* Detail Table Styling */

/* Detail Table Compact 1080p Responsive Styling */
.detail-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

.detail-table th, .detail-table td {
  padding: 3px 4px !important;
  font-size: 11.5px !important;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
  box-sizing: border-box;
}

.detail-table thead th {
  background-color: #1a446c;
  color: #ffffff;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 5px 3px !important;
  font-size: 11.5px !important;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}

.detail-table tbody tr {
  height: 27px;
}

.detail-table tbody tr:nth-child(even) {
  background-color: #fcfcfc;
}

.detail-table tbody tr:hover {
  background-color: #f0f7ff;
}

.detail-table .col-cyl-no {
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 11.5px;
  color: #0d47a1;
  white-space: nowrap;
}

.detail-table .col-remarks {
  text-align: left;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #475569;
  font-size: 11px;
}

.detail-table .badge-gas {
  font-size: 10.5px !important;
  padding: 1px 4px !important;
  white-space: nowrap;
}

.detail-table .badge-loc {
  font-size: 10.5px !important;
  padding: 1px 4px !important;
  white-space: nowrap;
}

.detail-table .badge-status {
  font-size: 10px !important;
  padding: 1px 4px !important;
  white-space: nowrap;
}

.detail-table thead th {
  background-color: #1a446c;
  color: #ffffff;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 2;
}

.detail-table tbody tr:nth-child(even) {
  background-color: #fcfcfc;
}

.detail-table tbody tr:hover {
  background-color: #f0f7ff;
}

.table-footer-info {
  padding: 8px 16px;
  background: #f8f9fa;
  font-size: 13px;
  color: #555;
  border-top: 1px solid var(--border-color);
  text-align: right;
}

/* Guide Notice Box */
.notice-box {
  background: #ffffff;
}

.guide-list {
  padding: 16px 20px 16px 36px;
  line-height: 1.8;
  color: #333;
  font-size: 13px;
}

.guide-list li {
  margin-bottom: 6px;
}

/* Badges */
.badge-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
}

.badge-usable {
  background-color: var(--status-usable-bg);
  color: var(--status-usable-text);
  border: 1px solid #c3e6cb;
}

.badge-inuse {
  background-color: var(--status-inuse-bg);
  color: var(--status-inuse-text);
}

.badge-empty {
  background-color: var(--status-empty-bg);
  color: var(--status-empty-text);
}

.badge-loc {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background-color: var(--loc-dark-bg);
}

.badge-loc-blue {
  background-color: var(--loc-blue-bg);
}

.badge-loc-purple {
  background-color: var(--loc-purple-bg);
}

.badge-gas {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.gas-n2 { background-color: #e1f5fe; color: #0277bd; }
.gas-o2 { background-color: #e0f2f1; color: #00695c; }
.gas-mix500 { background-color: #fff3e0; color: #e65100; }
.gas-n400 { background-color: #f1f8e9; color: #33691e; }
.gas-mix200 { background-color: #fbe9e7; color: #d84315; }
.gas-no2 { background-color: #ede7f6; color: #512da8; }

/* MANAGE TAB STYLES */
.manage-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.manage-toolbar {
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background-color: #fafbfc;
  flex-wrap: wrap;
  gap: 8px;
}

.manage-logo {
  background-color: var(--primary-color);
  color: #ffffff;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 15px;
  letter-spacing: -0.5px;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-filter-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-filter-inline select, .search-filter-inline input {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ced4da;
  font-size: 13px;
}

.btn {
  padding: 6px 14px;
  border-radius: 5px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: #27ae60;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #219653;
}

.btn-secondary {
  background-color: #4a5568;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #2d3748;
}

.btn-outline {
  background-color: #ffffff;
  border: 1px solid #cbd5e0;
  color: #4a5568;
}

.btn-outline:hover {
  background-color: #edf2f7;
  border-color: #a0aec0;
}

.btn-sm {
  padding: 3px 8px;
  font-size: 12px;
}

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

.btn-danger-sm:hover {
  background: #fff5f5;
  border-color: #fc8181;
}

.btn-edit-sm {
  background: #fff;
  border: 1px solid #bee3f8;
  color: #2b6cb0;
}

.btn-edit-sm:hover {
  background: #ebf8ff;
  border-color: #63b3ed;
}

/* Manage Table Styling (Matching Excel GAS관리 Header) */
.manage-grid-wrapper {
  max-height: 650px;
  overflow-y: auto;
}

.manage-table thead th {
  background-color: #1b4d3e; /* Excel green */
  color: #ffffff;
  font-weight: 700;
  padding: 10px 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  border-color: #164033;
}

.manage-table tbody tr:hover {
  background-color: #f7fafc;
}

.manage-table td {
  padding: 6px 8px;
}

.manage-footer {
  padding: 12px 18px;
  background-color: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #4a5568;
}

/* Dropdown Menu */
.batch-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  background-color: #ffffff;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 6px;
  border: 1px solid var(--border-color);
  padding: 6px 0;
  margin-top: 4px;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 8px 16px;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.dropdown-menu a:hover {
  background-color: #f1f5f9;
}

.dropdown-divider {
  height: 1px;
  background-color: #e2e8f0;
  margin: 4px 0;
}

.text-danger {
  color: #e53e3e !important;
}

/* History Table */
.history-table thead th {
  background-color: var(--navy-header);
  color: #ffffff;
  font-weight: 700;
  padding: 10px;
}

.history-table tbody td {
  padding: 8px 12px;
  font-size: 13px;
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: 8px;
  width: 94%;
  max-width: 820px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.3);
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 92vh;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 14px 20px;
  background: #0f2c22;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.form-group .required {
  color: #e53e3e;
}

.form-group input, .form-group select {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 13.5px;
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: #27ae60;
  box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2);
}

.modal-footer {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* File Drop Area */
.file-drop-area {
  border: 2px dashed #cbd5e0;
  border-radius: 6px;
  padding: 30px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
}

/* Network Access Box */
.network-url-box {
  background: #eef4ff;
  border: 1px solid #c7d7fc;
  border-radius: 6px;
  padding: 14px;
}

.url-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #b8cefc;
  padding: 8px 12px;
  border-radius: 5px;
  margin-bottom: 6px;
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
  color: #1e40af;
}

.url-copy-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

/* Windows Auth Badge */
.badge-win {
  background-color: #0078d4;
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Location Badge Color Mapping from Google Sheet Tags */
.badge-loc-charcoal { background-color: #2d3748; color: #fff; }
.badge-loc-skyblue  { background-color: #0288d1; color: #fff; }
.badge-loc-yellow   { background-color: #f59e0b; color: #000; font-weight: 700; }
.badge-loc-pink     { background-color: #ec4899; color: #fff; }
.badge-loc-grey     { background-color: #64748b; color: #fff; }
.badge-loc-green    { background-color: #166534; color: #fff; }
.badge-loc-lime     { background-color: #4d7c0f; color: #fff; }
.badge-loc-purple   { background-color: #7e22ce; color: #fff; }

/* Combobox & Calendar Styling */
.combobox-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
}

.combobox-wrap input {
  flex: 1;
  min-width: 0;
}

.combobox-wrap select {
  width: 190px;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-weight: 500;
  cursor: pointer;
}

.date-picker-wrap {
  display: flex;
  gap: 4px;
  align-items: center;
  position: relative;
}

.date-picker-wrap input[type="text"] {
  flex: 1;
}

.hidden-cal-native {
  position: absolute;
  visibility: hidden;
  width: 0;
  height: 0;
  border: none;
  padding: 0;
}

.btn-cal-picker {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 7px 11px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s;
}

.btn-cal-picker:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

/* 5-Card KPI Grid */
.kpi-grid-5 {
  grid-template-columns: repeat(5, 1fr) !important;
}

@media (max-width: 1200px) {
  .kpi-grid-5 {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

.kpi-used { border-top: 4px solid #f57c00; }
.dot-orange { background-color: #f57c00; }
.orange-text { color: #d97706; }
.badge-used { background-color: #fef3c7; color: #b45309; border: 1px solid #fde68a; }

/* Location Badges Matching Google Sheet Exact Colors */
.badge-loc-charcoal   { background-color: #334155; color: #ffffff; }
.badge-loc-pastelblue { background-color: #e0f2fe; color: #0369a1; font-weight: 700; border: 1px solid #bae6fd; }
.badge-loc-yellow     { background-color: #fef9c3; color: #a16207; font-weight: 700; border: 1px solid #fef08a; }
.badge-loc-pink       { background-color: #fce7f3; color: #be185d; font-weight: 700; border: 1px solid #fbcfe8; }
.badge-loc-lightgrey  { background-color: #f1f5f9; color: #475569; font-weight: 700; border: 1px solid #cbd5e1; }
.badge-loc-vividblue  { background-color: #1d4ed8; color: #ffffff; }
.badge-loc-darkgreen  { background-color: #15803d; color: #ffffff; }
.badge-loc-lime       { background-color: #ecfccb; color: #4d7c0f; font-weight: 700; border: 1px solid #d9f99d; }
.badge-loc-purple     { background-color: #6b21a8; color: #ffffff; }
.badge-loc-white      { background-color: #ffffff; color: #1e293b; font-weight: 700; border: 1px solid #94a3b8; }

/* ==========================================================================
   1080p FHD & Inline Table Input Styles
   ========================================================================== */
.btn-success {
  background-color: #16a34a;
  color: #ffffff;
}
.btn-success:hover {
  background-color: #15803d;
}

.req {
  color: #ef4444;
  font-weight: bold;
}

.inline-new-row {
  background-color: #f0fdf4 !important;
  border-top: 2px solid #22c55e !important;
  border-bottom: 2px solid #22c55e !important;
}

.inline-new-row td {
  padding: 8px 6px !important;
  background-color: #f0fdf4 !important;
  vertical-align: middle;
}

.inline-control {
  width: 100%;
  padding: 7px 9px;
  border: 1.5px solid #86efac;
  border-radius: 4px;
  font-size: 13px;
  background: #ffffff;
  color: #1e293b;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.inline-control:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
  background: #ffffff;
}

.inline-control.is-invalid {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
}

.badge-new-pill {
  background: #16a34a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-block;
  letter-spacing: 0.5px;
}

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

/* Inline Edit Row for existing cylinders */
.inline-edit-row {
  background-color: #eff6ff !important;
  border-top: 2px solid #3b82f6 !important;
  border-bottom: 2px solid #3b82f6 !important;
}

.inline-edit-row td {
  padding: 8px 6px !important;
  background-color: #eff6ff !important;
  vertical-align: middle;
}

.inline-edit-control {
  width: 100%;
  padding: 6px 8px;
  border: 1.5px solid #93c5fd;
  border-radius: 4px;
  font-size: 13px;
  background: #ffffff;
  color: #1e293b;
  outline: none;
  box-sizing: border-box;
}

.inline-edit-control:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.inline-edit-control.is-invalid {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}


.options-add-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.options-add-bar input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

.options-add-bar input:focus {
  border-color: #27ae60;
  box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2);
}

.options-list-container {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}

.opt-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

.opt-item-row:hover {
  background: #f8fafc;
}

.opt-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.opt-item-actions {
  display: flex;
  gap: 6px;
}

.btn-opt-action {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-opt-action:hover {
  background: #e2e8f0;
}

.btn-opt-delete {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}

.btn-opt-delete:hover {
  background: #fee2e2;
}

/* Toast Messages */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  pointer-events: auto;
  min-width: 280px;
  max-width: 440px;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff !important;
  background-color: #1e293b;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  animation: toastFadeIn 0.25s ease-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-success {
  background-color: #16a34a !important;
}

.toast-warning {
  background-color: #d97706 !important;
}

.toast-error {
  background-color: #dc2626 !important;
}

.toast-info {
  background-color: #1e293b !important;
  border-left: 5px solid #ea580c;
}

/* Dropdown Quick Add / Delete Controls */
.dropdown-manage-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
}

.dropdown-manage-wrap select {
  flex: 1 1 auto;
  min-width: 0;
}

.btn-dd-add {
  flex: 0 0 24px;
  height: 28px;
  width: 24px;
  background: #22c55e;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background 0.15s;
}

.btn-dd-add:hover {
  background: #16a34a;
}

.btn-dd-del {
  flex: 0 0 24px;
  height: 28px;
  width: 24px;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background 0.15s;
}

.btn-dd-del:hover {
  background: #fecaca;
  color: #b91c1c;
}


/* Date Input with Calendar Icon */
.date-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.date-input-wrap input.inline-control,
.date-input-wrap input.inline-edit-control {
  width: 100% !important;
  padding-right: 28px !important;
  box-sizing: border-box;
}

.hidden-cal-native {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  opacity: 0;
  border: none;
  padding: 0;
  margin: 0;
  z-index: 1;
}

.btn-cal-icon {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  border-radius: 4px;
  line-height: 1;
  z-index: 2;
  transition: all 0.15s ease-in-out;
}

.btn-cal-icon:hover {
  color: #2563eb;
  background-color: #e2e8f0;
}

.btn-cal-icon svg {
  display: block;
}


/* ==========================================================================
   GOOGLE SHEETS-STYLE DROPDOWN EDITOR
   ========================================================================== */
.gs-module-switcher {
  display: flex;
  gap: 8px;
  padding: 10px 16px 0;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.gs-module-btn {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.gs-module-btn:hover {
  color: #0284c7;
}

.gs-module-btn.active {
  background: #fff;
  color: #0284c7;
  border-color: #0284c7 #0284c7 #fff #0284c7;
  border-top: 2.5px solid #0284c7;
}

.gs-dropdown-modal-card {
  max-width: 520px !important;
  width: 95% !important;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.3);
  background: #ffffff;
}

.gs-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.gs-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gs-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.gs-category-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 6px 12px 0 12px;
  border-bottom: 1px solid #e2e8f0;
  gap: 6px;
}

.gs-tab {
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.gs-tab:hover {
  color: #1e293b;
  background: #e2e8f0;
}

.gs-tab.active {
  color: #2563eb;
  background: #ffffff;
  border-bottom: 2px solid #2563eb;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

.gs-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.gs-modal-guide {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #2563eb;
}

.gs-items-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  max-height: 45vh;
  overflow-y: auto;
  padding-right: 4px;
}


/* Dropdown Item Drag & Drop and Reorder Buttons */
.gs-drag-handle {
  cursor: grab !important;
  color: #64748b;
  font-size: 16px;
  user-select: none;
  padding: 0 4px;
  touch-action: none;
}

.gs-drag-handle:active {
  cursor: grabbing !important;
}

.gs-item-row.gs-dragging {
  opacity: 0.45 !important;
  background-color: #f1f5f9 !important;
  border: 1px dashed #2563eb !important;
}

.gs-item-row.gs-drag-over {
  border-top: 2.5px solid #2563eb !important;
  background-color: #eff6ff !important;
}

.gs-order-btns {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  margin-right: 4px;
  flex-shrink: 0;
}

.btn-gs-order {
  padding: 0 4px;
  font-size: 8.5px;
  height: 12px;
  line-height: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.12s;
}

.btn-gs-order:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

.btn-gs-order:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.gs-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  transition: border-color 0.15s, background-color 0.15s;
}

.gs-item-row:hover {
  border-color: #cbd5e1;
  background-color: #f8fafc;
}

.gs-drag-handle {
  color: #94a3b8;
  font-size: 14px;
  cursor: grab;
  user-select: none;
  padding: 0 4px;
}

.gs-item-num {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  width: 22px;
  text-align: center;
  background: #f1f5f9;
  padding: 2px 4px;
  border-radius: 4px;
}

.gs-item-input {
  flex: 1;
  border: 1px solid transparent;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  border-radius: 4px;
  background: transparent;
  outline: none;
  transition: all 0.15s;
}

.gs-item-input:focus {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.gs-btn-del-item {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.gs-btn-del-item:hover {
  color: #dc2626;
  background: #fee2e2;
}

.gs-btn-add-item {
  width: 100%;
  padding: 9px 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.gs-btn-add-item:hover {
  background: #eff6ff;
  border-color: #3b82f6;
}

.gs-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.gs-status-text {
  font-size: 12px;
  color: #64748b;
}

.gs-footer-right {
  display: flex;
  gap: 8px;
}

/* Header gear/edit button */
.btn-hdr-gear {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 5px;
  color: #475569;
  border-radius: 4px;
  margin-left: 5px;
  line-height: 1;
  vertical-align: middle;
  transition: all 0.15s;
}

.btn-hdr-gear:hover {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}


/* Sort Headers and Icons */
.sort-icon {
  display: inline-block;
  font-size: 11px;
  color: #2563eb;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: bold;
}

th[onclick] {
  user-select: none;
  cursor: pointer;
  transition: background-color 0.15s;
}

th[onclick]:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.manage-table th[onclick]:hover {
  background-color: rgba(0, 0, 0, 0.04);
}


/* ==========================================================================
   SYNOLOGY NAS LOGIN MODAL STYLES
   ========================================================================== */
.syno-login-card {
  max-width: 440px !important;
  width: 90% !important;
  padding: 0 !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.4);
  background: #ffffff;
}

.syno-login-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: #0f172a;
  color: #ffffff;
}

.syno-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.syno-logo-icon {
  background: rgba(37, 99, 235, 0.2);
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.syno-login-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.syno-login-subtitle {
  font-size: 11px;
  color: #94a3b8;
}

.syno-login-body {
  padding: 24px;
}

.syno-login-info {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid #2563eb;
  margin-bottom: 20px;
}

.syno-login-error {
  margin-top: 14px;
  padding: 10px 14px;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

.syno-login-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.badge-syno {
  background-color: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
}

/* ==========================================================================
   STORAGE LOCATION KPI BAR & SUMMARY TABLE (1GHT / 2GHT / 3HMU / VDU)
   ========================================================================== */
.storage-kpi-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  background: #ffffff;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  align-items: center;
}

.storage-kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.storage-kpi-pill:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.storage-kpi-pill.active {
  background: #1a446c;
  color: #ffffff;
  border-color: #0f2d4a;
  box-shadow: 0 2px 4px rgba(26,68,108,0.25);
}

.storage-kpi-pill.active .pill-sub {
  color: #93c5fd;
}

.storage-kpi-pill.active .pill-count {
  background: #ffffff;
  color: #1a446c;
}

.pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-gray { background: #94a3b8; }

.pill-title {
  font-weight: 700;
}

.pill-count {
  background: #0f172a;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 2px;
}

.pill-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-left: 2px;
}

/* Storage Summary Table */
.storage-summary-table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.storage-summary-table tbody tr:hover {
  background-color: #f0fdf4 !important;
}

.storage-summary-table tbody tr.active-storage-row {
  background-color: #e0f2fe !important;
  outline: 2px solid #0284c7;
}

.storage-table-footer-hint {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 8px;
  padding-left: 4px;
}

/* ==========================================================================
   DASHBOARD DETAIL GAS BREAKDOWN BAR & CARDS (종류별 누계 집계 바)
   ========================================================================== */
.dash-detail-breakdown {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 16px;
  animation: fadeIn 0.2s ease;
}

.dash-breakdown-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-breakdown-title {
  font-size: 13.5px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-breakdown-target {
  font-weight: 700;
  color: #0369a1;
}

.dash-breakdown-total {
  font-weight: 800;
  color: #0f172a;
  background: #e2e8f0;
  padding: 1px 8px;
  border-radius: 12px;
  font-size: 12.5px;
  margin-left: 2px;
}

.dash-breakdown-hint {
  font-size: 11.5px;
  color: #64748b;
}

.dash-breakdown-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.gas-summary-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.gas-summary-card:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.gas-summary-card.active-gas-card {
  border-color: #0284c7;
  background: #e0f2fe;
  box-shadow: 0 0 0 1.5px #0284c7;
}

.gas-card-count {
  font-size: 13px;
  color: #0f172a;
}

.gas-card-count strong {
  font-size: 15px;
  font-weight: 800;
  color: #0284c7;
}

.gas-card-detail {
  font-size: 11.5px;
  color: #64748b;
  border-left: 1px solid #e2e8f0;
  padding-left: 8px;
  margin-left: 2px;
}

.btn-show-all-gases {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
  color: #475569;
  font-weight: 600;
  transition: all 0.15s;
}
.btn-show-all-gases:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.dash-detail-breakdown.empty-breakdown {
  color: #64748b;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
}

.footer-gas-text {
  font-size: 13px;
  color: #0369a1;
  font-weight: 700;
  margin-left: 6px;
}

.summary-table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.summary-table tbody tr:hover {
  background-color: #f0fdf4 !important;
}

.summary-table tbody tr.active-gas-row {
  background-color: #e0f2fe !important;
  outline: 2px solid #0284c7;
}

/* Interactive Summary Table Cells (Cell-level Click Filtering) */
.cell-clickable {
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.cell-clickable:hover {
  background-color: #dbeafe !important;
  color: #0284c7 !important;
  font-weight: 800 !important;
  box-shadow: inset 0 0 0 1.5px #0284c7;
}

.cell-clickable.active-cell {
  background-color: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: inset 0 0 0 2px #0369a1;
}

.row-name-clickable {
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.row-name-clickable:hover {
  background-color: #e0f2fe !important;
  color: #0284c7 !important;
  text-decoration: underline;
}

.row-name-clickable.active-cell {
  background-color: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
}

.row-name-clickable.active-cell strong {
  color: #ffffff !important;
}

.active-summary-row td:first-child {
  border-left: 3.5px solid #0284c7 !important;
}

.kpi-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

/* ==========================================================================
   MOBILE & FIELD ON-SITE RESPONSIVE OPTIMIZATION (< 768px)
   ========================================================================== */
/* Dashboard Detail Header & Single-Line Compact Filter Bar */
.dash-detail-header {
  padding: 6px 14px;
  background-color: var(--navy-header);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 6px 6px 0 0;
  gap: 10px;
}

.dash-detail-header .panel-title {
  margin: 0;
  padding: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
}

.dash-filter-bar {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 6px 10px !important;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  overflow-x: auto;
  box-sizing: border-box;
  width: 100%;
}

.dash-filter-bar .filter-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  font-size: 13px !important;
  color: #334155;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.dash-filter-bar .filter-group label {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #475569 !important;
  margin: 0 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.dash-filter-bar select {
  height: 34px !important;
  padding: 4px 8px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 5px !important;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  flex-shrink: 0 !important;
  box-sizing: border-box;
}

.dash-filter-bar select#dashFilterStatus {
  width: 82px !important;
}

.dash-filter-bar select#dashFilterQuarter {
  width: 92px !important;
}

.dash-filter-bar select#dashFilterLocation {
  width: 98px !important;
}

.dash-filter-bar select#dashFilterGas {
  width: 88px !important;
}

.dash-filter-bar select#dashSortSelect {
  width: 110px !important;
}

.dash-filter-bar .search-group {
  display: inline-flex !important;
  align-items: center !important;
  flex: 1 1 145px !important;
  min-width: 135px !important;
  max-width: 185px !important;
  margin-left: 2px !important;
}

.dash-filter-bar .search-group input {
  width: 100% !important;
  height: 34px !important;
  padding: 4px 10px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  border: 1.5px solid #94a3b8 !important;
  border-radius: 5px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  outline: none;
  box-sizing: border-box;
}

.dash-filter-bar .search-group input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}



/* Returned status badge & Return button */
.badge-returned {
  background-color: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.btn-warning-sm {
  border-color: #d97706 !important;
  color: #b45309 !important;
  padding: 2px 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  margin-right: 3px;
}

.btn-warning-sm:hover {
  background-color: #d97706 !important;
  color: #ffffff !important;
}

.badge-quarter {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}


/* ==========================================================================
   MASTER MODULE SWITCHER & PARTS REPLACEMENT MODULE STYLES
   ========================================================================== */
.master-module-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 3px;
  gap: 3px;
  margin-right: 14px;
}

.btn-master-module {
  background: transparent;
  color: #cbd5e1;
  border: none;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-master-module:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.btn-master-module.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.parts-toolbar-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.parts-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.parts-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.parts-form-grid {
  display: grid;
  grid-template-columns: 140px 220px 200px 140px 110px 1fr 95px;
  gap: 8px;
  align-items: flex-end;
  width: 100%;
}

.parts-form-grid .form-group {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}

.parts-form-grid .form-group label {
  font-size: 11.5px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 3px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.parts-form-grid select,
.parts-form-grid input[type="text"] {
  width: 100% !important;
  box-sizing: border-box !important;
  height: 33px !important;
  font-size: 12px !important;
  padding: 4px 6px !important;
  border: 1px solid #86efac !important;
  border-radius: 4px !important;
  background-color: #fff !important;
}

.parts-form-grid select:focus,
.parts-form-grid input[type="text"]:focus {
  border-color: #16a34a !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25) !important;
}

.parts-form-grid .date-input-wrap {
  position: relative !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
}

.parts-form-grid .date-input-wrap input {
  width: 100% !important;
  box-sizing: border-box !important;
  padding-right: 28px !important;
  height: 33px !important;
}

.parts-form-grid .btn-cal-icon {
  position: absolute !important;
  right: 5px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0 !important;
  font-size: 14px !important;
  line-height: 1 !important;
}

#partsNewStatus {
  font-weight: 700 !important;
  text-align-last: center;
}

.btn-label-edit {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  font-size: 11px;
  color: #15803d;
  opacity: 0.7;
  border-radius: 3px;
  transition: all 0.15s;
}

.btn-label-edit:hover {
  opacity: 1;
  transform: scale(1.15);
  background: #dcfce7;
}

/* Parts Options Modal Styling */
.parts-opt-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 14px;
  background: #f8fafc;
  padding: 6px 6px 0;
  border-radius: 6px 6px 0 0;
}

.parts-opt-tab-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  margin-bottom: -2px;
}

.parts-opt-tab-btn:hover {
  color: #0284c7;
}

.parts-opt-tab-btn.active {
  color: #0284c7;
  font-weight: 700;
  border-bottom-color: #0284c7;
  background: #fff;
  border-radius: 4px 4px 0 0;
}

.parts-opt-list-box {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
}

.parts-opt-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.parts-opt-item-row:last-child {
  border-bottom: none;
}

.parts-opt-item-row:hover {
  background: #f8fafc;
}

.parts-opt-add-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.parts-opt-add-bar input {
  flex: 1;
  height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}

.parts-opt-add-bar button {
  height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 700;
}

.parts-matrix-container {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
}

.matrix-system-block {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
  background: #f8fafc;
}

.matrix-system-header {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.matrix-parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px;
}

.matrix-part-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 5px 8px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.matrix-part-chip:hover {
  border-color: #0284c7;
  background: #f0f9ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.chip-part-name {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.chip-date {
  color: #64748b;
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.badge-part-new {
  background: #dcfce7;
  color: #15803d;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  border: 1px solid #86efac;
}

.badge-part-used {
  background: #fef3c7;
  color: #b45309;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  border: 1px solid #fcd34d;
}

.parts-history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 12px;
}

.parts-history-table th {
  background: #1e293b;
  color: #ffffff;
  font-weight: 700;
  padding: 6px 8px;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.parts-history-table td {
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
}

.parts-history-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.parts-history-table tbody tr:hover {
  background: #f0f9ff;
}


/* ==========================================================================
   THEME STYLES: GAS (BLUE/EMERALD) vs PARTS (CHARCOAL/ORANGE)
   ========================================================================== */

/* Active master module switcher buttons */
.btn-master-module.active#btnModuleGas {
  background: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.4) !important;
}

.btn-master-module.active#btnModuleParts {
  background: #ea580c !important;
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(234, 88, 12, 0.4) !important;
}

/* Sub-nav tabs active states */
#gasNavTabs .tab-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
}

#partsNavTabs {
  display: flex;
  gap: 4px;
}

#partsNavTabs .tab-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border: none;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

#partsNavTabs .tab-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

#partsNavTabs .tab-btn.active {
  background: #ea580c !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* Parts Top 5 KPI Cards (Matching Gas layout, Orange/Amber palette) */
.parts-kpi-grid {
  margin-top: 10px;
  margin-bottom: 12px;
}

.parts-kpi-grid .kpi-card {
  border-radius: 8px;
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  border: 1px solid #e2e8f0;
  transition: transform 0.15s, box-shadow 0.15s;
}

.parts-kpi-grid .kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.parts-kpi-stack {
  border-top: 3.5px solid #ea580c !important;
}

.parts-kpi-system {
  border-top: 3.5px solid #f59e0b !important;
}

.parts-kpi-master {
  border-top: 3.5px solid #d97706 !important;
}

.parts-kpi-new {
  border-top: 3.5px solid #16a34a !important;
}

.parts-kpi-used {
  border-top: 3.5px solid #eab308 !important;
}

/* Parts Toolbar, Form, Matrix Theme Adjustments */
body.theme-parts .parts-toolbar-card {
  border-left: 4px solid #ea580c;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

body.theme-parts .parts-toolbar-left label {
  color: #ea580c !important;
}

body.theme-parts .btn-primary {
  background: #ea580c !important;
  border-color: #ea580c !important;
}

body.theme-parts .btn-primary:hover {
  background: #c2410c !important;
  border-color: #c2410c !important;
}

body.theme-parts .btn-outline {
  color: #ea580c !important;
  border-color: #fdba74 !important;
}

body.theme-parts .btn-outline:hover {
  background: #fff7ed !important;
  border-color: #ea580c !important;
}

body.theme-parts #partsNewCard {
  background: #fffbeb !important;
  border: 1.5px solid #fcd34d !important;
}

body.theme-parts #partsNewCard strong {
  color: #b45309 !important;
}

body.theme-parts #partsNewCard label {
  color: #b45309 !important;
}

body.theme-parts #partsMatrixPanel .panel-header-flex {
  background: #18181b !important;
  border-bottom: 2px solid #ea580c;
}

body.theme-parts #matrixStackTitle {
  color: #fdba74 !important;
}

body.theme-parts .matrix-system-header {
  background: #27272a !important;
  color: #ffffff !important;
  border-left: 4px solid #ea580c !important;
}

body.theme-parts .matrix-system-header span strong {
  color: #fdba74 !important;
}

body.theme-parts .matrix-part-chip:hover {
  border-color: #ea580c !important;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.2) !important;
}

/* Shake animation for login/password error feedback */
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.syno-login-error {
  margin-top: 14px;
  padding: 11px 14px;
  background-color: #fef2f2;
  border: 1.5px solid #f87171;
  color: #dc2626;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 700;
  animation: shakeError 0.35s ease-in-out;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

.parts-kpi-grid .kpi-card.kpi-active {
  box-shadow: 0 0 0 2.5px #ea580c, 0 4px 12px rgba(234, 88, 12, 0.18) !important;
  background-color: #fff7ed !important;
}


/* Clean focus management for KPI cards, toolbar selects, and buttons */
.parts-kpi-grid .kpi-card:focus,
.parts-toolbar-card .btn:focus,
.parts-toolbar-card button:focus,
.btn:focus {
  outline: none !important;
}

.parts-toolbar-card select:focus,
.parts-toolbar-card input:focus {
  outline: none !important;
  border-color: #ea580c !important;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.15) !important;
}


/* 4-Card Wide KPI Grid for Parts */
.kpi-grid-4 {
  grid-template-columns: repeat(4, 1fr) !important;
}

.parts-kpi-total {
  border-top: 3.5px solid #ea580c !important;
}

.parts-kpi-month {
  border-top: 3.5px solid #f59e0b !important;
}


/* ==========================================================================
   GAS EXPIRY WARNING BADGES & PARTS MATRIX SEARCH/FILTER STYLES
   ========================================================================== */
.badge-expiry-expired {
  display: inline-block;
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #f87171;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-expiry-soon {
  display: inline-block;
  background-color: #fffbeb;
  color: #d97706;
  border: 1px solid #fbbf24;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.matrix-filter-pills {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px;
  border-radius: 5px;
  gap: 3px;
}

.btn-matrix-filter {
  background: transparent;
  color: #cbd5e1;
  border: none;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-matrix-filter:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.btn-matrix-filter.active {
  background: #ea580c;
  color: #ffffff;
  font-weight: 700;
}

.matrix-part-chip.chip-aged-warning {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
}

.matrix-part-chip.chip-unreplaced {
  opacity: 0.85;
  border-style: dashed;
}

.chip-aged-badge {
  display: inline-block;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fbbf24;
  font-size: 9.5px;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 3px;
  margin-left: 3px;
}


/* ==========================================================================
   GAS CYLINDER PDF CERTIFICATE VIEWER & BUTTON STYLES
   ========================================================================== */
.btn-cyl-cert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 5px;
  padding: 2px 7px;
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.3;
}

.btn-cyl-cert.has-cert {
  background: #eff6ff;
  color: #0369a1;
  border: 1px solid #7dd3fc;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.08);
}

.btn-cyl-cert.has-cert:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  transform: translateY(-1px);
}

.btn-cyl-cert.no-cert {
  background: transparent;
  color: #0d47a1;
  border: 1px dashed transparent;
}

.btn-cyl-cert.no-cert:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0284c7;
}

.cert-icon-badge {
  font-size: 11px;
  line-height: 1;
}

.cert-empty-tag {
  font-size: 9px;
  font-family: var(--font-family);
  font-weight: 700;
  color: #94a3b8;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 0 3px;
  opacity: 0.55;
  transition: all 0.15s ease;
}

.btn-cyl-cert.no-cert:hover .cert-empty-tag {
  opacity: 1;
  color: #0284c7;
  border-color: #38bdf8;
  background: #e0f2fe;
}

/* Certificate Viewer Modal */
.cert-viewer-modal-card {
  max-width: 1020px !important;
  width: 96% !important;
  max-height: 94vh !important;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cert-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.cert-modal-header {
  background: #0f172a !important;
  color: #ffffff !important;
  padding: 12px 18px !important;
  border-bottom: 2px solid #0284c7 !important;
}

.cert-cyl-no-pill {
  background: #0284c7;
  color: #ffffff;
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
  font-size: 14.5px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 5px;
  letter-spacing: 0.4px;
}

.cert-summary-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cert-hdr-chip {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.cert-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.cert-toolbar-left,
.cert-toolbar-center,
.cert-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cert-file-chip {
  font-size: 12.5px;
  color: #0f172a;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  padding: 3px 9px;
  border-radius: 5px;
}

.cert-meta-subtext {
  font-size: 11.5px;
  color: #64748b;
}

.cert-page-input {
  width: 58px;
  height: 28px;
  padding: 2px 6px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}

.cert-remarks-input {
  width: 145px;
  height: 28px;
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}

.cert-replace-box {
  background: #f0fdf4;
  border-bottom: 1px solid #86efac;
  padding: 8px 14px;
}

.cert-iframe-container {
  padding: 10px 14px;
  background: #334155;
}

.cert-iframe-container iframe {
  width: 100%;
  height: 68vh;
  border: none;
  border-radius: 4px;
  background: #ffffff;
  display: block;
}

.cert-img-scroll-wrap {
  width: 100%;
  height: 68vh;
  max-height: 68vh;
  overflow-y: scroll !important;
  overflow-x: auto !important;
  display: block;
  background: #1e293b;
  border-radius: 4px;
  padding: 0 14px 16px 14px;
  box-sizing: border-box;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

.cert-empty-banner {
  text-align: center;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 18px 14px;
  margin-bottom: 16px;
}

.cert-empty-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 768px) {
  .cert-empty-grid {
    grid-template-columns: 1fr;
  }
}

.cert-Action-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cert-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.cert-card-desc {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
  line-height: 1.45;
}


/* ==========================================================================
   MODULE 3: RANGE & STACK SPEC MANAGEMENT THEME (INDIGO / VIOLET)
   ========================================================================== */
body.theme-range .app-header {
  background-color: #1e1b4b !important;
  border-bottom: 3px solid #6366f1 !important;
}

body.theme-range .logo-box {
  background-color: #6366f1 !important;
}

body.theme-range .sync-dot {
  background: #818cf8 !important;
  box-shadow: 0 0 6px #818cf8 !important;
}

.btn-master-module.active#btnModuleRange {
  background: #4f46e5 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(79, 70, 229, 0.45) !important;
}

#rangeNavTabs {
  display: flex;
  gap: 4px;
}

#rangeNavTabs .tab-btn.active {
  background: #4f46e5 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* 2-Card Wide KPI Grid for Range */
.kpi-grid-2 {
  grid-template-columns: repeat(2, 1fr) !important;
}

.range-kpi-grid {
  margin-top: 10px;
  margin-bottom: 12px;
}

.range-kpi-grid .kpi-card {
  border-radius: 8px;
  padding: 12px 16px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  border: 1px solid #e2e8f0;
  transition: transform 0.15s, box-shadow 0.15s;
}

.range-kpi-grid .kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.range-kpi-total {
  border-top: 3.5px solid #4f46e5 !important;
}

.range-kpi-o2 {
  border-top: 3.5px solid #f59e0b !important;
}

.range-kpi-grid .kpi-card.kpi-active {
  box-shadow: 0 0 0 2.5px #4f46e5, 0 4px 12px rgba(79, 70, 229, 0.2) !important;
  background-color: #eef2ff !important;
}

.range-toolbar-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #4f46e5;
  border-radius: 6px;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Range Table with Split RANGE & Limit Columns and Tabular Numeric Alignment */
.range-spec-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.range-spec-table thead tr.range-th-group-row th {
  background: #1e1b4b;
  color: #ffffff;
  font-weight: 700;
  padding: 6px 5px;
  font-size: 11.5px;
  position: sticky;
  top: 0;
  z-index: 3;
  line-height: 1.25;
  border: 1px solid #312e81;
}

.range-spec-table thead tr.range-th-sub-row th {
  background: #312e81;
  color: #e0e7ff;
  font-weight: 700;
  padding: 4px 4px;
  font-size: 10.5px;
  position: sticky;
  top: 31px;
  z-index: 2;
  border: 1px solid #3730a3;
  letter-spacing: 0.2px;
}

.range-spec-table th.th-group-nox { background: #1e293b !important; border-bottom: 2px solid #38bdf8 !important; }
.range-spec-table th.th-group-so2 { background: #1e293b !important; border-bottom: 2px solid #818cf8 !important; }
.range-spec-table th.th-group-dust { background: #1e293b !important; border-bottom: 2px solid #34d399 !important; }
.range-spec-table th.th-group-co { background: #1e293b !important; border-bottom: 2px solid #fbbf24 !important; }

.range-spec-table th .th-unit {
  font-size: 10px;
  font-weight: 500;
  color: #a5b4fc;
}

.range-spec-table td {
  padding: 5px 6px;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.range-spec-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.range-spec-table tbody tr:hover {
  background: #eef2ff;
}

/* Uniform Numeric Alignment Cells */
.range-spec-table td.col-rng-num {
  text-align: right !important;
  padding-right: 10px !important;
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 12.5px;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.range-spec-table td.col-rng-limit {
  text-align: center !important;
  background-color: rgba(248, 250, 252, 0.6);
  border-right: 1.5px solid #cbd5e1;
}

.badge-rng-limit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 1px 6px;
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 800;
  border-radius: 4px;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-variant-numeric: tabular-nums;
}

.badge-rng-self {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 4px;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.badge-rng-o2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 2px 6px;
  border-radius: 10px;
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 11.5px;
  background: #e0f2fe;
  color: #0369a1;
  font-variant-numeric: tabular-nums;
}

.badge-rng-o2-none {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 11px;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-pitot {
  display: inline-block;
  min-width: 52px;
  text-align: right;
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 12.5px;
  color: #4f46e5;
  background: #eef2ff;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #c7d2fe;
  font-variant-numeric: tabular-nums;
}

/* Selectable Remark Badge Styles (Blue / Amber / Green / Plain) */
.badge-audit-change,
.badge-rem-blue {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge-o2-uncorr,
.badge-rem-amber {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fcd34d;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge-rem-green {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
}

.rng-remark-edit-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.rng-remark-style-sel {
  width: 165px !important;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 11.5px !important;
  padding: 4px 6px !important;
  background-color: #f8fafc;
}

.rng-inp-num {
  text-align: right !important;
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  padding: 5px 6px !important;
}

.rng-inp-center {
  text-align: center !important;
  font-weight: 700;
  padding: 5px 4px !important;
}


/* ==========================================================================
   2026-11-04 UNIFIED TYPOGRAPHY, FIXED HEADER/KPI POSITION LOCK & RANGE REORDER
   ========================================================================== */
:root {
  --font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Segoe UI", Roboto, sans-serif;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

*, *::before, *::after,
body, button, input, select, textarea, optgroup, option,
table, thead, tbody, tr, th, td,
code, kbd, pre, span, strong, label, div, p, a, h1, h2, h3, h4 {
  font-family: var(--font-family) !important;
}

/* Unified Table Typography Across All Tabs (Gas Dashboard, Gas Manage, Parts, Range, Audit Log) */
.summary-table th,
.detail-table thead th,
.manage-table thead th,
.parts-history-table thead th,
.range-spec-table thead tr.range-th-group-row th,
.history-table thead th {
  font-family: var(--font-family) !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.range-spec-table thead tr.range-th-sub-row th {
  font-family: var(--font-family) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  top: 32px !important;
}

.summary-table td,
.detail-table tbody td,
.manage-table tbody td,
.parts-history-table tbody td,
.range-spec-table tbody td,
.history-table tbody td {
  font-family: var(--font-family) !important;
  font-size: 12.5px !important;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.detail-table th,
.detail-table td {
  padding: 5px 6px !important;
}

.detail-table tbody tr {
  height: 31px !important;
}

.detail-table .col-cyl-no,
.btn-cyl-cert,
.cert-cyl-no-pill,
.chip-date,
.range-spec-table td.col-rng-num,
.badge-rng-limit,
.badge-rng-o2,
.badge-pitot {
  font-family: var(--font-family) !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.1px;
}

/* Lock Header, Switcher, Nav-Tabs, and KPI Grid Position Across All Tabs (Zero Jump) */
@media (min-width: 1025px) {
  .app-header {
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    padding: 0 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .header-left {
    width: 215px !important;
    min-width: 215px !important;
    max-width: 215px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    overflow: hidden !important;
  }

  .logo-box {
    width: 50px !important;
    min-width: 50px !important;
    height: 26px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    flex-shrink: 0 !important;
  }

  .header-title-box {
    min-width: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }

  .header-title-box h1 {
    font-size: 14.5px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    margin: 0 !important;
  }

  .header-title-box .sub-text {
    font-size: 10.5px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-top: 2px !important;
  }

  /* Prevent .header-center from ever shrinking smaller than its buttons so .header-right can NEVER overlap it */
  .header-center {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    height: 34px !important;
  }

  .master-module-switcher {
    margin-right: 0 !important;
    height: 34px !important;
    padding: 3px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 2px !important;
    flex-shrink: 0 !important;
  }

  .btn-master-module {
    height: 28px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
  }

  #gasNavTabs,
  #partsNavTabs,
  #rangeNavTabs {
    height: 34px !important;
    padding: 3px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    gap: 3px !important;
    align-items: center !important;
    flex-shrink: 0 !important;
  }

  #gasNavTabs .tab-btn,
  #partsNavTabs .tab-btn,
  #rangeNavTabs .tab-btn {
    height: 28px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
    color: #e2e8f0;
    background: transparent;
  }

  .header-right {
    margin-left: auto !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    height: 34px !important;
    white-space: nowrap !important;
  }

  .header-right > .btn {
    height: 28px !important;
    padding: 0 9px !important;
    font-size: 11.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .header-sync-pill {
    height: 28px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }

  .user-badge {
    gap: 4px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .badge-syno {
    padding: 2px 7px !important;
    font-size: 11px !important;
    margin-right: 2px !important;
    white-space: nowrap !important;
  }

  #btnHeaderLogin,
  #btnHeaderChangePw,
  #btnHeaderLogout {
    height: 26px !important;
    padding: 0 7px !important;
    margin-left: 3px !important;
    font-size: 11.5px !important;
    align-items: center !important;
    white-space: nowrap !important;
  }
}

/* 1080p with 125% Windows Display Scaling (1536px viewport) or medium desktop (1025px ~ 1700px) */
@media (min-width: 1025px) and (max-width: 1700px) {
  .app-header {
    padding: 0 10px !important;
    gap: 8px !important;
  }

  .header-left {
    width: 128px !important;
    min-width: 128px !important;
    max-width: 128px !important;
    gap: 6px !important;
  }

  .header-title-box .sub-text {
    display: none !important;
  }


  .btn-master-module {
    padding: 0 8px !important;
    font-size: 11.5px !important;
  }

  #gasNavTabs .tab-btn,
  #partsNavTabs .tab-btn,
  #rangeNavTabs .tab-btn {
    padding: 0 8px !important;
    font-size: 11.5px !important;
  }
}

/* Unify Main Container and KPI Grid Vertical Positions Across All 3 Modules */
.main-container {
  width: 98% !important;
  max-width: 1920px !important;
  margin: 10px auto !important;
  padding: 0 8px !important;
}

.kpi-grid,
.parts-kpi-grid,
.range-kpi-grid {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  gap: 10px !important;
}

.kpi-card,
.parts-kpi-grid .kpi-card,
.range-kpi-grid .kpi-card {
  min-height: 68px !important;
  padding: 10px 14px !important;
  border-radius: 8px !important;
  border-top-width: 3.5px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  transform: none !important;
}

.kpi-card:hover,
.parts-kpi-grid .kpi-card:hover,
.range-kpi-grid .kpi-card:hover {
  transform: none !important;
}

.manage-toolbar,
.parts-toolbar-card,
.range-toolbar-card {
  min-height: 50px !important;
  padding: 8px 14px !important;
  margin-bottom: 10px !important;
  border-radius: 6px !important;
  box-sizing: border-box !important;
}


/* Custom user-added status badge (e.g., 대여, 점검중, 예비) */
.badge-custom-status {
  background-color: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #d8b4fe;
}

.dash-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}
.dash-detail-header .panel-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-header-actions {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}
.dash-header-actions .btn {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}


/* ==========================================================================
   FLUID RESPONSIVE LAYOUT FOR ALL PC RESOLUTIONS & WINDOWS SCALING (100%~150%, FHD/QHD/4K)
   ========================================================================== */
.main-container {
  width: 98.5% !important;
  max-width: 100% !important;
  margin: clamp(6px, 0.8vh, 14px) auto !important;
  padding: 0 clamp(6px, 0.6vw, 16px) !important;
}

@media (min-width: 1101px) {
  .dashboard-body-grid {
    display: grid !important;
    grid-template-columns: clamp(330px, 26vw, 520px) minmax(0, 1fr) !important;
    gap: clamp(8px, 0.7vw, 16px) !important;
    align-items: start !important;
  }
}

@media (max-width: 1100px) {
  .dashboard-body-grid {
    grid-template-columns: 1fr !important;
  }
}

.detail-table-scroll {
  max-height: clamp(360px, calc(100vh - 250px), 1200px) !important;
  overflow-y: auto !important;
}

.manage-grid-wrapper {
  max-height: clamp(400px, calc(100vh - 225px), 1300px) !important;
  overflow-y: auto !important;
}

/* Strict Zero-Jump Lock for Top Header & Page Scrollbar Across All Tab Switches */
html {
  overflow-y: scroll !important;
  scrollbar-gutter: stable !important;
}

/* Fluid Dashboard Filter Bar */
.dash-filter-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: clamp(4px, 0.45vw, 8px) !important;
  padding: 6px clamp(8px, 0.6vw, 12px) !important;
}

.dash-filter-bar select#dashFilterStatus,
.dash-filter-bar select#dashFilterQuarter,
.dash-filter-bar select#dashFilterLocation,
.dash-filter-bar select#dashFilterGas,
.dash-filter-bar select#dashSortSelect {
  width: auto !important;
  min-width: clamp(72px, 4.8vw, 110px) !important;
  max-width: 160px !important;
  font-size: clamp(11.5px, 0.7vw, 13px) !important;
}

.dash-filter-bar .search-group {
  flex: 1 1 140px !important;
  min-width: 120px !important;
  max-width: 280px !important;
}

/* Fluid Table Typography */
table th,
table td {
  font-size: clamp(11.5px, 0.68vw, 13.5px);
  padding: clamp(4px, 0.45vh, 7px) clamp(4px, 0.4vw, 8px);
}

/* ==========================================================================
   FLUID RESPONSIVE RULES FOR RANGE MANAGEMENT & PARTS MANAGEMENT
   ========================================================================== */
.range-table-scroll,
#rangeMainPanel .table-wrapper,
.parts-table-scroll,
#partsHistoryPanel .table-wrapper {
  max-height: clamp(380px, calc(100vh - 230px), 1400px) !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
}

.parts-matrix-container {
  max-height: clamp(320px, calc(100vh - 300px), 1100px) !important;
  overflow-y: auto !important;
}

/* Fluid Range Spec Table (18 columns scale smoothly across 125%/150% laptop, FHD, QHD, 4K) */
.range-spec-table {
  width: 100% !important;
  table-layout: auto !important;
  font-size: clamp(11px, 0.68vw, 13.5px) !important;
}

.range-spec-table thead tr.range-th-group-row th {
  font-size: clamp(10.5px, 0.65vw, 13px) !important;
  padding: clamp(4px, 0.45vh, 8px) clamp(2px, 0.3vw, 6px) !important;
}

.range-spec-table thead tr.range-th-sub-row th {
  font-size: clamp(10px, 0.6vw, 12px) !important;
  padding: clamp(3px, 0.35vh, 6px) clamp(2px, 0.25vw, 5px) !important;
}

.range-spec-table td {
  padding: clamp(4px, 0.45vh, 7px) clamp(3px, 0.35vw, 7px) !important;
  font-size: clamp(11px, 0.68vw, 13.5px) !important;
}

.range-spec-table td.col-rng-num {
  font-size: clamp(11.5px, 0.7vw, 13.5px) !important;
  padding-right: clamp(4px, 0.45vw, 10px) !important;
}

.badge-rng-limit,
.badge-rng-o2,
.badge-rng-o2-none,
.badge-rng-self {
  font-size: clamp(10px, 0.62vw, 12px) !important;
  min-width: clamp(36px, 2.6vw, 52px) !important;
  padding: 1px clamp(3px, 0.3vw, 6px) !important;
}

/* Fluid Toolbars & Form Grids for Range and Parts */
.range-toolbar-card,
.parts-toolbar-card,
.manage-toolbar {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: clamp(6px, 0.5vw, 12px) !important;
  padding: clamp(6px, 0.6vh, 10px) clamp(10px, 0.8vw, 16px) !important;
}

.parts-toolbar-left,
.parts-toolbar-right,
.toolbar-left,
.toolbar-right {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: clamp(4px, 0.45vw, 8px) !important;
}

#rangeStackFilter,
#rangeO2Filter,
#rangeCategoryFilter,
#partsStackFilter,
#partsSystemFilter,
#partsPartFilter {
  min-width: clamp(95px, 7.5vw, 155px) !important;
  font-size: clamp(11.5px, 0.68vw, 13px) !important;
}

#rangeSearchInput,
#partsSearchInput,
#manageSearchInput {
  width: clamp(140px, 12vw, 260px) !important;
  font-size: clamp(11.5px, 0.68vw, 13px) !important;
}

/* Fluid Parts Inline Registration Form Grid */
@media (min-width: 1101px) {
  .parts-form-grid {
    grid-template-columns: minmax(105px, 1fr) minmax(145px, 1.5fr) minmax(135px, 1.4fr) minmax(115px, 1fr) minmax(85px, 0.8fr) minmax(140px, 1.8fr) minmax(80px, 0.7fr) !important;
    gap: clamp(6px, 0.5vw, 10px) !important;
  }
}

@media (max-width: 1100px) {
  .parts-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  }
}

.parts-history-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* High-Contrast Operator Name in Dark Header */
#userLabelText {
  display: inline-block !important;
  color: #cbd5e1 !important;
  font-weight: 600 !important;
}

#displayUserName {
  font-weight: 800 !important;
  letter-spacing: -0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   UNIVERSAL INPUT CLEAR (✕) BUTTON FOR ALL SEARCH & TEXT INPUTS
   ========================================================================== */
.clearable-input-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle;
}

td .clearable-input-wrap,
.form-group .clearable-input-wrap,
.search-group .clearable-input-wrap,
.rng-remark-edit-wrap .clearable-input-wrap {
  width: 100% !important;
  flex: 1 1 auto !important;
}

.clearable-input-wrap > input {
  padding-right: 24px !important;
  box-sizing: border-box !important;
}

td .clearable-input-wrap > input,
.form-group .clearable-input-wrap > input,
.search-group .clearable-input-wrap > input {
  width: 100% !important;
}

.date-input-wrap > input.has-clear-val {
  padding-right: 42px !important;
}

.inp-clear-btn {
  position: absolute !important;
  right: 5px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  border: none !important;
  background: #cbd5e1 !important;
  color: #1e293b !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 4 !important;
  opacity: 0.78;
  transition: background-color 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}

.inp-clear-btn.visible {
  display: inline-flex !important;
}

.inp-clear-btn:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  opacity: 1;
}

/* Date input wrap has calendar icon at right: 5px, so place clear button just left of calendar icon */
.date-input-wrap > .inp-clear-btn.date-clear-btn {
  right: 24px !important;
}

/* ==========================================================================
   DROPDOWN STUDIO MODAL PRO STYLES (Moved from app.js to style.css)
   ========================================================================== */
#gsDropdownModal .gs-dropdown-modal-card {
  max-width: 920px !important;
  width: 94vw !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  border-radius: 14px !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.5) !important;
  background: #f1f5f9 !important;
  overflow: hidden !important;
}
#gsDropdownModal .gs-modal-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
  padding: 14px 22px !important;
  border-bottom: 1px solid #334155 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 0 !important;
}
#gsDropdownModal .gs-modal-title-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
#gsDropdownModal .gs-modal-title {
  color: #f8fafc !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  letter-spacing: -0.3px !important;
  margin: 0 !important;
}
#gsDropdownModal .btn-modal-close {
  width: 30px !important;
  height: 30px !important;
  border-radius: 7px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
}
#gsDropdownModal .btn-modal-close:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}
#gsDropdownModal .gs-module-switcher {
  background: #0f172a !important;
  padding: 8px 22px 10px 22px !important;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 8px !important;
  border-bottom: 1px solid #1e293b !important;
  margin: 0 !important;
}
#gsDropdownModal .gs-module-btn {
  height: 36px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
}
#gsDropdownModal .gs-module-btn:hover {
  color: #f8fafc !important;
  background: #334155 !important;
}
#gsDropdownModal #btnGsScopeGas.gs-module-btn.active {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #34d399 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35) !important;
}
#gsDropdownModal #btnGsScopeParts.gs-module-btn.active {
  background: #ea580c !important;
  color: #ffffff !important;
  border-color: #fb923c !important;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35) !important;
}
#gsDropdownModal #btnGsScopeRange.gs-module-btn.active {
  background: #6366f1 !important;
  color: #ffffff !important;
  border-color: #818cf8 !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35) !important;
}
#gsDropdownModal .gs-category-tabs {
  background: #ffffff !important;
  padding: 0 22px !important;
  height: 44px !important;
  border-bottom: 1px solid #cbd5e1 !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  gap: 4px !important;
  margin: 0 !important;
  align-items: stretch !important;
}
#gsDropdownModal .gs-tab {
  padding: 0 13px !important;
  height: 43px !important;
  border-radius: 0 !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 3px solid transparent !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
#gsDropdownModal .gs-tab:hover {
  color: #0f172a !important;
  background: #f8fafc !important;
}
#gsDropdownModal #gsTabs_gas .gs-tab.active {
  color: #059669 !important;
  border-bottom-color: #10b981 !important;
  background: #ecfdf5 !important;
}
#gsDropdownModal #gsTabs_parts .gs-tab.active {
  color: #c2410c !important;
  border-bottom-color: #ea580c !important;
  background: #fff7ed !important;
}
#gsDropdownModal #gsTabs_range .gs-tab.active {
  color: #4338ca !important;
  border-bottom-color: #6366f1 !important;
  background: #eef2ff !important;
}
#gsDropdownModal .gs-modal-body {
  padding: 14px 22px !important;
  background: #f1f5f9 !important;
  flex: 1 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}
#gsDropdownModal .gs-modal-guide {
  display: none !important;
}
#gsProToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
#gsProTableWrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}
#gsProTableHeader {
  background: #1e293b;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 14px;
  display: grid;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #0f172a;
  user-select: none;
}
#gsDropdownModal #gsItemsContainer {
  flex: 1 !important;
  min-height: 320px !important;
  max-height: 460px !important;
  overflow-y: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #ffffff !important;
  border: none !important;
}
#gsDropdownModal .gs-item-row {
  display: grid !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 6px 14px !important;
  min-height: 42px !important;
  margin: 0 !important;
  border: none !important;
  border-bottom: 1px solid #f1f5f9 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  transition: background-color 0.1s ease !important;
}
#gsDropdownModal .gs-item-row:nth-child(even) {
  background: #fafbfd !important;
}
#gsDropdownModal .gs-item-row:hover {
  background: #f0f9ff !important;
}
#gsDropdownModal .gs-item-row.gs-drag-over {
  background: #e0f2fe !important;
  border-top: 2px solid #0284c7 !important;
}
#gsDropdownModal .gs-col-order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
#gsDropdownModal .gs-drag-handle {
  color: #94a3b8;
  font-size: 14px;
  cursor: grab;
  padding: 2px 3px;
  user-select: none;
}
#gsDropdownModal .gs-item-num {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 24px !important;
  height: 20px !important;
  padding: 0 5px !important;
  border-radius: 4px !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums !important;
}
#gsDropdownModal .gs-order-btns {
  display: inline-flex !important;
  flex-direction: row !important;
  gap: 2px !important;
}
#gsDropdownModal .btn-gs-order {
  width: 21px !important;
  height: 21px !important;
  padding: 0 !important;
  border-radius: 4px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #475569 !important;
  font-size: 9.5px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#gsDropdownModal .btn-gs-order:hover:not(:disabled) {
  background: #eff6ff !important;
  color: #2563eb !important;
  border-color: #93c5fd !important;
}
#gsDropdownModal .btn-gs-order:disabled {
  opacity: 0.35 !important;
  cursor: default !important;
}
#gsDropdownModal .gs-item-input {
  width: 100% !important;
  height: 31px !important;
  padding: 0 10px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
}
#gsDropdownModal .gs-item-row:hover .gs-item-input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}
#gsDropdownModal .gs-item-input:focus {
  background: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
  outline: none !important;
}
#gsDropdownModal .gs-btn-add-item {
  display: none !important;
}
#gsDropdownModal .gs-modal-footer {
  background: #ffffff !important;
  padding: 12px 22px !important;
  border-top: 1px solid #cbd5e1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin: 0 !important;
}
#gsDropdownModal .gs-footer-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}
#gsDropdownModal .gs-footer-right button {
  white-space: nowrap !important;
}
#gsDropdownModal .gs-btn-del-item {
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
}
#gsDropdownModal .gs-btn-del-item:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: #fecaca !important;
}

/* ==========================================================================
   3개 모듈(가스·부품·RANGE) 툴바 1줄 고정 · 버튼 위치 통일 · 겹침 원천 차단 (v26)
   ========================================================================== */
@media (min-width: 901px) {
.manage-toolbar .clearable-input-wrap,
.parts-toolbar-card .clearable-input-wrap,
.range-toolbar-card .clearable-input-wrap,
.toolbar-search-clear-wrap {
  width: auto !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
}

#tab-manage .manage-toolbar,
#partsToolbarCard.parts-toolbar-card,
#rangeToolbarCard.range-toolbar-card {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 6px 12px !important;
  min-height: 46px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
}

#tab-manage .manage-toolbar .toolbar-left,
#tab-manage .manage-toolbar .toolbar-right,
#partsToolbarCard .parts-toolbar-left,
#partsToolbarCard .parts-toolbar-right,
#rangeToolbarCard .parts-toolbar-left,
#rangeToolbarCard .parts-toolbar-right {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 5px !important;
  flex: 0 0 auto !important;
  min-width: max-content !important;
}

#tab-manage .manage-toolbar .toolbar-right,
#partsToolbarCard .parts-toolbar-right,
#rangeToolbarCard .parts-toolbar-right {
  margin-left: auto !important;
}

#tab-manage .search-filter-inline {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 4px !important;
  flex: 0 0 auto !important;
}

#rangeToolbarCard .filter-group,
#partsToolbarCard .filter-group,
#rangeToolbarCard .search-group,
#partsToolbarCard .search-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
}

#rangeToolbarCard .filter-group label,
#partsToolbarCard .filter-group label {
  font-size: 12px !important;
  white-space: nowrap !important;
  margin: 0 !important;
}

#tab-manage .manage-toolbar select,
#tab-manage .manage-toolbar input[type="text"],
#partsToolbarCard select,
#partsToolbarCard input[type="text"],
#rangeToolbarCard select,
#rangeToolbarCard input[type="text"] {
  height: 30px !important;
  padding: 0 7px !important;
  font-size: 11.5px !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  flex: 0 0 auto !important;
}

#manageSearchInput,
#partsSearchInput,
#rangeSearchInput {
  padding-right: 22px !important;
}

#rangeStackFilter { width: 135px !important; }
#rangeO2Filter { width: 105px !important; }
#rangeCategoryFilter { width: 130px !important; }
#rangeSearchInput { width: 170px !important; }

#partsStackFilter { width: 125px !important; }
#partsSystemFilter { width: 135px !important; }
#partsPartFilter { width: 125px !important; }
#partsSearchInput { width: 155px !important; }

#manageSortSelect { width: 104px !important; }
#manageFilterQuarter { width: 84px !important; }
#manageFilterLocation { width: 90px !important; }
#manageFilterGas { width: 84px !important; }
#manageFilterStatus { width: 84px !important; }
#manageSearchInput { width: 120px !important; }

#tab-manage .manage-toolbar .btn,
#partsToolbarCard .btn,
#rangeToolbarCard .btn {
  height: 30px !important;
  padding: 0 8px !important;
  font-size: 11.5px !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
}
}

/* ==========================================================================
   RANGE 테이블 2단 고정 헤더 빈틈(흰줄) 제거 및 툴바 셀렉트 폭 보정 (v27)
   ========================================================================== */
/* 1. border-collapse: collapse 상태에서 2단 sticky 헤더 사이가 벌어져 흰색 배경이 비치는 현상 해결 */
.range-spec-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.range-spec-table thead {
  background: #1e1b4b !important;
}

.range-spec-table thead tr.range-th-group-row th {
  height: 28px !important;
  box-sizing: border-box !important;
  padding: 4px 5px !important;
  line-height: 1.2 !important;
  top: 0 !important;
  z-index: 4 !important;
  border-top: none !important;
  border-left: none !important;
  border-right: 1px solid #312e81 !important;
  border-bottom: 1px solid #312e81 !important;
}

.range-spec-table thead tr.range-th-group-row th.th-group-nox {
  border-bottom: 2px solid #38bdf8 !important;
}
.range-spec-table thead tr.range-th-group-row th.th-group-so2 {
  border-bottom: 2px solid #818cf8 !important;
}
.range-spec-table thead tr.range-th-group-row th.th-group-dust {
  border-bottom: 2px solid #34d399 !important;
}
.range-spec-table thead tr.range-th-group-row th.th-group-co {
  border-bottom: 2px solid #fbbf24 !important;
}

.range-spec-table thead tr.range-th-sub-row th {
  height: 24px !important;
  box-sizing: border-box !important;
  padding: 2px 4px !important;
  line-height: 1.15 !important;
  top: 28px !important; /* 1단 헤더 높이(28px)와 1px의 오차 없이 정확히 밀착 */
  z-index: 3 !important;
  border-top: none !important;
  border-left: none !important;
  border-right: 1px solid #3730a3 !important;
  border-bottom: 1px solid #1e1b4b !important;
}

.range-spec-table tbody td {
  border-top: none !important;
  border-left: none !important;
  border-right: 1px solid #e2e8f0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.range-spec-table tbody td.col-rng-limit {
  border-right: 1.5px solid #cbd5e1 !important;
}

/* 2. RANGE 툴바 좌측 셀렉트 박스 글자 잘림 방지 ('전체 호기 보기 (52개소)', '전체 표준산소' 완벽 표시) */
#rangeStackFilter {
  width: auto !important;
  min-width: 158px !important;
  padding-right: 22px !important;
}

#rangeO2Filter {
  width: auto !important;
  min-width: 116px !important;
  padding-right: 20px !important;
}

#rangeCategoryFilter {
  width: auto !important;
  min-width: 135px !important;
  padding-right: 20px !important;
}


/* ==========================================================================
   MODULE 0: 4-WEEK REPEATING SCHEDULE MODULE STYLES (v28)
   ========================================================================== */
body.theme-schedule .app-header,
header.app-header.theme-schedule {
  background-color: #134e4a !important;
  border-bottom: 3px solid #14b8a6 !important;
}

body.theme-schedule .logo-box {
  background-color: #0d9488 !important;
}

body.theme-schedule .sync-dot {
  background: #2dd4bf !important;
  box-shadow: 0 0 6px #2dd4bf !important;
}

.btn-master-module.active#btnModuleSchedule {
  background: #0d9488 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(13, 148, 136, 0.45) !important;
}

#scheduleNavTabs {
  display: flex;
  gap: 4px;
  height: 34px !important;
  padding: 3px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 6px !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

#scheduleNavTabs .tab-btn {
  height: 28px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-radius: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  color: #e2e8f0;
  background: transparent;
}

#scheduleNavTabs .tab-btn.active {
  background: #0d9488 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.schedule-kpi-grid {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  gap: 10px !important;
}

.schedule-kpi-grid .kpi-card {
  min-height: 68px !important;
  padding: 10px 14px !important;
  border-radius: 8px !important;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.sched-kpi-thisweek { border-top: 3.5px solid #0d9488 !important; }
.sched-kpi-today    { border-top: 3.5px solid #10b981 !important; }
.sched-kpi-notes    { border-top: 3.5px solid #f59e0b !important; }
.sched-kpi-cycle    { border-top: 3.5px solid #3b82f6 !important; }

/* 1-Line Schedule Toolbar matching Gas / Parts / Range */
@media (min-width: 901px) {
#scheduleToolbarCard.schedule-toolbar-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #0d9488;
  border-radius: 6px;
  padding: 6px 12px !important;
  min-height: 46px !important;
  margin-bottom: 10px !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

#scheduleToolbarCard .parts-toolbar-left,
#scheduleToolbarCard .parts-toolbar-right {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 5px !important;
  flex: 0 0 auto !important;
  min-width: max-content !important;
}

#scheduleToolbarCard .parts-toolbar-right {
  margin-left: auto !important;
}

#scheduleToolbarCard .filter-group,
#scheduleToolbarCard .search-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
}

#scheduleToolbarCard select,
#scheduleToolbarCard input[type="text"],
#scheduleToolbarCard input[type="date"] {
  height: 30px !important;
  padding: 0 7px !important;
  font-size: 11.5px !important;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  box-sizing: border-box !important;
}

#scheduleToolbarCard .btn {
  height: 30px !important;
  padding: 0 8px !important;
  font-size: 11.5px !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
}
}


.schedule-toolbar-card .clearable-input-wrap {
  width: auto !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
}

#schedSearchInput {
  padding-right: 22px !important;
}

/* Weekly 5-Column Schedule Block Card (Google Sheet 2026일정 style) */
.sched-week-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.sched-week-card.is-current-week {
  border: 2px solid #0d9488;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.14);
}

.sched-week-header {
  background: #0f172a;
  color: #ffffff;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sched-week-card.is-current-week .sched-week-header {
  background: linear-gradient(90deg, #134e4a 0%, #0f172a 100%);
  border-bottom: 2px solid #14b8a6;
}

.sched-5day-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  border-top: 1px solid #334155;
}

@media (max-width: 1100px) {
  .sched-5day-grid {
    grid-template-columns: 1fr;
  }
}

.sched-day-col {
  border-right: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  min-height: 185px;
  background: #ffffff;
}

.sched-day-col:last-child {
  border-right: none;
}

.sched-day-col.is-today-col {
  background: #f0fdfa;
}

.sched-day-hdr {
  background: #1e293b;
  color: #f8fafc;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #cbd5e1;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.sched-day-hdr:hover {
  background: #334155;
}

.sched-day-col.is-today-col .sched-day-hdr {
  background: #0d9488;
  color: #ffffff;
}

.sched-day-subhdr {
  display: grid;
  grid-template-columns: 44% 56%;
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  text-align: center;
}

.sched-day-subhdr > div {
  padding: 3px 4px;
}

.sched-day-subhdr > div:first-child {
  border-right: 1px solid #cbd5e1;
}

.sched-day-items {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sched-item-row {
  display: grid;
  grid-template-columns: 44% 56%;
  border-bottom: 1px solid #e2e8f0;
  min-height: 30px;
  font-size: 12px;
  transition: background-color 0.1s ease;
}

.sched-item-row:hover {
  background: #f8fafc;
}

.sched-item-stack-cell {
  border-right: 1px solid #e2e8f0;
  padding: 4px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
}

.sched-item-note-cell {
  padding: 4px 7px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.35;
  cursor: pointer;
}

.sched-item-note-cell.has-issue-note {
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}

.sched-item-row.is-general-memo-row {
  grid-template-columns: 100%;
  background: #f8fafc;
}

.sched-item-row.is-general-memo-row .sched-item-stack-cell {
  border-right: none;
  justify-content: flex-start;
  padding: 4px 8px;
  color: #334155;
  font-weight: 700;
  font-size: 11.5px;
  text-align: left;
}


/* ==========================================================================
   V29 ENHANCEMENTS: SCHEDULE ON-DUTY (정/부), CALENDAR HOLIDAYS,
   DOUBLE-CLICK INLINE EDIT, 4-WEEK VISUAL CHIP STUDIO, SMART STACK PICKER
   ========================================================================== */
#gsDropdownModal #btnGsScopeSchedule.gs-module-btn.active {
  background: #0d9488 !important;
  color: #ffffff !important;
  border-color: #2dd4bf !important;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35) !important;
}

#gsDropdownModal #gsTabs_schedule .gs-tab.active {
  color: #0f766e !important;
  border-bottom-color: #0d9488 !important;
  background: #f0fdfa !important;
}



/* Duty Role Tags (정 / 부) */
.duty-role-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.2;
}
.duty-role-tag.duty-jung {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}
.duty-role-tag.duty-bu {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
}

/* Week Header Duty Pill Group */
.sched-week-duty-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid #475569;
  padding: 3px 8px;
  border-radius: 6px;
}

.sched-week-select {
  height: 24px;
  padding: 0 5px;
  font-size: 11.5px;
  font-weight: 800;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  cursor: pointer;
}

/* Weekday Holiday Column & Header */
.sched-day-col.is-holiday-col {
  background: #fff1f2 !important;
}
.sched-day-col.is-holiday-col .sched-day-hdr,
.sched-day-hdr.is-holiday-hdr {
  background: linear-gradient(90deg, #be123c 0%, #9f1239 100%) !important;
  color: #ffffff !important;
  border-bottom-color: #fda4af !important;
}
.sched-day-hdr-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-sched-hdr-mini {
  height: 20px;
  padding: 0 6px;
  font-size: 10.5px;
  font-weight: 800;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12);
  color: #f8fafc;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: all 0.12s ease;
}
.btn-sched-hdr-mini:hover {
  background: rgba(255,255,255,0.28);
  border-color: #ffffff;
}
.btn-sched-hdr-mini.is-holiday-active {
  background: #ffe4e6;
  color: #be123c;
  border-color: #fda4af;
}

/* Weekday Holiday Banner & Duty (정/부) Bar inside Column */
.sched-weekday-holiday-bar {
  background: #ffe4e6;
  border-bottom: 1px solid #fda4af;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sched-weekday-holiday-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.sched-weekday-holiday-title {
  font-size: 11.5px;
  font-weight: 900;
  color: #be123c;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sched-weekday-holiday-duty {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.78);
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid #fecdd3;
}
.sched-weekday-holiday-duty select {
  height: 21px;
  font-size: 11px;
  font-weight: 800;
  padding: 0 3px;
  border: 1px solid #fda4af;
  border-radius: 3px;
  background: #ffffff;
  color: #881337;
}

/* Double-Click Inline Editing Row on Schedule Board */
.sched-item-row {
  position: relative;
  user-select: none;
}
.sched-item-row:hover {
  background: #f0fdfa !important;
}
.sched-item-row.is-inline-editing {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  padding: 8px !important;
  background: #f0fdfa !important;
  box-shadow: inset 0 0 0 2px #0d9488, 0 4px 12px rgba(13, 148, 136, 0.14) !important;
  min-height: 132px !important;
  z-index: 10;
}


.sched-inline-textarea {
  width: 100%;
  min-height: 78px;
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  border: 1.5px solid #0d9488;
  border-radius: 5px;
  background: #ffffff;
  color: #0f172a;
  resize: vertical;
  outline: none;
  font-family: inherit;
}
.sched-inline-textarea:focus {
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.25);
}

.btn-sched-inline-act {
  height: 25px;
  min-width: 24px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-sched-inline-act.save {
  background: #0d9488;
  color: #ffffff;
  border-color: #0f766e;
}
.btn-sched-inline-act.del {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

/* Visual 4-Week Repeating Cycle Chip Studio */
.sched-tpl-day-col {
  border-right: 1px solid #cbd5e1;
  padding: 10px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 230px;
}
.sched-tpl-day-col:last-child {
  border-right: none;
}
.sched-tpl-chip-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-height: 110px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 6px;
}
.sched-tpl-chip-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 4px 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.sched-tpl-chip-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.btn-tpl-chip {
  height: 20px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  border-radius: 3px;
  cursor: pointer;
}
.btn-tpl-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.btn-tpl-chip.del:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

/* Smart Stack Quick-Picker Popover & Holiday Popover */
.sched-floating-popover {
  position: fixed;
  z-index: 4800;
  background: #ffffff;
  border: 1px solid #0f172a;
  border-radius: 10px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}
.sched-smart-chip-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-height: 24px;
}
.sched-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  max-height: 250px;
  overflow-y: auto;
  padding: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.sched-picker-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.1s ease;
}
.sched-picker-item:hover {
  border-color: #0d9488;
  background: #f0fdfa;
}
.sched-picker-item.is-checked {
  border-color: #0d9488;
  background: #ccfbf1;
}


/* ==========================================================================
   V35: SCHEDULE 1-DAY VIEW MODE (일간 1일씩 보기) & FULL MOBILE OPTIMIZATION
   ========================================================================== */
.sched-5day-grid.is-single-day-mode {
  grid-template-columns: 1fr !important;
}

.sched-day-col.is-single-day-hidden {
  display: none !important;
}

.sched-single-day-nav {
  background: #f8fafc;
  border-top: 1px solid #334155;
  border-bottom: 2px solid #0d9488;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sched-single-day-ctrl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.sched-single-day-current {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  color: #0f172a;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-day-step {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.btn-day-step.today {
  background: #f0fdfa;
  color: #0f766e;
  border-color: #5eead4;
}

.btn-day-step:active {
  background: #e2e8f0;
}

.sched-day-tab-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.sched-day-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.12s ease;
}

.sched-day-tab-btn .d-tab-top {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.sched-day-tab-btn .d-tab-name {
  font-size: 13px;
  font-weight: 900;
}

.sched-day-tab-btn .d-tab-date {
  font-size: 10.5px;
  font-weight: 700;
  opacity: 0.85;
}

.sched-day-tab-btn .d-tab-badges {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 800;
}

.sched-day-tab-btn .d-mini-cnt {
  color: #0f766e;
}

.sched-day-tab-btn .d-mini-note {
  background: #fef3c7;
  color: #92400e;
  padding: 0 4px;
  border-radius: 4px;
}

.sched-day-tab-btn .d-mini-hol {
  color: #be123c;
}

.sched-day-tab-btn.is-today {
  border-color: #0d9488;
  background: #f0fdfa;
}

.sched-day-tab-btn.active {
  background: #0d9488 !important;
  color: #ffffff !important;
  border-color: #0f766e !important;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.3);
}

.sched-day-tab-btn.active .d-mini-cnt,
.sched-day-tab-btn.active .d-mini-hol {
  color: #ccfbf1 !important;
}

.sched-day-tab-btn.is-hol.active {
  background: #be123c !important;
  border-color: #9f1239 !important;
}

/* Mobile 1-tap row edit button (hidden on PC, shown on mobile or single-day mode) */
.btn-mobile-row-edit {
  display: none;
  height: 22px;
  padding: 0 6px;
  font-size: 10.5px;
  font-weight: 800;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  flex-shrink: 0;
}

.sched-5day-grid.is-single-day-mode .btn-mobile-row-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-mobile-row-edit.is-add {
  color: #0f766e;
  border-color: #99f6e4;
  background: #f0fdfa;
}

/* ==========================================================================
   COMPREHENSIVE MOBILE & TABLET RESPONSIVE OPTIMIZATION (<= 900px) - v46
   Designed for maximum data visibility, zero column overlap, and 1-thumb operation
   ========================================================================== */
@media (max-width: 900px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    font-size: 12px !important;
  }

  .btn-mobile-row-edit {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* --------------------------------------------------------------------------
     1. ULTRA-SLIM NON-STICKY MOBILE HEADER (Saves ~120px of screen height!)
     -------------------------------------------------------------------------- */
  .app-header {
    position: relative !important; /* Scrolls away naturally so 100% of screen is usable for data! */
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 8px !important;
    gap: 5px !important;
    overflow: visible !important;
  }

  /* Top Row Left: Logo + Title */
  .header-left {
    width: auto !important;
    max-width: 48% !important;
    flex: 0 1 auto !important;
    gap: 5px !important;
  }
  .logo-box {
    font-size: 10.5px !important;
    padding: 2px 6px !important;
    height: 22px !important;
    min-width: 42px !important;
  }
  .header-title-box h1 {
    font-size: 13.5px !important;
    white-space: nowrap !important;
  }
  .header-title-box .sub-text {
    display: none !important;
  }

  /* Top Row Right: Operator Name + Login/Logout (Placed on the exact same top row as Logo!) */
  .header-right {
    order: 2 !important;
    width: auto !important;
    flex: 0 1 auto !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }
  /* Hide desktop-only header buttons on mobile to keep Row 1 ultra-clean */
  .header-right > button[onclick="downloadDbBackup()"],
  .header-sync-pill,
  #synoAuthBadge,
  #userLabelText {
    display: none !important;
  }
  .header-right > button[onclick="openStackIntegratedModal()"] {
    height: 24px !important;
    padding: 0 6px !important;
    font-size: 10.5px !important;
  }
  .user-badge {
    width: auto !important;
    padding: 0 !important;
    font-size: 11px !important;
    gap: 3px !important;
    flex-wrap: nowrap !important;
  }
  #btnHeaderLogin,
  #btnHeaderChangePw,
  #btnHeaderLogout {
    height: 23px !important;
    padding: 0 6px !important;
    font-size: 10.5px !important;
    margin-left: 2px !important;
  }

  /* Row 2 & Row 3: 4-Module Switcher + Sub-Nav Tabs */
  .header-center {
    order: 3 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
  }

  .master-module-switcher {
    width: 100% !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 3px !important;
    padding: 3px !important;
  }

  .btn-master-module {
    height: 29px !important;
    padding: 0 2px !important;
    font-size: 11px !important;
    justify-content: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .btn-master-module .m-icon {
    font-size: 11px !important;
  }

  #scheduleNavTabs,
  #gasNavTabs,
  #partsNavTabs,
  #rangeNavTabs {
    width: 100% !important;
    height: auto !important;
    /* Do NOT set display: flex !important here, or inactive module nav bars with inline display:none will all show at once! */
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 2px !important;
    gap: 3px !important;
  }

  #scheduleNavTabs .tab-btn,
  #gasNavTabs .tab-btn,
  #partsNavTabs .tab-btn,
  #rangeNavTabs .tab-btn {
    flex: 1 1 0 !important;
    min-width: max-content !important;
    height: 27px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
  }

  /* Compact yellow notice banner on mobile */
  .notice-banner {
    padding: 4px 8px !important;
    gap: 4px !important;
  }
  .notice-desc,
  .auto-sync-status {
    display: none !important;
  }
  .notice-title-suffix,
  .notice-title {
    font-size: 12px !important;
  }

  /* --------------------------------------------------------------------------
     2. CONTAINER WIDTH LOCK & SMOOTH HORIZONTAL TABLE SCROLLING (Zero Overlap!)
     -------------------------------------------------------------------------- */
  .main-container,
  #module-gas,
  #module-parts,
  #module-range,
  #module-schedule,
  .tab-content,
  .dashboard-body-grid,
  .dashboard-left,
  .dashboard-right,
  .panel-box,
  .manage-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .main-container {
    margin: 6px auto !important;
    padding: 0 5px !important;
  }

  .panel-box,
  .manage-card {
    overflow: hidden !important;
    border-radius: 7px !important;
    margin-bottom: 8px !important;
  }

  .table-wrapper,
  .detail-table-scroll,
  .manage-grid-wrapper,
  .range-table-scroll,
  .parts-table-scroll {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x pan-y !important;
    overscroll-behavior-x: contain !important;
    max-height: 62vh !important;
  }

  /* Explicit min-widths on wide data tables so columns NEVER squash or overlap, and swipe-scroll works 100% */
  #dashDetailTableBody, .detail-table {
    min-width: 680px !important;
  }
  #schedWaterWashCycleTableBody, #schedIssuesTableBody {
    min-width: 580px !important;
  }
  .manage-table {
    min-width: 920px !important;
  }
  .parts-history-table {
    min-width: 740px !important;
  }
  .range-spec-table {
    min-width: 960px !important;
  }
  .history-table {
    min-width: 620px !important;
  }
  .summary-table {
    min-width: 100% !important;
    width: 100% !important;
  }

  .detail-table th,
  .detail-table td,
  .manage-table th,
  .manage-table td,
  .parts-history-table th,
  .parts-history-table td,
  .range-spec-table th,
  .range-spec-table td {
    white-space: nowrap !important;
    padding: 5px 6px !important;
    font-size: 11.5px !important;
  }

  .manage-table .inline-control,
  .manage-table .inline-edit-control {
    min-width: 86px !important;
    height: 30px !important;
    font-size: 12px !important;
    padding: 3px 5px !important;
  }

  /* --------------------------------------------------------------------------
     3. ULTRA-SLIM KPI STRIPS ACROSS ALL 4 MODULES
     -------------------------------------------------------------------------- */
  /* Gas 5-Card KPI: Single 5-Column Strip (Takes only 46px height instead of 180px!) */
  .kpi-grid-5 {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 4px !important;
    margin-bottom: 6px !important;
  }
  .kpi-grid-5 .kpi-card {
    min-height: 44px !important;
    padding: 4px 3px !important;
    align-items: center !important;
    text-align: center !important;
  }
  .kpi-grid-5 .kpi-header {
    justify-content: center !important;
    gap: 2px !important;
    margin-bottom: 1px !important;
  }
  .kpi-grid-5 .kpi-icon,
  .kpi-grid-5 .kpi-dot {
    display: none !important;
  }
  .kpi-grid-5 .kpi-label {
    font-size: 10px !important;
    white-space: nowrap !important;
    letter-spacing: -0.3px !important;
  }
  .kpi-grid-5 .kpi-value {
    font-size: 13.5px !important;
  }
  .kpi-grid-5 .kpi-value .unit {
    font-size: 10px !important;
  }

  /* 4-Card KPI Grids (Schedule, Parts, Range): Compact 2x2 Grid */
  .kpi-grid-4,
  .schedule-kpi-grid,
  .parts-kpi-grid,
  .range-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
    margin-bottom: 6px !important;
  }
  .kpi-grid-4 .kpi-card,
  .schedule-kpi-grid .kpi-card,
  .parts-kpi-grid .kpi-card,
  .range-kpi-grid .kpi-card {
    min-height: 46px !important;
    padding: 5px 8px !important;
  }
  .kpi-grid-4 .kpi-label,
  .schedule-kpi-grid .kpi-label,
  .parts-kpi-grid .kpi-label,
  .range-kpi-grid .kpi-label {
    font-size: 10.5px !important;
  }
  .kpi-grid-4 .kpi-value,
  .schedule-kpi-grid .kpi-value,
  .parts-kpi-grid .kpi-value,
  .range-kpi-grid .kpi-value {
    font-size: 13px !important;
  }

  /* Storage 4-Location Bar: Compact 2x2 Grid */
  .storage-kpi-bar {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 4px !important;
    padding: 5px !important;
    margin-bottom: 6px !important;
  }
  .storage-kpi-bar > * {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 4px 6px !important;
    font-size: 11px !important;
    box-sizing: border-box !important;
  }

  /* --------------------------------------------------------------------------
     4. GAS DASHBOARD (#tab-dashboard) & GAS MANAGE (#tab-manage) MOBILE UX
     -------------------------------------------------------------------------- */
  /* Show Gas Cylinder Detail Lookup FIRST on Mobile Dashboard so filtering shows results immediately! */
  .dashboard-body-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .dashboard-right {
    order: 1 !important;
  }
  .dashboard-left {
    order: 2 !important;
  }
  .storage-table-footer-hint {
    display: none !important;
  }

  /* Dashboard Detail Header */
  .dash-detail-header {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    padding: 6px 8px !important;
  }
  .dash-detail-header .panel-title {
    font-size: 12.5px !important;
    padding: 0 !important;
  }
  .dash-header-actions {
    display: flex !important;
    gap: 4px !important;
  }
  .dash-header-actions .btn {
    height: 25px !important;
    padding: 0 6px !important;
    font-size: 10.5px !important;
  }

  /* Dashboard Filter Bar: Ultra-compact 3-column grid (No wasted label width!) */
  .dash-filter-bar {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    padding: 6px 8px !important;
    white-space: normal !important;
  }
  .dash-filter-bar .filter-group {
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
  }
  .dash-filter-bar .filter-group label {
    font-size: 10.5px !important;
    min-width: 24px !important;
  }
  .dash-filter-bar select,
  .dash-filter-bar select#dashFilterStatus,
  .dash-filter-bar select#dashFilterQuarter,
  .dash-filter-bar select#dashFilterLocation,
  .dash-filter-bar select#dashFilterGas,
  .dash-filter-bar select#dashSortSelect {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 29px !important;
    font-size: 11px !important;
    padding: 0 4px !important;
  }
  .dash-filter-bar .search-group {
    grid-column: span 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
  }
  .dash-filter-bar .search-group input {
    width: 100% !important;
    height: 29px !important;
    font-size: 11.5px !important;
    padding: 0 8px !important;
  }

  /* GAS 관리 (#tab-manage) Compact Toolbar */
  #tab-manage .manage-toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 5px !important;
    padding: 6px 8px !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  #tab-manage .manage-toolbar .toolbar-left,
  #tab-manage .manage-toolbar .toolbar-right {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  #tab-manage .manage-toolbar .search-filter-inline {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  #tab-manage .manage-toolbar select,
  #manageSortSelect,
  #manageFilterQuarter,
  #manageFilterLocation,
  #manageFilterGas,
  #manageFilterStatus {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 29px !important;
    font-size: 11px !important;
    padding: 0 4px !important;
  }
  #tab-manage .manage-toolbar .clearable-input-wrap,
  #manageSearchInput {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 29px !important;
    font-size: 11.5px !important;
  }
  #tab-manage .manage-toolbar .toolbar-right {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }
  /* Hide desktop CSV export/import & dropdown buttons on mobile GAS 관리 to save space */
  #tab-manage .manage-toolbar .toolbar-right > button[onclick="exportExcel()"],
  #tab-manage .manage-toolbar .toolbar-right > button[onclick="openImportModal()"],
  #tab-manage .manage-toolbar .toolbar-right > button[onclick="openOptionsModal()"] {
    display: none !important;
  }
  #tab-manage .manage-toolbar .toolbar-right > .btn,
  #tab-manage .manage-toolbar .toolbar-right > .batch-dropdown,
  #tab-manage .manage-toolbar .toolbar-right .batch-dropdown > .btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 29px !important;
    font-size: 11px !important;
    padding: 0 4px !important;
    margin: 0 !important;
  }
  .quick-status-legend {
    display: none !important;
  }

  /* --------------------------------------------------------------------------
     5. SCHEDULE MANAGEMENT (#module-schedule) STREAMLINED MOBILE UX
     -------------------------------------------------------------------------- */
  #scheduleToolbarCard.schedule-toolbar-card {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 6px 8px !important;
    gap: 5px !important;
    min-height: 0 !important;
    margin-bottom: 6px !important;
  }
  #scheduleToolbarCard .parts-toolbar-left {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  /* Make week nav buttons span full width on row 1 */
  #scheduleToolbarCard .parts-toolbar-left > .filter-group:first-child {
    grid-column: 1 / -1 !important;
    display: flex !important;
    justify-content: space-between !important;
    gap: 3px !important;
  }
  /* Hide 4주전 / 4주후 on mobile so ◀이전주 | 날짜 | 오늘 | 다음주▶ fits on 1 crisp line */
  #scheduleToolbarCard button[onclick="shiftScheduleWeeks(-4)"],
  #scheduleToolbarCard button[onclick="shiftScheduleWeeks(4)"] {
    display: none !important;
  }
  #schedStartMondayInput {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 28px !important;
  }
  #scheduleToolbarCard .search-group,
  #scheduleToolbarCard .clearable-input-wrap,
  #schedSearchInput {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 29px !important;
  }
  #scheduleToolbarCard .parts-toolbar-right {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  /* Hide desktop export/dropdown buttons on mobile schedule toolbar */
  #scheduleToolbarCard button[onclick="exportScheduleCsv()"],
  #scheduleToolbarCard button[onclick="openDropdownEditor('schedule_worker')"] {
    display: none !important;
  }
  #scheduleToolbarCard .parts-toolbar-right .btn {
    height: 29px !important;
    font-size: 11.5px !important;
  }

  /* Compact Week Header on Mobile */
  .sched-week-header {
    padding: 6px 8px !important;
    gap: 5px !important;
  }
  .sched-week-duty-group {
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 4px 6px !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
  }
  .sched-week-select {
    height: 26px !important;
    font-size: 11.5px !important;
    flex: 1 1 70px !important;
    max-width: 110px !important;
  }

  /* Align mobile schedule Subheader & Item Rows at 38% : 62% so Notes & Checkboxes have ample width! */
  .sched-day-subhdr,
  .sched-item-row {
    grid-template-columns: 38% 62% !important;
  }
  .sched-item-row.is-full-width-note-row {
    grid-template-columns: 100% !important;
  }

  /* --------------------------------------------------------------------------
     6. PARTS (#module-parts) & RANGE (#module-range) COMPACT MOBILE TOOLBARS
     -------------------------------------------------------------------------- */
  #partsToolbarCard.parts-toolbar-card,
  #rangeToolbarCard.range-toolbar-card {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 6px 8px !important;
    gap: 5px !important;
    min-height: 0 !important;
  }
  #partsToolbarCard .parts-toolbar-left,
  #rangeToolbarCard .parts-toolbar-left {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  #partsToolbarCard .filter-group,
  #rangeToolbarCard .filter-group {
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
  }
  #partsToolbarCard .filter-group label,
  #rangeToolbarCard .filter-group label {
    font-size: 10.5px !important;
  }
  #partsStackFilter,
  #partsSystemFilter,
  #partsPartFilter,
  #rangeStackFilter,
  #rangeO2Filter,
  #rangeCategoryFilter {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 29px !important;
    font-size: 11px !important;
    padding: 0 4px !important;
  }
  #partsToolbarCard .search-group,
  #rangeToolbarCard .search-group {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  #partsSearchInput,
  #rangeSearchInput {
    width: 100% !important;
    height: 29px !important;
    font-size: 11.5px !important;
  }
  #partsToolbarCard .parts-toolbar-right,
  #rangeToolbarCard .parts-toolbar-right {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  /* Hide CSV export/import on mobile Parts & Range toolbars */
  #partsToolbarCard button[onclick="exportPartsCsv()"],
  #partsToolbarCard button[onclick="openPartsImportModal()"],
  #rangeToolbarCard button[onclick="exportRangeCsv()"],
  #rangeToolbarCard button[onclick="openRangeImportModal()"] {
    display: none !important;
  }
  #partsToolbarCard .parts-toolbar-right .btn,
  #rangeToolbarCard .parts-toolbar-right .btn {
    height: 29px !important;
    font-size: 11.5px !important;
  }

  /* --------------------------------------------------------------------------
     7. MODALS & FLOATING POPOVERS MOBILE FIT
     -------------------------------------------------------------------------- */
  .sched-floating-popover,
  #schedQuickStackPickerPopover,
  #schedHolidayPopover,
  #gsColorPickerPopover {
    width: calc(100vw - 14px) !important;
    max-width: 420px !important;
    left: 7px !important;
  }
  .sched-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .modal-card,
  .modal-content,
  #gsDropdownModal .gs-dropdown-modal-card {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 92vh !important;
    margin: 3vh auto !important;
  }
  #gsDropdownModal .gs-module-switcher {
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 6px 8px !important;
    gap: 4px !important;
  }
  #gsDropdownModal .gs-modal-body {
    padding: 8px !important;
  }
  #gsProToolbar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

/* Vertical 1-per-line stacking for multiple co-located stacks inside a single schedule cell */
.sched-stack-vertical-group {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  width: 100% !important;
  padding: 2px 0 !important;
}


/* ==========================================================================
   CONSOLIDATED SCHEDULE & HEADER UI STYLES (v43 Clean Build)
   ========================================================================== */

/* 1. Top Global Header Bar: Prevent Right-Side Overflow on All Desktop Resolutions */
@media (min-width: 901px) {
  .app-header {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    padding: 0 12px !important;
    gap: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow: hidden !important;
  }

  .header-left {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    flex-shrink: 0 !important;
    gap: 7px !important;
  }

  .header-title-box .sub-text {
    display: none !important;
  }

  .header-title-box h1 {
    font-size: 15px !important;
    white-space: nowrap !important;
  }

  .header-center {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
  }

  .master-module-switcher {
    gap: 2px !important;
    padding: 3px !important;
    flex-shrink: 0 !important;
  }

  .btn-master-module {
    height: 28px !important;
    padding: 0 8px !important;
    font-size: 11.5px !important;
  }

  #scheduleNavTabs,
  #gasNavTabs,
  #partsNavTabs,
  #rangeNavTabs {
    height: 34px !important;
    padding: 3px !important;
    gap: 2px !important;
    flex-shrink: 0 !important;
  }

  #scheduleNavTabs .tab-btn,
  #gasNavTabs .tab-btn,
  #partsNavTabs .tab-btn,
  #rangeNavTabs .tab-btn {
    height: 28px !important;
    padding: 0 8px !important;
    font-size: 11.5px !important;
  }

  .header-right {
    margin-left: auto !important;
    flex-shrink: 0 !important;
    gap: 5px !important;
  }

  .header-right > .btn {
    height: 27px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
  }

  .header-sync-pill {
    height: 27px !important;
    padding: 0 7px !important;
    font-size: 11px !important;
  }

  #synoAuthBadge {
    display: none !important;
  }

  .user-badge {
    gap: 3px !important;
    font-size: 11.5px !important;
  }

  #btnHeaderLogin,
  #btnHeaderChangePw,
  #btnHeaderLogout {
    height: 26px !important;
    padding: 0 7px !important;
    margin-left: 3px !important;
    font-size: 11px !important;
  }
}

/* 2. Equal-Width Top KPI Bars on Desktop (4 Columns Locked at 1:1:1:1 on >= 901px, 2x2 on Mobile) */
@media (min-width: 901px) {
  .schedule-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
}
.schedule-kpi-grid .kpi-card {
  min-width: 0 !important;
  overflow: hidden !important;
  padding: 7px 12px !important;
}
.schedule-kpi-grid .kpi-header {
  white-space: nowrap !important;
  overflow: hidden !important;
  gap: 4px !important;
}
.schedule-kpi-grid .kpi-label {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#schedKpiRoutineWorkerBadge {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 55% !important;
  flex-shrink: 1 !important;
}
.schedule-kpi-grid .kpi-value {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* 3. Exact 44% / 56% Column Alignment Between Day Subheader & Item Rows */
.sched-day-subhdr {
  display: grid !important;
  grid-template-columns: 44% 56% !important;
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  align-items: center;
}
.sched-day-highlight-input {
  width: 100%;
  height: 22px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 3px;
  outline: none;
  text-align: center;
  transition: all 0.12s ease;
}
.sched-day-highlight-input::placeholder {
  color: #94a3b8;
  font-weight: 600;
}
.sched-day-highlight-input:focus {
  background: #ffffff;
  border-color: #d97706;
  color: #92400e;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}
.sched-day-highlight-input.has-hl-val {
  background: #fef3c7;
  color: #b91c1c;
  border-color: #f59e0b;
}

/* 4. Full-Width Row when Stack is Empty and Only Note Exists */
.sched-item-row.is-full-width-note-row {
  grid-template-columns: 100% !important;
}
.sched-item-row.is-full-width-note-row .sched-item-note-cell {
  width: 100% !important;
  padding: 5px 9px !important;
  border-right: none !important;
}

/* 5. Inspection Type Row Accents & Badges (긴급점검 / 일정변경 / 추가점검) */
.sched-item-row.item-type-emergency {
  background: #fff1f2 !important;
  border-left: 4px solid #e11d48 !important;
}
.sched-item-row.item-type-changed {
  background: #fffbeb !important;
  border-left: 4px solid #d97706 !important;
}
.sched-item-row.item-type-additional {
  background: #eff6ff !important;
  border-left: 4px solid #2563eb !important;
}
.badge-sched-type {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.25;
  white-space: nowrap;
}
.badge-sched-type.emergency {
  background: #ffe4e6;
  color: #be123c;
  border: 1px solid #fda4af;
}
.badge-sched-type.changed {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}
.badge-sched-type.additional {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

/* 6. Inline Note Style Toolbar (Background, Text Color, Font Size, Item Type) */
.sched-inline-style-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 5px 7px;
  width: 100%;
}
.sched-style-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.sched-style-lbl {
  font-size: 10.5px;
  font-weight: 800;
  color: #475569;
  min-width: 36px;
}
.btn-sched-type-pill {
  height: 22px;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 800;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
}
.btn-sched-type-pill.active[data-itype="regular"] {
  background: #0d9488;
  color: #ffffff;
  border-color: #0f766e;
}
.btn-sched-type-pill.active[data-itype="emergency"] {
  background: #e11d48;
  color: #ffffff;
  border-color: #be123c;
}
.btn-sched-type-pill.active[data-itype="changed"] {
  background: #d97706;
  color: #ffffff;
  border-color: #b45309;
}
.btn-sched-type-pill.active[data-itype="additional"] {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}
.sched-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid #94a3b8;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
}
.sched-color-swatch.active {
  outline: 2px solid #0f172a;
  outline-offset: 1px;
}

/* 7. Per-Stack Water-Wash Checkboxes (☐ 💧수세척 / ☑️ 💧수세척) */
.wash-check-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  margin-bottom: 2px;
}
.badge-water-wash-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1.5px solid #60a5fa;
  font-size: 11px;
  font-weight: 800;
  padding: 1.5px 7px;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  line-height: 1.3;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}
.badge-water-wash-check:hover {
  background: #dbeafe;
  border-color: #2563eb;
}
.badge-water-wash-check.is-checked {
  background: #dcfce7;
  color: #15803d;
  border-color: #4ade80;
  box-shadow: 0 1px 2px rgba(22, 163, 74, 0.1);
}
.badge-water-wash-check input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #16a34a;
  cursor: pointer;
}
.badge-water-wash-check .wash-stack-tag {
  font-weight: 900;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.75);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 10.5px;
}
.sched-inline-slot-wash-lbl {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 800;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  padding: 2px 6px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.sched-inline-slot-wash-lbl.is-checked {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}
.sched-inline-slot-wash-lbl input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #16a34a;
  cursor: pointer;
}
.btn-slot-del {
  height: 24px;
  width: 22px;
  padding: 0;
  border: 1px solid #fca5a5;
  background: #fff1f2;
  color: #e11d48;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-slot-del:hover {
  background: #ffe4e6;
}

/* 8. N-Person Routine Worker Rotation Studio (4~6+ People) */
.routine-rotation-studio-card {
  background: linear-gradient(180deg, #f8fafc 0%, #f0fdfa 100%);
  border: 2px solid #0d9488;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.08);
}
.routine-queue-chip-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin: 8px 0;
}
.routine-queue-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eff6ff;
  border: 1.5px solid #3b82f6;
  color: #1e3a8a;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}
.routine-queue-chip .q-num {
  background: #2563eb;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
}
.routine-queue-arrow {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}
.btn-Cascade-routine {
  height: 23px;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 800;
  color: #fef08a;
  background: rgba(15, 118, 110, 0.85);
  border: 1px solid #2dd4bf;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.btn-Cascade-routine:hover {
  background: #0d9488;
  color: #ffffff;
}

/* 9. Unified Quick Stack Picker (⚡ 빠른 호기 추가) */
#schedQuickStackPickerPopover {
  z-index: 12000 !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28) !important;
  border: 2px solid #0d9488 !important;
}
.sched-picker-staged-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-height: 32px;
  padding: 5px 8px;
  background: #f0fdfa;
  border: 1.5px dashed #14b8a6;
  border-radius: 6px;
}
.sched-picker-staged-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 5px;
  background: #ffffff;
  border: 1px solid #0d9488;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.sched-picker-staged-chip .chip-del {
  border: none;
  background: #fee2e2;
  color: #dc2626;
  font-weight: 900;
  font-size: 10px;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.sched-unified-stack-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  background: #f8fafc;
  border: 1.5px solid #0d9488;
  border-radius: 6px;
  padding: 6px 8px;
  width: 100%;
}
.sched-unified-stack-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.sched-unified-stack-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 6px;
}

/* 10. Interactive Drag-and-Drop on Schedule Board */
.sched-item-row[draggable="true"] {
  cursor: grab;
  position: relative;
}
.sched-item-row[draggable="true"]:active {
  cursor: grabbing;
}
.sched-item-row.is-dragging-row {
  opacity: 0.42 !important;
  background: #e0f2fe !important;
  outline: 2px dashed #0284c7 !important;
}
.sched-day-col.is-drag-over-col {
  background: #f0fdfa !important;
  box-shadow: inset 0 0 0 2.5px #0d9488 !important;
}
.sched-item-row.is-drag-over-row {
  box-shadow: inset 0 3px 0 0 #0284c7 !important;
  background: #e0f2fe !important;
}
.sched-item-stack-cell.is-drag-over-merge {
  background: #fef08a !important;
  outline: 2px dashed #d97706 !important;
}

/* ==========================================================================
   v48 FINAL MOBILE OVERRIDES (All 4 Modules: Schedule, Gas, Parts, Range)
   Zero Filter Overlap · Visible Top-Left Logo · Compact Auto-Fit Table Columns
   ========================================================================== */
@media (max-width: 900px) {
  /* 1. Top Header Bar: Keep Logo + Title (Left) & Operator Badge (Right) on Row 1 Across ALL 4 Themes */
  body .app-header,
  body.theme-schedule .app-header,
  body.theme-gas .app-header,
  body.theme-parts .app-header,
  body.theme-range .app-header {
    position: relative !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 8px !important;
    gap: 5px !important;
    overflow: visible !important;
  }

  body .app-header .header-left,
  body.theme-schedule .app-header .header-left,
  body.theme-gas .app-header .header-left,
  body.theme-parts .app-header .header-left,
  body.theme-range .app-header .header-left {
    order: 1 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 48% !important;
    flex: 0 1 auto !important;
    gap: 5px !important;
    overflow: hidden !important;
  }

  body .app-header .logo-box {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    padding: 2px 6px !important;
    height: 22px !important;
    min-width: 40px !important;
    width: auto !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
  }

  body .app-header .header-title-box {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  body .app-header .header-title-box h1 {
    font-size: 13.5px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
    color: #ffffff !important;
  }

  body .app-header .header-title-box .sub-text {
    display: none !important;
  }

  body .app-header .header-right {
    order: 2 !important;
    width: auto !important;
    max-width: 52% !important;
    flex: 0 1 auto !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 3px !important;
    flex-wrap: nowrap !important;
  }

  body .app-header .header-center {
    order: 3 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
  }

  /* Ensure inactive sub-nav bars stay strictly hidden on mobile */
  .nav-tabs[style*="display: none"],
  .nav-tabs[style*="display:none"] {
    display: none !important;
  }

  /* 2. Force 2x2 Horizontal KPI Cards on Mobile (Schedule, Parts, Range) */
  .schedule-kpi-grid,
  .parts-kpi-grid,
  .range-kpi-grid,
  .kpi-grid-4 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
    margin-bottom: 6px !important;
  }

  .schedule-kpi-grid .kpi-card,
  .parts-kpi-grid .kpi-card,
  .range-kpi-grid .kpi-card {
    min-height: 48px !important;
    max-height: 58px !important;
    padding: 5px 8px !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .schedule-kpi-grid .kpi-header,
  .parts-kpi-grid .kpi-header,
  .range-kpi-grid .kpi-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    gap: 3px !important;
    margin-bottom: 2px !important;
  }

  .schedule-kpi-grid .kpi-label,
  .parts-kpi-grid .kpi-label,
  .range-kpi-grid .kpi-label {
    font-size: 10.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #schedKpiRoutineWorkerBadge {
    font-size: 10px !important;
    padding: 1px 5px !important;
    max-width: 82px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* 3. ALL 4 MODULE TOOLBAR CARDS: Eliminate Horizontal Scrollbars & Prevent Any Filter Overlap */
  #scheduleToolbarCard.schedule-toolbar-card,
  #partsToolbarCard.parts-toolbar-card,
  #rangeToolbarCard.range-toolbar-card,
  #tab-manage .manage-toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    padding: 6px 8px !important;
    gap: 5px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Make clearable input wrappers stretch 100% of their grid cell on mobile */
  .manage-toolbar .clearable-input-wrap,
  .parts-toolbar-card .clearable-input-wrap,
  .range-toolbar-card .clearable-input-wrap,
  .schedule-toolbar-card .clearable-input-wrap,
  .dash-filter-bar .clearable-input-wrap,
  .toolbar-search-clear-wrap {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 0 !important;
    display: flex !important;
  }

  /* Schedule Toolbar Mobile Layout */
  #scheduleToolbarCard .parts-toolbar-left {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 5px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  #scheduleToolbarCard .parts-toolbar-left > .filter-group:first-child {
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #scheduleToolbarCard .parts-toolbar-left > .filter-group:first-child .btn {
    padding: 0 6px !important;
    font-size: 11px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
  }

  #schedStartMondayInput {
    flex: 1 1 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 28px !important;
    font-size: 11.5px !important;
    padding: 0 4px !important;
  }

  #scheduleToolbarCard .parts-toolbar-left > .filter-group:nth-child(2),
  #scheduleToolbarCard .parts-toolbar-left > .filter-group:nth-child(3) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    overflow: hidden !important;
  }

  #scheduleToolbarCard .parts-toolbar-left > .filter-group label {
    font-size: 10.5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  #schedNumWeeksSelect,
  #schedStackFilter {
    flex: 1 1 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 28px !important;
    font-size: 11px !important;
    padding: 0 4px !important;
  }

  /* Parts & Range Toolbars: Clean 2x2 Grid (Row 1: Filter 1 + Filter 2, Row 2: Filter 3 + Search Input) */
  #partsToolbarCard .parts-toolbar-left,
  #rangeToolbarCard .parts-toolbar-left {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 5px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  #partsToolbarCard .filter-group,
  #rangeToolbarCard .filter-group,
  #partsToolbarCard .search-group,
  #rangeToolbarCard .search-group {
    grid-column: span 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    overflow: hidden !important;
    margin: 0 !important;
  }

  /* Hide redundant prefix labels in Parts & Range mobile filter cells because each <select> already displays "전체 스택", "전체 설비/계통", "전체 부품", "전체 호기 보기", "전체 표준산소"! */
  #partsToolbarCard .filter-group label,
  #rangeToolbarCard .filter-group label {
    display: none !important;
  }

  #partsStackFilter,
  #partsSystemFilter,
  #partsPartFilter,
  #rangeStackFilter,
  #rangeO2Filter,
  #rangeCategoryFilter {
    flex: 1 1 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 30px !important;
    font-size: 11.5px !important;
    padding: 0 6px !important;
    box-sizing: border-box !important;
  }

  #partsSearchInput,
  #rangeSearchInput {
    flex: 1 1 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 30px !important;
    font-size: 11.5px !important;
    padding: 0 22px 0 7px !important;
    box-sizing: border-box !important;
  }

  #partsToolbarCard .parts-toolbar-right,
  #rangeToolbarCard .parts-toolbar-right {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 5px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  #partsToolbarCard .parts-toolbar-right .btn,
  #rangeToolbarCard .parts-toolbar-right .btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 30px !important;
    font-size: 11.5px !important;
    padding: 0 6px !important;
  }

  /* Gas Dashboard Filter Bar: Clean 2-Row x 3-Column Grid */
  .dash-filter-bar {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    padding: 6px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: normal !important;
  }

  .dash-filter-bar .filter-group {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
    overflow: hidden !important;
  }

  .dash-filter-bar .filter-group label {
    font-size: 10.5px !important;
    min-width: 0 !important;
    flex-shrink: 0 !important;
  }

  .dash-filter-bar select,
  .dash-filter-bar select#dashFilterStatus,
  .dash-filter-bar select#dashFilterQuarter,
  .dash-filter-bar select#dashFilterLocation,
  .dash-filter-bar select#dashFilterGas,
  .dash-filter-bar select#dashSortSelect {
    flex: 1 1 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 29px !important;
    font-size: 11px !important;
    padding: 0 3px !important;
  }

  .dash-filter-bar .search-group {
    grid-column: span 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  .dash-filter-bar .search-group input#dashSearchInput {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 29px !important;
    font-size: 11px !important;
    padding: 0 20px 0 6px !important;
  }

  /* 4. Mobile Table Column Proportions: Auto-Fit Content so Key Columns (스택, 설비, 부품명, 교체일) Show Immediately */
  .parts-history-table,
  .detail-table,
  .manage-table,
  .range-spec-table,
  .history-table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 100% !important;
  }

  .parts-history-table th,
  .parts-history-table td,
  .detail-table th,
  .detail-table td,
  .manage-table th,
  .manage-table td,
  .range-spec-table th,
  .range-spec-table td,
  .history-table th,
  .history-table td {
    width: auto !important;
    min-width: 0 !important;
    padding: 5px 6px !important;
    font-size: 11.5px !important;
    white-space: nowrap !important;
  }

  /* Hide redundant row-index (#) column on mobile Parts History Table so Stack + System + Part Name + Date all fit on screen! */
  .parts-history-table th:nth-child(2),
  .parts-history-table td:nth-child(2) {
    display: none !important;
  }

  /* Keep Parts History Remarks column readable without stretching the entire table */
  .parts-history-table td:nth-child(9) {
    max-width: 160px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* ==========================================================================
   v49 FLUID VIEWPORT-ADAPTIVE SCHEDULE HEADER, SINGLE-DAY BAR & ALL-MODULE BARS
   Zero Awkward Mid-Word / Mid-Control Wrapping Across All Phone Resolutions (320px ~ 900px)
   ========================================================================== */

/* Desktop defaults for new semantic Week Header classes */
.sched-week-hdr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sched-week-hdr-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.sched-week-date-range {
  font-size: 13.5px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
}
.sched-this-week-badge {
  background: #f59e0b;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.btn-week-detail-mobile {
  display: none !important;
}
.btn-week-detail-desktop {
  height: 25px;
  padding: 0 8px;
  font-size: 11px;
  color: #e2e8f0;
  border-color: #475569;
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}
.sched-week-hdr-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sched-duty-lbl {
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}
.sched-duty-lbl.is-routine-lbl {
  color: #5eead4;
}
.sched-duty-lbl.is-weekend-lbl {
  color: #fde047;
}
.sched-single-day-right-btns {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.single-day-today-pill {
  background: #0d9488;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  white-space: nowrap;
}
.single-day-hol-pill {
  background: #e11d48;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  /* 1. Week Header (.sched-week-header): 3 Crisp, Non-Wrapping Rows on ANY Phone Width */
  .sched-week-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 6px 8px !important;
    gap: 5px !important;
  }

  /* Row 1: Date Range + ⭐이번주 on Left | 📝상세편집 Button on Right (Saves an entire row!) */
  .sched-week-hdr-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
    flex-wrap: nowrap !important;
  }

  .sched-week-hdr-title-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  .sched-week-date-range {
    font-size: clamp(11.5px, 3.3vw, 13.5px) !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .sched-this-week-badge {
    font-size: clamp(9.5px, 2.6vw, 11px) !important;
    padding: 1px 6px !important;
    flex-shrink: 0 !important;
  }

  .btn-week-detail-mobile {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 24px !important;
    padding: 0 7px !important;
    font-size: clamp(10px, 2.7vw, 11px) !important;
    font-weight: 700 !important;
    color: #e2e8f0 !important;
    border: 1px solid #475569 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .btn-week-detail-desktop {
    display: none !important;
  }

  /* Row 2 & Row 3 Container */
  .sched-week-hdr-controls {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Lock BOTH .sched-week-duty-group rows (Routine & Weekend Duty) to 1 SINGLE LINE (flex-wrap: nowrap) */
  .sched-week-duty-group,
  .sched-week-duty-group.is-routine-group,
  .sched-week-duty-group.is-weekend-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 4px 6px !important;
    gap: clamp(3px, 1vw, 6px) !important;
    overflow: hidden !important;
  }

  .sched-duty-lbl {
    font-size: clamp(10.5px, 2.9vw, 12px) !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* Routine Select & Weekend Primary/Secondary Selects flex fluidly to fit any screen width */
  .sched-week-duty-group.is-routine-group .sched-week-select {
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 58px !important;
    max-width: none !important;
    height: 26px !important;
    font-size: clamp(11px, 3vw, 12px) !important;
    padding: 0 4px !important;
  }

  .sched-week-duty-group.is-routine-group .btn-Cascade-routine {
    flex-shrink: 0 !important;
    height: 26px !important;
    padding: 0 7px !important;
    font-size: clamp(10px, 2.7vw, 11px) !important;
    white-space: nowrap !important;
  }

  .sched-week-duty-group.is-weekend-group .duty-role-tag {
    flex-shrink: 0 !important;
    font-size: clamp(9.5px, 2.5vw, 10.5px) !important;
    padding: 1px 4px !important;
  }

  .sched-week-duty-group.is-weekend-group .sched-week-select {
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 50px !important;
    max-width: none !important;
    height: 26px !important;
    font-size: clamp(11px, 3vw, 12px) !important;
    padding: 0 3px !important;
  }

  /* 2. Single-Day Navigation Bar (.sched-single-day-ctrl): Strict 1-Line Layout (Zero Wrapping of 요일 or 오늘 badge!) */
  .sched-single-day-nav {
    padding: 6px 6px !important;
    gap: 5px !important;
  }

  .sched-single-day-ctrl {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .sched-single-day-ctrl .btn-day-step {
    flex-shrink: 0 !important;
    height: 27px !important;
    padding: 0 clamp(6px, 2vw, 10px) !important;
    font-size: clamp(10.5px, 2.8vw, 12px) !important;
    white-space: nowrap !important;
  }

  .sched-single-day-current {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }

  .sched-single-day-current .single-day-date-txt {
    font-size: clamp(11.5px, 3.3vw, 13.5px) !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .sched-single-day-current .single-day-today-pill,
  .sched-single-day-current .single-day-hol-pill {
    flex-shrink: 0 !important;
    font-size: clamp(9.5px, 2.5vw, 10.5px) !important;
    padding: 1px 5px !important;
  }

  /* 5-Day Tab Strip Below Single-Day Nav: Scale fluidly on narrow phones (Fold cover / 320px~430px) */
  .sched-day-tab-strip {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: clamp(3px, 1vw, 5px) !important;
    width: 100% !important;
  }

  .sched-day-tab-btn {
    padding: 4px 2px !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .sched-day-tab-btn .d-tab-top {
    display: flex !important;
    align-items: baseline !important;
    justify-content: center !important;
    gap: 2px !important;
    white-space: nowrap !important;
  }

  .sched-day-tab-btn .d-tab-name {
    font-size: clamp(11px, 3vw, 12.5px) !important;
  }

  .sched-day-tab-btn .d-tab-date {
    font-size: clamp(9.5px, 2.5vw, 10.5px) !important;
  }

  .sched-day-tab-btn .d-tab-badges {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    white-space: nowrap !important;
    font-size: clamp(9px, 2.4vw, 10px) !important;
  }

  /* 3. Day Column Header (.sched-day-hdr) & Weekday Holiday Duty Bar: Strict 1-Line No-Wrap */
  .sched-day-hdr {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 5px 8px !important;
    gap: 4px !important;
    white-space: nowrap !important;
  }

  .sched-day-hdr > span:first-child {
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
    font-size: clamp(11.5px, 3.2vw, 13px) !important;
  }

  .sched-day-hdr-actions {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
  }

  .sched-weekday-holiday-duty {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 3px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .sched-weekday-holiday-duty select {
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 48px !important;
    height: 24px !important;
    font-size: clamp(10.5px, 2.8vw, 11.5px) !important;
  }

  /* 4. Panel Headers Across All Modules (Parts Matrix, Range Header, Gas History): Prevent Awkward Wrapping */
  #partsMatrixPanel .matrix-filter-controls {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 4px !important;
  }

  #partsMatrixPanel .matrix-filter-pills {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 3px !important;
    width: 100% !important;
  }

  #partsMatrixPanel .btn-matrix-filter {
    width: 100% !important;
    text-align: center !important;
    padding: 4px 2px !important;
    font-size: clamp(10px, 2.7vw, 11.5px) !important;
    white-space: nowrap !important;
  }

  #partsMatrixPanel #matrixPartSearchInput,
  #partsMatrixPanel .clearable-input-wrap {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    height: 28px !important;
  }

  #partsMatrixPanel .matrix-filter-controls > .badge {
    display: none !important;
  }

  #rangeMainPanel .panel-header-flex {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 8px !important;
    gap: 4px !important;
  }

  #rangeMainPanel .panel-title {
    font-size: clamp(11.5px, 3.2vw, 13px) !important;
  }

  /* 5. Day Edit Modal Top Bars (Routine & Holiday Duty): Clean Grid on Mobile */
  #scheduleDayEditModal #schedModalHolidayBox > div,
  #scheduleDayEditModal .modal-card > div > div:first-of-type > div {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
}

/* Ultra-narrow screens (<= 355px, e.g., Galaxy Z Fold Cover Screen) */
@media (max-width: 355px) {
  .sched-duty-lbl .wknd-date-sub {
    display: none !important;
  }
}

/* ==========================================================================
   v54 DESKTOP TOP HEADER OVERFLOW & COLLISION FIX (901px ~ 2560px)
   Guarantees ZERO overlap between #scheduleNavTabs ("변경 이력") and .header-right
   ========================================================================== */
@media (min-width: 901px) {
  .app-header {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 0 clamp(6px, 0.7vw, 14px) !important;
    gap: clamp(4px, 0.5vw, 10px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .app-header .header-left {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .app-header .logo-box {
    width: auto !important;
    min-width: 42px !important;
    padding: 0 7px !important;
    height: 25px !important;
    font-size: 11px !important;
  }

  .app-header .header-title-box h1 {
    font-size: clamp(13px, 0.95vw, 15px) !important;
    white-space: nowrap !important;
  }

  .app-header .header-title-box .sub-text {
    display: none !important;
  }

  /* Strictly confine .header-center to remaining space so it NEVER bleeds under .header-right */
  .app-header .header-center {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: clamp(4px, 0.45vw, 8px) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
  }
  .app-header .header-center::-webkit-scrollbar {
    display: none !important;
  }

  .app-header .master-module-switcher,
  .app-header #scheduleNavTabs,
  .app-header #gasNavTabs,
  .app-header #partsNavTabs,
  .app-header #rangeNavTabs {
    height: 32px !important;
    padding: 2px !important;
    gap: 2px !important;
    flex: 0 0 auto !important;
    align-items: center !important;
  }

  .app-header .btn-master-module,
  .app-header #scheduleNavTabs .tab-btn,
  .app-header #gasNavTabs .tab-btn,
  .app-header #partsNavTabs .tab-btn,
  .app-header #rangeNavTabs .tab-btn {
    height: 27px !important;
    padding: 0 clamp(5px, 0.5vw, 9px) !important;
    font-size: clamp(10.5px, 0.78vw, 12px) !important;
    white-space: nowrap !important;
    gap: 3px !important;
  }

  .app-header .header-right {
    position: relative !important;
    z-index: 2 !important;
    margin-left: auto !important;
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: clamp(3px, 0.35vw, 6px) !important;
    white-space: nowrap !important;
  }

  .app-header .header-right > .btn {
    height: 27px !important;
    padding: 0 clamp(5px, 0.5vw, 9px) !important;
    font-size: clamp(10.5px, 0.75vw, 11.5px) !important;
    white-space: nowrap !important;
  }

  .app-header .header-sync-pill {
    height: 27px !important;
    padding: 0 6px !important;
    font-size: 10.5px !important;
    white-space: nowrap !important;
  }

  .app-header .user-badge {
    gap: 3px !important;
    font-size: clamp(10.5px, 0.78vw, 12px) !important;
    white-space: nowrap !important;
  }

  .app-header #btnHeaderLogin,
  .app-header #btnHeaderChangePw,
  .app-header #btnHeaderLogout {
    height: 26px !important;
    padding: 0 6px !important;
    margin-left: 2px !important;
    font-size: clamp(10.5px, 0.75vw, 11.5px) !important;
  }
}

/* On 901px ~ 1560px viewports (1280px~1536px laptops / 125%~150% scaling), compact non-essential labels so ALL tabs + buttons fit on 1 line with zero scrolling */
@media (min-width: 901px) and (max-width: 1560px) {
  .app-header .btn-master-module .m-icon {
    display: none !important;
  }
  .app-header #userLabelText {
    display: none !important;
  }
  .app-header .header-sync-pill {
    max-width: 78px !important;
    overflow: hidden !important;
  }
}

/* ==========================================================================
   v55 ALL-MODULE DESKTOP TOOLBAR & KPI POLISH (901px ~ 2560px)
   Eliminates Horizontal Scrollbars, Clipped Selects, & Overlaps Across ALL 4 Modules
   ========================================================================== */
@media (min-width: 901px) {
  /* 1. Unify ALL 4 Module Toolbars: Fluid Sizing + Clean Wrap (Zero Clipping / Zero Scrollbar) */
  #scheduleToolbarCard.schedule-toolbar-card,
  #tab-manage .manage-toolbar,
  #partsToolbarCard.parts-toolbar-card,
  #rangeToolbarCard.range-toolbar-card {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    padding: 6px 10px !important;
    min-height: 44px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  #scheduleToolbarCard .parts-toolbar-left,
  #tab-manage .manage-toolbar .toolbar-left,
  #partsToolbarCard .parts-toolbar-left,
  #rangeToolbarCard .parts-toolbar-left {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 5px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  #scheduleToolbarCard .parts-toolbar-right,
  #tab-manage .manage-toolbar .toolbar-right,
  #partsToolbarCard .parts-toolbar-right,
  #rangeToolbarCard .parts-toolbar-right {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    margin-left: auto !important;
  }

  #tab-manage .search-filter-inline {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  /* Fluid Select & Search Input Widths (Fit 1 line on 1366px~1920px without clipping) */
  #schedNumWeeksSelect {
    width: clamp(92px, 6.8vw, 114px) !important;
    min-width: 0 !important;
  }
  #schedStackFilter {
    width: clamp(108px, 8.2vw, 138px) !important;
    min-width: 0 !important;
  }
  #schedSearchInput {
    width: clamp(120px, 10.5vw, 195px) !important;
    min-width: 0 !important;
  }
  #schedStartMondayInput {
    width: clamp(108px, 7.5vw, 126px) !important;
    min-width: 0 !important;
  }

  #partsStackFilter { width: clamp(102px, 7.5vw, 130px) !important; min-width: 0 !important; }
  #partsSystemFilter { width: clamp(112px, 8.2vw, 142px) !important; min-width: 0 !important; }
  #partsPartFilter { width: clamp(102px, 7.5vw, 130px) !important; min-width: 0 !important; }
  #partsSearchInput { width: clamp(115px, 9.5vw, 170px) !important; min-width: 0 !important; }

  #rangeStackFilter { width: clamp(110px, 8.2vw, 145px) !important; min-width: 0 !important; }
  #rangeO2Filter { width: clamp(88px, 6.4vw, 112px) !important; min-width: 0 !important; }
  #rangeCategoryFilter { width: clamp(108px, 7.8vw, 135px) !important; min-width: 0 !important; }
  #rangeSearchInput { width: clamp(120px, 10vw, 180px) !important; min-width: 0 !important; }

  #manageSortSelect { width: clamp(92px, 6.6vw, 112px) !important; min-width: 0 !important; }
  #manageFilterQuarter { width: clamp(76px, 5.5vw, 90px) !important; min-width: 0 !important; }
  #manageFilterLocation { width: clamp(82px, 6vw, 98px) !important; min-width: 0 !important; }
  #manageFilterGas { width: clamp(76px, 5.5vw, 90px) !important; min-width: 0 !important; }
  #manageFilterStatus { width: clamp(76px, 5.5vw, 90px) !important; min-width: 0 !important; }
  #manageSearchInput { width: clamp(100px, 8vw, 145px) !important; min-width: 0 !important; }

  /* Compact Toolbar Buttons so all 4~7 action buttons fit comfortably */
  #scheduleToolbarCard .btn,
  #partsToolbarCard .btn,
  #rangeToolbarCard .btn,
  #tab-manage .manage-toolbar .btn {
    height: 29px !important;
    padding: 0 clamp(6px, 0.5vw, 9px) !important;
    font-size: clamp(11px, 0.74vw, 12px) !important;
    white-space: nowrap !important;
  }

  /* 2. Schedule KPI Card 2 Badge: Give more room so routine + weekend duty is not cut off early */
  #schedKpiRoutineWorkerBadge {
    max-width: 66% !important;
    font-size: clamp(10px, 0.72vw, 11.5px) !important;
    padding: 1px 6px !important;
  }
}

/* ==========================================================================
   v56 SCHEDULE BOARD FULL-HEIGHT GRID LINES (Zero Blank Bottom Gap)
   Ensures every weekday column is filled to the very bottom with lined grid rows
   ========================================================================== */
.sched-day-items {
  background: linear-gradient(90deg, transparent calc(44% - 1px), #e2e8f0 calc(44% - 1px), #e2e8f0 44%, transparent 44%);
}
.sched-day-items .sched-item-row.is-empty-sched-row {
  flex: 1 1 28px !important;
  min-height: 28px !important;
  height: auto !important;
}

/* === v60: 인라인 행 편집 플로팅 카드 (행 추가/편집 시 일정표 높이 늘어남 완전 방지) === */
.sched-week-card:has(.is-inline-editing-anchor),
.sched-week-grid:has(.is-inline-editing-anchor),
.sched-day-col:has(.is-inline-editing-anchor),
.sched-day-items:has(.is-inline-editing-anchor) {
    overflow: visible !important;
}
.sched-day-col:has(.is-inline-editing-anchor) {
    z-index: 60 !important;
}
.sched-item-row.is-inline-editing-anchor {
    position: relative !important;
    min-height: 30px !important;
    height: 30px !important;
    max-height: 30px !important;
    padding: 0 !important;
    background: #ccfbf1 !important;
    border-bottom: 1px solid #14b8a6 !important;
    overflow: visible !important;
    z-index: 120 !important;
}
.sched-inline-floating-card {
    position: absolute !important;
    left: -3px !important;
    right: -3px !important;
    top: -2px !important;
    z-index: 250 !important;
    background: #f0fdfa !important;
    border: 2px solid #0d9488 !important;
    border-radius: 9px !important;
    padding: 8px 9px !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(13, 148, 136, 0.2) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

/* === v62: 점검 호기 서브헤더(.sched-day-subhdr)와 실제 점검 호기 행(.sched-item-row) 세로 구분선 100% 일치 고정 === */
:root {
  --sched-col-left: 44%;
  --sched-col-right: 56%;
}
@media (max-width: 900px) {
  :root {
    --sched-col-left: 38%;
    --sched-col-right: 62%;
  }
}
.sched-day-subhdr,
.sched-item-row:not(.is-full-width-note-row) {
  display: grid !important;
  grid-template-columns: var(--sched-col-left) var(--sched-col-right) !important;
  box-sizing: border-box !important;
}
.sched-day-subhdr > div:first-child,
.sched-item-row:not(.is-full-width-note-row) > .sched-item-stack-cell {
  border-right: 1px solid #cbd5e1 !important;
  box-sizing: border-box !important;
}
.sched-day-items {
  background: none !important;
}

/* ==========================================================================
   v63: Z-INDEX 5단계 토큰화 · 터치 깜빡임 제거 · 2단 반응형(<=900px / >=901px) 단일 기준선
   ========================================================================== */
:root {
  --z-sticky: 20;
  --z-header: 100;
  --z-floating-editor: 250;
  --z-modal: 1000;
  --z-popover: 2010;
  --z-toast: 3000;
}

select {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.app-header {
  z-index: var(--z-header) !important;
}

.modal-overlay,
.modal-backdrop {
  z-index: var(--z-modal) !important;
}

.sched-floating-popover,
#schedQuickStackPickerPopover,
#universalOptionPickerPopover,
#schedHolidayPopover,
#gsColorPickerPopover {
  z-index: var(--z-popover) !important;
}

#toastContainer,
.toast-container {
  z-index: var(--z-toast) !important;
}

/* ==========================================================================
   v64: MOBILE VIEW-FIRST UX (<= 900px 기본 조회 우선 · [✏️ 편집] 토글 시 편집 도구 표시)
   ========================================================================== */
.btn-mobile-edit-toggle,
.sched-mobile-readonly-meta {
  display: none !important;
}

@media (max-width: 900px) {
  /* 1. Show compact View/Edit Toggle button in mobile header */
  .btn-mobile-edit-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 26px !important;
    padding: 0 9px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  .btn-mobile-edit-toggle.is-active {
    background: #f59e0b !important;
    color: #0f172a !important;
    border-color: #fde68a !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35) !important;
  }

  /* 2. VIEW MODE (Default on Mobile: body:not(.mobile-edit-mode)) */
  /* Header: Hide DB Backup admin button in View Mode (keep Integrated Lookup & Refresh!) */
  body:not(.mobile-edit-mode) .app-header button[onclick*="downloadDbBackup"] {
    display: none !important;
  }

  /* Module 0 (Schedule): Replace tall 2-row Routine/Duty edit form with compact 1-line summary */
  body:not(.mobile-edit-mode) .sched-mobile-readonly-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 4px !important;
    padding: 4px 8px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    font-size: 11.5px !important;
    color: #e2e8f0 !important;
    line-height: 1.3 !important;
  }
  body:not(.mobile-edit-mode) .sched-mobile-readonly-meta .m-meta-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    white-space: nowrap !important;
  }
  body:not(.mobile-edit-mode) .sched-mobile-readonly-meta .m-meta-pill strong {
    color: #fde047 !important;
    font-weight: 800 !important;
  }

  /* Hide Schedule edit controls in View Mode (keep Search, Stack Filter, Day Tabs & Water-Wash checkboxes!) */
  body:not(.mobile-edit-mode) #scheduleToolbarCard .parts-toolbar-right,
  body:not(.mobile-edit-mode) .sched-week-hdr-controls,
  body:not(.mobile-edit-mode) .btn-week-detail-mobile,
  body:not(.mobile-edit-mode) .sched-day-hdr-actions,
  body:not(.mobile-edit-mode) .btn-mobile-row-edit,
  body:not(.mobile-edit-mode) .sched-item-row.is-empty-sched-row,
  body:not(.mobile-edit-mode) #tabBtnSchedTemplate {
    display: none !important;
  }

  /* Make Schedule day highlight input clean read-only look when empty in View Mode */
  body:not(.mobile-edit-mode) .sched-day-highlight-input:placeholder-shown {
    opacity: 0.45 !important;
    pointer-events: none !important;
  }
  body:not(.mobile-edit-mode) .sched-day-highlight-input {
    pointer-events: none !important;
    background: transparent !important;
    border-color: transparent !important;
  }
  body:not(.mobile-edit-mode) .sched-day-highlight-input.has-hl-val {
    background: #fef3c7 !important;
    border: 1px solid #f59e0b !important;
  }

  /* Module 1 (Gas): Hide bulk/admin edit controls & row action buttons in View Mode */
  body:not(.mobile-edit-mode) #tab-manage .toolbar-right,
  body:not(.mobile-edit-mode) #btnToggleInline,
  body:not(.mobile-edit-mode) #inlineAddRow,
  body:not(.mobile-edit-mode) #module-gas .btn-edit-row,
  body:not(.mobile-edit-mode) #module-gas .btn-delete-row,
  body:not(.mobile-edit-mode) #module-gas button[onclick*="startDashInlineEdit"],
  body:not(.mobile-edit-mode) #module-gas button[onclick*="deleteCylinder"],
  body:not(.mobile-edit-mode) #module-gas button[onclick*="returnCylinder"],
  body:not(.mobile-edit-mode) #module-gas button[onclick*="openBatchMoveModal"] {
    display: none !important;
  }

  /* Module 2 (Parts): Hide registration/import/edit controls in View Mode */
  body:not(.mobile-edit-mode) #partsToolbarCard .parts-toolbar-right,
  body:not(.mobile-edit-mode) #partsNewCard,
  body:not(.mobile-edit-mode) #module-parts button[onclick*="openEditPartModal"],
  body:not(.mobile-edit-mode) #module-parts button[onclick*="deletePartRecord"] {
    display: none !important;
  }

  /* Module 3 (Range): Hide add/reorder/edit controls in View Mode */
  body:not(.mobile-edit-mode) #rangeToolbarCard .parts-toolbar-right,
  body:not(.mobile-edit-mode) #module-range button[onclick*="startRangeRowEdit"],
  body:not(.mobile-edit-mode) #module-range button[onclick*="deleteRangeRow"],
  body:not(.mobile-edit-mode) #module-range button[onclick*="moveRangeRow"] {
    display: none !important;
  }
}

/* ==========================================================================
   v65: MOBILE RESOLUTION-PROOF HEADER & VIEW-FIRST LAYOUT (<= 900px)
   - Row 1 never wraps vertically at any screen width (320px ~ 900px)
   - KPI cards move BELOW main data (order: 90) so data starts immediately at top
   - Heavy filter/date/account bars stay tucked behind [🔎 필터] / [✏️ 편집]
   ========================================================================== */
.btn-mobile-filter-toggle {
  display: none !important;
}

@media (max-width: 900px) {
  /* 0. Ultra-clean non-wrapping Mobile Header Row 1 */
  .m-hide-xs {
    display: none !important;
  }

  .app-header {
    padding: 6px 8px !important;
    gap: 5px !important;
  }

  .app-header .header-left {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    gap: 5px !important;
  }

  .app-header .logo-box {
    height: 24px !important;
    padding: 0 6px !important;
    font-size: 10.5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .app-header .header-title-box h1 {
    font-size: 14px !important;
    white-space: nowrap !important;
  }

  .app-header .header-right {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    margin-left: auto !important;
    white-space: nowrap !important;
  }

  .app-header .header-right > button,
  .app-header .header-right .btn {
    height: 26px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .btn-mobile-filter-toggle {
    display: inline-flex !important;
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    border-radius: 6px !important;
  }
  .btn-mobile-filter-toggle.is-active {
    background: #0ea5e9 !important;
    color: #ffffff !important;
    border-color: #7dd3fc !important;
  }

  /* Hide account badge (송인철/비번변경/로그아웃) & sync pill from crowded Row 1 by default;
     show them cleanly on a full-width non-wrapping strip when [🔎 필터] or [✏️ 편집] is open! */
  body:not(.mobile-filter-open):not(.mobile-edit-mode) .app-header .user-badge,
  body:not(.mobile-filter-open):not(.mobile-edit-mode) .app-header .header-sync-pill {
    display: none !important;
  }

  body.mobile-filter-open .app-header .header-right,
  body.mobile-edit-mode .app-header .header-right {
    flex-wrap: wrap !important;
  }

  body.mobile-filter-open .app-header .user-badge,
  body.mobile-edit-mode .app-header .user-badge {
    display: flex !important;
    flex-basis: 100% !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 5px !important;
    margin-top: 4px !important;
    padding-top: 4px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    white-space: nowrap !important;
  }

  .app-header .user-badge *,
  .app-header #btnHeaderLogin,
  .app-header #btnHeaderChangePw,
  .app-header #btnHeaderLogout {
    white-space: nowrap !important;
    word-break: keep-all !important;
    flex-shrink: 0 !important;
  }

  /* 1. Module Switcher (Row 2) & Subtabs (Row 3): Zero text collision at 320px~480px */
  .app-header .master-module-switcher {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 3px !important;
    padding: 2px !important;
    height: auto !important;
  }
  .app-header .btn-master-module {
    padding: 5px 2px !important;
    font-size: clamp(10.5px, 2.9vw, 12px) !important;
    justify-content: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    gap: 2px !important;
  }
  .app-header .btn-master-module .m-icon {
    display: none !important;
  }

  .app-header #scheduleNavTabs,
  .app-header #gasNavTabs,
  .app-header #partsNavTabs,
  .app-header #rangeNavTabs {
    width: 100% !important;
    padding: 2px !important;
    gap: 3px !important;
    height: auto !important;
  }
  .app-header #scheduleNavTabs .tab-btn,
  .app-header #gasNavTabs .tab-btn,
  .app-header #partsNavTabs .tab-btn,
  .app-header #rangeNavTabs .tab-btn {
    flex: 1 1 0 !important;
    padding: 4px 4px !important;
    font-size: clamp(10.5px, 2.9vw, 12px) !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }

  /* 2. CONTENT-FIRST ORDERING: Push KPI Grids BELOW main data on ALL 4 modules! */
  #module-schedule[style*="block"],
  #module-parts[style*="block"],
  #module-range[style*="block"],
  #tab-dashboard.active {
    display: flex !important;
    flex-direction: column !important;
  }

  #module-schedule > .kpi-grid,
  #tab-dashboard > .kpi-grid,
  #module-parts > .kpi-grid,
  #module-range > .kpi-grid {
    order: 90 !important;
    margin-top: 12px !important;
    margin-bottom: 8px !important;
  }

  /* Fix KPI card badge truncation so when scrolled to bottom, KPIs read cleanly */
  .kpi-card .kpi-header {
    gap: 4px !important;
    flex-wrap: wrap !important;
  }
  .kpi-card .kpi-title {
    font-size: 11px !important;
    white-space: nowrap !important;
  }
  #schedKpiRoutineWorkerBadge {
    max-width: 100% !important;
    font-size: 10px !important;
  }

  /* 3. Collapse bulky Filter / Date Toolbars behind [🔎 필터] in default View Mode! */
  body:not(.mobile-filter-open):not(.mobile-edit-mode) #scheduleToolbarCard,
  body:not(.mobile-filter-open):not(.mobile-edit-mode) #partsToolbarCard,
  body:not(.mobile-filter-open):not(.mobile-edit-mode) #rangeToolbarCard {
    display: none !important;
  }

  /* 4. Tighten main container & Schedule week/day top chrome so 5~7 stacks appear immediately on screen 1 */
  .main-container {
    padding: 6px 6px 24px !important;
  }

  .sched-week-card {
    margin-bottom: 10px !important;
  }

  .sched-week-header {
    padding: 6px 8px !important;
    gap: 4px !important;
  }

  .sched-week-date-range {
    font-size: 12.5px !important;
  }

  body:not(.mobile-edit-mode) .sched-mobile-readonly-meta {
    margin-top: 2px !important;
    padding: 3px 7px !important;
    font-size: 11px !important;
  }

  .sched-single-day-nav {
    padding: 5px 6px !important;
    gap: 5px !important;
  }

  .sched-day-tab-btn {
    padding: 4px 2px !important;
  }

  .sched-day-hdr {
    padding: 4px 8px !important;
  }
}

/* ==========================================================================
   v66: GALAXY Z FOLD COVER DISPLAY (<= 480px) & TRUE BOTTOM-KPI FIX (<= 900px)
   - Fixes KPI parent container (.main-container) so KPI cards truly move BELOW data
   - Eliminates KPI card vertical text overlap (height: auto + clean flex stack)
   - Dedicated narrow cover-screen tuning (344px ~ 430px) with zero clipping/wrapping
   ========================================================================== */
@media (max-width: 900px) {
  /* 1. True Content-First Flex Column on the ACTUAL parent of .kpi-grid across all 4 modules */
  #module-schedule > .main-container,
  #module-parts > .main-container,
  #module-range > .main-container,
  #tab-dashboard.active {
    display: flex !important;
    flex-direction: column !important;
  }

  #module-schedule > .main-container > .kpi-grid,
  #module-parts > .main-container > .kpi-grid,
  #module-range > .main-container > .kpi-grid,
  #tab-dashboard > .kpi-grid {
    order: 90 !important;
    margin-top: 12px !important;
    margin-bottom: 6px !important;
  }

  /* 2. Fix KPI card internal text overlap (remove fixed height & overflow collision) */
  .kpi-grid .kpi-card {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 7px 9px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    overflow: hidden !important;
  }

  .kpi-grid .kpi-card .kpi-header {
    position: static !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 3px !important;
    line-height: 1.25 !important;
  }

  .kpi-grid .kpi-card .kpi-value {
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    min-height: 0 !important;
  }
}

/* Dedicated Galaxy Z Fold Cover Display & Narrow Phone Tuning (<= 480px, down to 320px) */
@media (max-width: 480px) {
  .app-header {
    padding: 5px 6px !important;
    gap: 4px !important;
  }
  .app-header .logo-box {
    height: 22px !important;
    padding: 0 5px !important;
    font-size: 10px !important;
  }
  .app-header .header-title-box h1 {
    font-size: 13px !important;
  }
  .app-header .header-right {
    gap: 3px !important;
  }
  .app-header .header-right > button,
  .app-header .header-right .btn {
    height: 25px !important;
    padding: 0 6px !important;
    font-size: 10.5px !important;
  }

  .app-header .btn-master-module {
    font-size: 10.5px !important;
    padding: 5px 1px !important;
    letter-spacing: -0.4px !important;
  }
  .app-header #scheduleNavTabs .tab-btn,
  .app-header #gasNavTabs .tab-btn,
  .app-header #partsNavTabs .tab-btn,
  .app-header #rangeNavTabs .tab-btn {
    font-size: 10.5px !important;
    padding: 4px 2px !important;
    letter-spacing: -0.3px !important;
  }

  /* Hide redundant secondary link labels inside KPI headers on narrow cover screens (whole card is clickable) */
  .kpi-grid .kpi-card .kpi-header > a,
  .kpi-grid .kpi-card .kpi-header > span[onclick],
  .kpi-grid .kpi-card .kpi-header > button,
  #schedKpiRoutineWorkerBadge {
    font-size: 9.5px !important;
    padding: 1px 4px !important;
    line-height: 1.2 !important;
  }
  .kpi-grid .kpi-card .kpi-title {
    font-size: 10.5px !important;
    letter-spacing: -0.3px !important;
  }
  .kpi-grid .kpi-card .kpi-value,
  .kpi-grid .kpi-card .kpi-value strong,
  .kpi-grid .kpi-card .kpi-value span {
    font-size: 12px !important;
  }

  /* Compact Schedule Single-Day Nav for 344px~390px Fold cover screen */
  .sched-single-day-ctrl {
    gap: 3px !important;
  }
  .sched-single-day-ctrl .btn-day-step {
    padding: 4px 6px !important;
    font-size: 10.5px !important;
    white-space: nowrap !important;
  }
  .sched-single-day-current .single-day-date-txt {
    font-size: 11.5px !important;
    white-space: nowrap !important;
  }
  .sched-single-day-current .single-day-today-pill {
    display: none !important;
  }
  .sched-day-tab-btn .d-tab-name,
  .sched-day-tab-btn .d-tab-date {
    font-size: 10px !important;
  }

  /* Ensure Gas / Parts / Range tables scroll smoothly horizontally without breaking cover screen width */
  .table-container,
  .table-responsive,
  .table-wrapper {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .data-table th,
  .data-table td,
  .range-spec-table th,
  .range-spec-table td {
    font-size: 11px !important;
    padding: 5px 5px !important;
  }
}

/* v67: PWA 앱 설치 버튼 스타일 */
.btn-pwa-install {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border: 1px solid #6ee7b7 !important;
  font-weight: 800 !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3) !important;
  white-space: nowrap !important;
}

/* v68: 시놀로지 DSM 등록 계정 전용 모드 (자체 회원가입 탭 및 앱 내 비번변경 버튼 숨김) */
#tabModeRegister,
#btnHeaderChangePw {
  display: none !important;
}
