/*CSS cho các thành phần nội dung dashboard*/
/* Content Sections */
.content-section {
    margin-bottom: 1.5rem;
}

.card-title {
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Tables */
.table-container {
    max-height: 7cm;
    overflow-y: auto;
    border: 1px solid #ccc;
    margin-bottom: 10px;
}

/* Asset Tree base styles */
.asset-tree, .asset-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.asset-tree li {
  list-style-type: none;
  margin: 2px 0;
  padding-left: 20px;
  position: relative;
}

.asset-tree ul {
  border-left: 1px dashed #ccc;
}

/* Asset Tree */
.asset-tree-container {
    min-width: 320px;
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #e0e0e0;
    padding: 12px;
    border-radius: 8px;
    background: #fff;
}

.tree-node {
    display: flex;
    gap: 8px;
    align-items: center;
    cursor: pointer;
    padding: 2px 0;
}

.tree-node.leaf {
    font-weight: 600;
    color: #0a4b8a;
}

.tree-node .toggle-btn {
    width: 20px;
    text-align: center;
    font-weight: bold;
}

/* Charts */
.charts-container, .charts-containerday {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.chart {
    flex: 1;
    min-width: 300px;
    margin: 10px;
}

/* Role-aware operational homepage */
.role-home {
    display: grid;
    gap: 1rem;
}

.role-home-loading {
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #ffffff;
    color: #475569;
    font-weight: 700;
}

.role-home-context {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(30, 39, 65, 0.06);
}

.role-home-context h2,
.role-home-panel-header h2,
.role-home-section-title h2 {
    margin: 0;
    color: #172033;
    letter-spacing: 0;
}

.role-home-context h2 {
    margin-top: 0.35rem;
    font-size: 1.15rem;
    font-weight: 800;
}

.role-home-context p {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.88rem;
}

.role-home-persona {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: #e6f6fb;
    color: #075985;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.role-home-context-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem 0.8rem;
    color: #526071;
    font-size: 0.78rem;
}

.role-home-context-actions > span,
.role-home-context-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.role-home-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.role-home-metric {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 82px;
    gap: 0.7rem;
    padding: 0.75rem;
    border: 1px solid #dfe6ee;
    border-left: 4px solid var(--home-metric-color, #0ea5e9);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 7px 18px rgba(30, 39, 65, 0.05);
}

.role-home-metric-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--home-metric-soft, #e0f2fe);
    color: var(--home-metric-color, #0369a1);
    font-size: 1.05rem;
}

.role-home-metric > div {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.08rem 0.55rem;
    align-items: center;
}

.role-home-metric span:not(.role-home-metric-icon) {
    min-width: 0;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.role-home-metric strong {
    grid-row: 1 / span 2;
    grid-column: 2;
    color: #101828;
    font-size: 1.7rem;
    line-height: 1;
}

.role-home-metric small {
    color: #8491a3;
    font-size: 0.69rem;
    line-height: 1.2;
}

.role-home-metric--fail,
.role-home-metric--overdue {
    --home-metric-color: #dc2626;
    --home-metric-soft: #fee2e2;
}

.role-home-metric--stale {
    --home-metric-color: #d97706;
    --home-metric-soft: #fef3c7;
}

.role-home-metric--urgent {
    --home-metric-color: #ea580c;
    --home-metric-soft: #ffedd5;
}

.role-home-metric--approval {
    --home-metric-color: #7c3aed;
    --home-metric-soft: #ede9fe;
}

.role-home-metric--today {
    --home-metric-color: #0284c7;
    --home-metric-soft: #e0f2fe;
}

.role-home-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.role-home-panel,
.role-home-quick-section {
    min-width: 0;
    padding: 0.9rem;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(30, 39, 65, 0.06);
}

.role-home-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.75rem;
}

.role-home-panel-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #e8edf3;
}

.role-home-panel-header span {
    color: #0284c7;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.04em;
}

.role-home-panel-header h2 {
    margin-top: 0.12rem;
    font-size: 1rem;
    font-weight: 800;
}

.role-home-panel-header a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #075985;
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.role-home-list,
.role-home-machine-list {
    display: grid;
    align-content: start;
    gap: 0.55rem;
}

.role-home-task {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.7rem;
    border: 1px solid #e1e7ef;
    border-left: 4px solid #94a3b8;
    border-radius: 8px;
    background: #ffffff;
}

.role-home-task--urgent {
    border-left-color: #ea580c;
    background: #fffaf5;
}

.role-home-task--overdue {
    border-left-color: #dc2626;
    background: #fff8f8;
}

.role-home-task-body {
    min-width: 0;
    display: grid;
    gap: 0.28rem;
}

.role-home-tags,
.role-home-task-meta,
.role-home-kpi-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.role-home-tags span,
.role-home-kpi-chips span {
    padding: 0.13rem 0.4rem;
    border-radius: 999px;
    background: #edf2f7;
    color: #475569;
    font-size: 0.66rem;
    font-weight: 800;
}

.role-home-task h3 {
    margin: 0;
    color: #182033;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.role-home-task-meta {
    gap: 0.3rem 0.75rem;
    color: #667085;
    font-size: 0.7rem;
}

.role-home-task-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.role-home-task > .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.role-home-machine {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.2rem 0.55rem;
    padding: 0.62rem 0.7rem;
    border: 1px solid #e1e7ef;
    border-left: 4px solid #d97706;
    border-radius: 8px;
    background: #fffbeb;
    color: #172033;
    text-decoration: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.role-home-machine--fail {
    border-left-color: #dc2626;
    background: #fff7f7;
}

.role-home-machine:hover {
    color: #172033;
    border-color: #7dd3fc;
    box-shadow: 0 7px 18px rgba(30, 39, 65, 0.09);
    transform: translateY(-1px);
}

.role-home-machine strong {
    min-width: 0;
    font-size: 0.86rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.role-home-machine > small {
    grid-column: 1;
    color: #64748b;
    font-size: 0.7rem;
    overflow-wrap: anywhere;
}

.role-home-machine-status {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #a16207;
    font-size: 0.68rem;
    font-weight: 900;
}

.role-home-machine--fail .role-home-machine-status {
    color: #b91c1c;
}

.role-home-kpi-chips {
    grid-column: 1 / -1;
    margin-top: 0.15rem;
}

.role-home-machine--fail .role-home-kpi-chips span {
    background: #fee2e2;
    color: #991b1b;
}

.role-home-state {
    min-height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.role-home-state--empty {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.role-home-state--error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #991b1b;
}

.role-home-quick-section {
    display: grid;
    gap: 0.7rem;
}

.role-home-section-title {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
}

.role-home-section-title h2 {
    font-size: 0.98rem;
    font-weight: 800;
}

.role-home-section-title span {
    color: #778396;
    font-size: 0.75rem;
}

.role-home-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.role-home-quick-action {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    min-height: 48px;
    padding: 0.5rem 0.65rem;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
    color: #253047;
    text-align: left;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.role-home-quick-action:hover {
    border-color: #7dd3fc;
    background: #f0f9ff;
}

.role-home-quick-action > i {
    color: #0284c7;
    font-size: 1rem;
}

.role-home-quick-action > span {
    min-width: 0;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.role-home-quick-action > small {
    color: #8491a3;
    font-size: 0.68rem;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .role-home-metrics,
    .role-home-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .role-home-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .role-home-context {
        flex-direction: column;
    }

    .role-home-context-actions {
        justify-content: flex-start;
    }

    .role-home-task {
        grid-template-columns: 1fr;
    }

    .role-home-task > .btn {
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .role-home-metrics,
    .role-home-quick-grid {
        grid-template-columns: 1fr;
    }

    .role-home-context-actions {
        display: grid;
        width: 100%;
        justify-content: stretch;
    }

    .role-home-context-actions .btn {
        justify-content: center;
    }

    .role-home-panel-header {
        align-items: flex-start;
    }

    .role-home-section-title {
        display: grid;
        gap: 0.2rem;
    }
}

.production-plan-content {
    display: grid;
    gap: 1rem;
}

.production-plan-edit-badge {
    font-size: 0.9rem;
    padding: 0.45rem 0.65rem;
}

.production-plan-form {
    border: 1px solid #d8dee9;
    border-radius: 8px;
    background: #f8fafc;
    padding: 1rem;
}

.production-plan-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.production-plan-list {
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
}

.production-plan-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    padding: 0.9rem;
    margin-bottom: 0.75rem;
    background: #f8fafc;
}

.production-plan-table {
    min-width: 920px;
}

.production-plan-table th {
    white-space: nowrap;
}

.production-plan-row-actions {
    display: flex;
    gap: 0.4rem;
}

.kpi-target-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
}

.kpi-target-edit-badge {
    white-space: normal;
    text-align: left;
}

.kpi-target-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    padding: 0.9rem;
    margin-bottom: 0.75rem;
    background: #f8fafc;
}

.kpi-target-table {
    min-width: 1060px;
}

.kpi-target-table th {
    white-space: nowrap;
}

.kpi-target-row-actions {
    display: flex;
    gap: 0.4rem;
}

#productionPlanContent,
#productionPlanContent .card-body,
#productionPlanContent .production-plan-content,
#productionPlanContent .production-plan-form,
#productionPlanContent .production-plan-list,
#kpiTargetContent,
#kpiTargetContent .card-body,
#kpiTargetContent .kpi-target-content,
#kpiTargetContent .kpi-target-form,
#kpiTargetContent .kpi-target-list {
    max-width: 100%;
    min-width: 0;
}

.maintenance-report-runtime-summary {
    min-width: 280px;
    font-size: 0.9rem;
    font-weight: 600;
}

.maintenance-report-runtime-summary.maintenance-report-runtime-summary--missing {
    color: #dc2626 !important;
}

.technician-chart-scroll {
    width: 100%;
}

.technician-chart-scroll canvas {
    display: block;
}

@media (max-width: 767.98px) {
    #productionPlanContent {
        overflow-x: hidden;
    }

    #kpiTargetContent {
        overflow-x: hidden;
    }

    #productionPlanContent .card-body.production-plan-content {
        padding: 0.75rem;
    }

    #kpiTargetContent .card-body.kpi-target-content {
        padding: 0.75rem;
    }

    #productionPlanContent .production-plan-form {
        padding: 0.75rem;
    }

    #kpiTargetContent .kpi-target-form {
        padding: 0.75rem;
    }

    #productionPlanContent .production-plan-form .row {
        --bs-gutter-x: 0.75rem;
    }

    #kpiTargetContent .kpi-target-form .row {
        --bs-gutter-x: 0.75rem;
    }

    #productionPlanContent .production-plan-quick-actions,
    #productionPlanContent .col-12.d-flex.flex-wrap.gap-2,
    #kpiTargetContent .col-12.d-flex.flex-wrap.gap-2 {
        align-items: stretch;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    #productionPlanContent .production-plan-quick-actions .btn,
    #productionPlanContent #ppSaveButton,
    #productionPlanContent #ppResetButton,
    #productionPlanContent #ppRefreshButton,
    #kpiTargetContent #ktSaveButton,
    #kpiTargetContent #ktResetButton,
    #kpiTargetContent #ktRefreshButton {
        justify-content: center;
        width: 100%;
    }

    #productionPlanContent .production-plan-list > .d-flex,
    #kpiTargetContent .kpi-target-list > .d-flex {
        align-items: stretch !important;
    }

    #productionPlanContent .production-plan-list > .d-flex h3,
    #kpiTargetContent .kpi-target-list > .d-flex h3 {
        width: 100%;
    }

    #productionPlanContent .mobile-table-scroll,
    #kpiTargetContent .mobile-table-scroll {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    #productionPlanContent .production-plan-table {
        min-width: 760px;
    }

    #kpiTargetContent .kpi-target-table {
        min-width: 900px;
    }

    #technicianPerformanceContent .charts-container {
        display: block;
    }

    #technicianPerformanceContent .chart {
        min-width: 0;
        margin: 1.5rem 0 0;
    }

    #technicianPerformanceContent .chart h3 {
        margin-bottom: 0.75rem;
        font-size: 1rem;
    }

    #technicianPerformanceContent .technician-chart-scroll {
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.25rem 0 0.75rem;
        -webkit-overflow-scrolling: touch;
    }

    #technicianPerformanceContent .technician-chart-scroll canvas {
        max-width: none;
    }
}

/* Andon */
.andon-image-container {
    position: relative;
    width: 6cm;
    height: 6cm;
    border: 1px solid grey;
    background-color: #1e2741;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.andon-wo-summary {
    position: absolute;
    width: 1.4cm;
    height: 1.4cm;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 30px;
    border: 1.5px solid grey;
    cursor: pointer;
}

#openWONoStartedTime { background-color: red; color: black; top: 0; left: 0; }
#openWOWithStartedTime { background-color: gold; color: black; top: 0; right: 0; }

/* Forms */
.inline-fields {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.inline-input {
    display: flex;
    align-items: center;
}

/* Asset Detail Panel Styles */
.device-details .detail-row.horizontal {
  display: flex;
  flex-wrap: nowrap; /* Prevent wrapping to new line */
  overflow-x: auto;  /* Allow horizontal scrolling if needed */
  gap: 12px;
  padding-bottom: 10px; /* Add some space for scrollbar */
}

.detail-item {
  flex: 0 0 auto; /* Prevent items from shrinking */
  min-width: 150px;
  display:flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #f0f0f0;
  background: #fafafa;
}

.detail-item .label {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.detail-item .value {
  font-weight: 600;
}

.tree-node.machine {
  color: #1f6f5b;
  font-weight: 600;
}

.tree-node.selected {
  background: #eef6ff;
  border-radius: 6px;
  padding: 3px 8px;
}

.asset-machine-details {
  display: grid;
  gap: 1rem;
}

.asset-machine-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.asset-machine-header h3 {
  margin-bottom: 0.25rem;
}

.asset-machine-name {
  color: #d81c1c;
  font-size: 14px;
  font-weight: 500;
}

.asset-machine-path {
  color: #5f6b7a;
  font-size: 0.85rem;
  word-break: break-word;
}

.asset-machine-loading {
  align-items: center;
  gap: 0.5rem;
  color: #0d6efd;
  font-size: 0.9rem;
  font-weight: 600;
}

.asset-lifetime-row {
  flex-wrap: wrap !important;
}

.asset-pending-value {
  color: #d81c1c;
  font-style: italic;
}

.asset-machine-chart-panel,
.asset-machine-section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 1rem;
}

.asset-machine-section-title {
  color: #1e2741;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.asset-machine-note {
  color: #6c757d;
  font-size: 0.86rem;
  margin-bottom: 0.75rem;
}

.asset-machine-chart-wrap {
  position: relative;
  height: 340px;
}

.asset-machine-filter {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.asset-machine-filter-group {
  min-width: 180px;
}

.asset-machine-filter .btn {
  min-height: 31px;
}

.asset-machine-data-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.asset-machine-table-wrap {
  max-height: 360px;
  overflow: auto;
}

.asset-machine-section .table {
  margin-bottom: 0;
  min-width: 980px;
}

.asset-machine-section th {
  white-space: nowrap;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.asset-machine-pie-wrap {
  position: relative;
  height: 320px;
}

.asset-machine-empty {
  padding: 2rem 1rem;
  color: #6c757d;
  text-align: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.asset-bom-filter {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) minmax(220px, 1.4fr);
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.asset-bom-filter > div {
  min-width: 0;
}

.pm-bom-filter {
  grid-template-columns: repeat(5, minmax(120px, 1fr)) minmax(220px, 1.4fr) minmax(160px, 0.8fr) auto;
}

.pm-bom-filter-action {
  display: flex;
  align-items: end;
}

.pm-bom-filter-action .btn {
  white-space: nowrap;
}

.asset-bom-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: 1rem;
  align-items: start;
  max-width: 100%;
}

.asset-bom-panel {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 1rem;
  min-width: 0;
  max-width: 100%;
}

.asset-bom-table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: 420px;
  overflow: auto;
}

#equipmentBomTable,
#pmBomTable {
  min-width: 760px;
}

#equipmentBomTable th,
#pmBomTable th {
  white-space: nowrap;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.asset-bom-form {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.asset-bom-form > div,
.asset-bom-form-row > div {
  min-width: 0;
}

.asset-bom-form-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr);
  gap: 0.75rem;
}

.asset-bom-form input[readonly] {
  background-color: #f8fafc;
  color: #334155;
  cursor: not-allowed;
}

@media (max-width: 767.98px) {
  .asset-machine-chart-wrap,
  .asset-machine-pie-wrap {
    height: 280px;
  }

  .asset-machine-filter-group {
    min-width: 100%;
  }

  .asset-bom-filter,
  .asset-bom-panel {
    padding: 0.75rem;
  }

  #equipmentBomTable,
  #pmBomTable {
    min-width: 640px;
  }
}

@media (max-width: 1199.98px) {
  .asset-bom-filter,
  .pm-bom-filter,
  .asset-bom-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .pm-bom-filter-action .btn {
    width: 100%;
  }
}

/* 2.2 - Highlight for selected row in work order table */
#workOrderTable tbody tr.active {
    background-color: #cce5ff !important; /* Bootstrap's info color, use !important to ensure override */
    font-weight: bold;
}

/* 2.2 - PM Checklist Fullscreen Overlay */
#pmChecklistOverlay {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(47, 45, 45, 0.85);
  justify-content: center;
  align-items: center;
}
#pmChecklistOverlay img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  box-shadow: 0 0 20px #fff;
}
#pmChecklistOverlay .close-button {
  position: absolute;
  top: 20px;
  right: 35px;
  font-size: 40px;
  color: white;
  cursor: pointer;
  font-weight: bold;
}

/* ============================================================
   3.4 Spare Part Consumption Styles
   ============================================================ */

/* Định dạng text hiển thị máy được chọn */
#machinePathText_sc {
    font-weight: bold;
    font-style: italic;
    text-decoration: underline;
    color: blue;
}

/* Compact table styles */
#withCodeTable th, 
#withCodeTable td,
#noCodeTable th,
#noCodeTable td,
#cc_withCodeTable th, 
#cc_withCodeTable td,
#cc_noCodeTable th,
#cc_noCodeTable td {
    padding: 0 !important;
    vertical-align: middle;
    font-size: 0.85rem;
    height: 32px;
}

/* Input trong bảng: Trong suốt, không viền (nhìn như text) */
#withCodeTable input, 
#withCodeTable select,
#noCodeTable input, 
#noCodeTable select,
#cc_withCodeTable input, 
#cc_withCodeTable select,
#cc_noCodeTable input, 
#cc_noCodeTable select {
    padding: 4px 8px !important;
    font-size: 0.85rem !important;
    height: 100% !important;
    width: 100% !important;
    border: none !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Khi focus thì hiện nền trắng và viền xanh */
#withCodeTable input:focus, 
#withCodeTable select:focus,
#noCodeTable input:focus, 
#noCodeTable select:focus,
#cc_withCodeTable input:focus, 
#cc_withCodeTable select:focus,
#cc_noCodeTable input:focus, 
#cc_noCodeTable select:focus {
    background-color: #fff !important;
    box-shadow: inset 0 0 0 2px #0d6efd !important;
    outline: none !important;
}

/* Column Widths */
#withCodeTable, #noCodeTable, #cc_withCodeTable, #cc_noCodeTable {
    table-layout: fixed;
}

/* Table 4: With Code */
#withCodeTable th:nth-child(1), #cc_withCodeTable th:nth-child(1) { width: 50px; text-align: center; } /* STT */
#withCodeTable th:nth-child(2), #cc_withCodeTable th:nth-child(2) { width: 150px; } /* ItemCode */
#withCodeTable th:nth-child(3), #cc_withCodeTable th:nth-child(3) { width: auto; }  /* ItemDescription */
#withCodeTable th:nth-child(4), #cc_withCodeTable th:nth-child(4) { width: 120px; } /* Purpose */
#withCodeTable th:nth-child(5), #cc_withCodeTable th:nth-child(5) { width: 100px; }  /* Qty */
#withCodeTable th:nth-child(6), #cc_withCodeTable th:nth-child(6) { width: 140px; }  /* UoM */

/* Table 5: No Code */
#noCodeTable th:nth-child(1), #cc_noCodeTable th:nth-child(1) { width: 50px; text-align: center; } /* STT */
#noCodeTable th:nth-child(2), #cc_noCodeTable th:nth-child(2) { width: auto; }  /* ItemDescription */
#noCodeTable th:nth-child(3), #cc_noCodeTable th:nth-child(3) { width: 120px; } /* Purpose */
#noCodeTable th:nth-child(4), #cc_noCodeTable th:nth-child(4) { width: 100px; }  /* Qty */
#noCodeTable th:nth-child(5), #cc_noCodeTable th:nth-child(5) { width: 90px; }  /* UoM */
#noCodeTable th:nth-child(8), #cc_noCodeTable th:nth-child(8) { width: 60px; text-align: center; } /* Delete */

#withCodeTable td.sttCell, #noCodeTable td.sttCell, #cc_withCodeTable td.sttCell, #cc_noCodeTable td.sttCell {
    text-align: center;
}

/* Tô nền xanh dương nhạt cho ô readonly */
#withCodeTable .table-readonly,
#noCodeTable  .table-readonly,
#cc_withCodeTable .table-readonly,
#cc_noCodeTable .table-readonly {
  background-color: #d0e7ff !important;
}
/* ============================================================
   5.2 Cost By Machine Styles
   ============================================================ */
#cbm-selected-machine {
    font-weight: bold;
    font-style: italic;
    text-decoration: underline;
    color: blue;
}

#cbmMonthlyChart,
#cbmParetoChart {
    max-height: calc(100% - 2.5rem);
}

/* ============================================================
   Professional App Loader Styles
   ============================================================ */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff; /* Nền trắng sạch sẽ */
    z-index: 9999; /* Luôn nằm trên cùng */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease-out, visibility 0.6s; /* Hiệu ứng mờ dần khi tắt */
}

.loader-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.loader-logo {
    width: 90px;
    height: 90px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    overflow: hidden;
    padding: 0;
    box-shadow: none;
}

.loader-logo-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.loader-title {
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

.loader-progress {
    width: 220px;
    height: 6px;
    background-color: #f1f3f5;
    border-radius: 3px;
    margin: 0 auto 12px;
    overflow: hidden;
    position: relative;
}

.loader-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 30%;
    background-color: #0d6efd;
    border-radius: 3px;
    animation: loaderAnimation 1.5s infinite ease-in-out; /* Hiệu ứng chạy qua lại */
}

.loader-text {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

@keyframes loaderAnimation {
    0% { left: -30%; width: 30%; }
    50% { left: 25%; width: 60%; }
    100% { left: 100%; width: 30%; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* ============================================================
   Dashboard Welcome Screen Styles
   ============================================================ */
.dashboard-home-shell {
    min-height: calc(100vh - var(--header-height) - 3rem);
}

.home-dashboard {
    display: grid;
    gap: 1.5rem;
}

.workhub-shell {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(30, 39, 65, 0.08);
}

.workhub-page-body {
    background: #f4f7fb;
}

.workhub-main-content {
    min-height: 100vh;
}

.workhub-main-content .workhub-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.workhub-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.workhub-title-block {
    display: grid;
    gap: 0.35rem;
}

.workhub-kicker {
    width: fit-content;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: #e6f6fb;
    color: #075985;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.workhub-title-block h2 {
    margin: 0;
    color: #172033;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0;
}

.workhub-user-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    color: #536174;
    font-size: 0.86rem;
}

.workhub-user-line span,
.workhub-task-foot span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.workhub-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.workhub-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 0.65rem;
}

.workhub-summary-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 58px;
    padding: 0.7rem 0.8rem;
    border: 1px solid #e3e9f1;
    border-radius: 8px;
    background: #f8fafc;
}

.workhub-summary-item i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #eaf3ff;
    color: #1d4ed8;
    font-size: 1rem;
}

.workhub-summary-item span {
    display: block;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.workhub-summary-item strong {
    display: block;
    color: #111827;
    font-size: 1.3rem;
    line-height: 1;
}

.workhub-summary-item--urgent i,
.workhub-summary-item--now i {
    background: #fff4d6;
    color: #b45309;
}

.workhub-summary-item--overdue i {
    background: #fee2e2;
    color: #b91c1c;
}

.workhub-summary-item.is-loading {
    min-height: 58px;
    background: linear-gradient(90deg, #f1f5f9, #ffffff, #f1f5f9);
    background-size: 200% 100%;
    animation: workhubPulse 1.2s ease-in-out infinite;
}

.workhub-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.workhub-filter {
    min-height: 34px;
    padding: 0.35rem 0.75rem;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    background: #ffffff;
    color: #344054;
    font-size: 0.86rem;
    font-weight: 700;
}

.workhub-filter.is-active {
    border-color: #0ea5e9;
    background: #e6f6fb;
    color: #075985;
}

.workhub-task-list {
    display: grid;
    gap: 0.65rem;
    max-height: min(54vh, 560px);
    overflow: auto;
    padding-right: 0.25rem;
}

.workhub-task-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.85rem;
    border: 1px solid #e0e7ef;
    border-left: 5px solid #64748b;
    border-radius: 8px;
    background: #ffffff;
}

.workhub-task-card--urgent {
    border-left-color: #f59e0b;
}

.workhub-task-card--overdue {
    border-left-color: #dc2626;
}

.workhub-task-main {
    display: grid;
    min-width: 0;
    gap: 0.35rem;
}

.workhub-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.workhub-task-meta span {
    padding: 0.16rem 0.45rem;
    border-radius: 6px;
    background: #eef2f7;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
}

.workhub-task-card--urgent .workhub-task-meta span:last-child {
    background: #fff4d6;
    color: #92400e;
}

.workhub-task-card--overdue .workhub-task-meta span:last-child {
    background: #fee2e2;
    color: #991b1b;
}

.workhub-task-card h3 {
    margin: 0;
    color: #172033;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.workhub-task-card p {
    margin: 0;
    color: #526071;
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.workhub-task-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    color: #667085;
    font-size: 0.78rem;
}

.workhub-task-action {
    display: flex;
    justify-content: flex-end;
}

.workhub-task-action .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.workhub-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 86px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
}

.workhub-state--empty {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.workhub-state--error {
    color: #991b1b;
    background: #fff1f2;
    border-color: #fecdd3;
}

@keyframes workhubPulse {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.welcome-header {
    position: relative;
    overflow: hidden;
    padding: 1rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background:#f0f8ff; /* Màu nền xanh nhạt */
    box-shadow: 0 14px 35px rgba(30, 39, 65, 0.08);
}

.welcome-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
   background: #18aae3; /* Đường viền trên màu xanh nhạt */
}

.welcome-header h1 {
    position: relative;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #1e2741;
    letter-spacing: 0;
}

.welcome-header p {
    position: relative;
    margin-bottom: 0;
    font-size: 1.1rem;
    color: #475569;
}

.home-shortcut-board {
    display: grid;
    gap: 1rem;
}

.home-shortcut-section {
    display: grid;
    gap: 0.5rem;
}

.home-shortcut-section[style*="display: none"] {
    margin: 0;
}

.home-shortcut-heading {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #1e2741;
}

.home-shortcut-heading i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(135, 206, 235, 0.2); /* Nền icon xanh nhạt */
    color: #074e88; /* Màu icon xanh nhạt */
    font-size: 1.05rem;
}

.home-shortcut-heading h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.quick-access-grid--single {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-access-card {
    --shortcut-accent: #18aae3; /* Màu xanh nhạt chính cho các thẻ */
    --shortcut-accent-soft: rgba(135, 206, 235, 0.2); /* Màu xanh nhạt mềm cho các thẻ */
    position: relative;
    display: flex;
    min-height: 56px;
    height: 100%;
    align-items: center;
    gap: 0.85rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-left: 5px solid var(--shortcut-accent);
    border-radius: 8px;
    background-color: #ffffff;
    text-decoration: none;
    color: #1f2937;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    text-align: left;
    box-shadow: 0 10px 24px rgba(30, 39, 65, 0.07);
}

.quick-access-card[style*="display: none"] {
    display: none !important;
}

.quick-access-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(30, 39, 65, 0.12);
    border-color: var(--shortcut-accent);
    color: #1f2937;
}

.quick-access-card i {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--shortcut-accent-soft);
    color: var(--shortcut-accent);
    font-size: 1.2rem;
}

.quick-access-card span {
    display: block;
    flex: 1;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.quick-access-card small {
    flex: 0 0 auto;
    align-self: flex-end;
    margin-left: auto;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .workhub-task-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .workhub-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .workhub-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workhub-filter-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workhub-task-list {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .workhub-task-action {
        justify-content: stretch;
    }

    .workhub-task-action .btn,
    .workhub-refresh-btn {
        width: 100%;
        justify-content: center;
    }

    .welcome-header {
        padding: 1.5rem;
    }

    .quick-access-grid,
    .quick-access-grid--single {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-access-card {
        min-height: 72px;
    }
}

@media (max-width: 575.98px) {
    .quick-access-grid,
    .quick-access-grid--single {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .workhub-shell {
        padding: 0.85rem;
        gap: 0.75rem;
    }

    .workhub-title-block h2 {
        font-size: 1.18rem;
        line-height: 1.2;
    }

    .workhub-user-line,
    .workhub-task-foot {
        display: grid;
        gap: 0.35rem;
    }

    .workhub-summary-strip,
    .workhub-filter-row {
        grid-template-columns: 1fr;
    }

    .workhub-task-card {
        padding: 0.75rem;
    }

    .workhub-task-meta {
        gap: 0.3rem;
    }

    .workhub-state {
        min-height: 76px;
        padding: 0.75rem;
        text-align: center;
    }
}
/* Checklist Governance Skeleton */
.checklist-governance-shell {
    background: linear-gradient(180deg, rgba(13, 110, 253, 0.03), rgba(255, 255, 255, 0));
}

.checklist-page-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.checklist-role-pill,
.checklist-mode-pill,
.checklist-hero-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.checklist-role-pill {
    background: #e9f2ff;
    color: #1447a6;
    border: 1px solid #cfe0ff;
}

.checklist-mode-pill {
    background: #f3f5f9;
    color: #44506a;
    border: 1px solid #dde3ee;
}

.checklist-governance-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.1rem;
    border: 1px solid #dbe7ff;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.06), rgba(255, 255, 255, 0.95));
}

.checklist-banner-meta {
    display: grid;
    gap: 0.45rem;
    max-width: 460px;
    font-size: 0.88rem;
    color: #5c6b82;
}

.checklist-step-strip {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.checklist-step-strip span {
    border-radius: 999px;
    border: 1px solid #d6dfef;
    background: #fff;
    color: #5c6b82;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.checklist-step-strip span.active {
    background: #e9f2ff;
    border-color: #bdd4ff;
    color: #1447a6;
}

.checklist-kpi-card {
    height: 100%;
    background: #fff;
    border: 1px solid #dbe7ff;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 6px 18px rgba(30, 39, 65, 0.05);
}

.checklist-kpi-card span {
    font-size: 0.82rem;
    color: #5c6b82;
}

.checklist-kpi-card strong {
    font-size: 1.35rem;
    color: #1e2741;
}

.checklist-summary-panel {
    display: grid;
    gap: 0.75rem;
}

.checklist-summary-panel > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.92rem;
}

.checklist-summary-panel span {
    color: #5c6b82;
}

.checklist-summary-panel strong {
    color: #1e2741;
}

.checklist-guidance-list {
    display: grid;
    gap: 0.85rem;
}

.checklist-guidance-item {
    display: grid;
    gap: 0.2rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid #e6edf8;
    border-radius: 12px;
    background: #f9fbff;
}

.checklist-guidance-item strong {
    color: #1e2741;
}

.checklist-guidance-item span,
.checklist-side-note span {
    color: #5c6b82;
    font-size: 0.9rem;
}

.checklist-side-note {
    display: grid;
    gap: 0.25rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid #e6edf8;
    border-radius: 12px;
    background: #fff;
}

.checklist-side-note strong,
.checklist-asset-stat strong,
.checklist-compare-card strong {
    color: #1e2741;
}

.checklist-governance-table th {
    white-space: nowrap;
}

.checklist-code-preview {
    font-weight: 700;
    letter-spacing: 0.03em;
}

.checklist-asset-stat {
    height: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid #e6edf8;
    border-radius: 12px;
    background: #f9fbff;
    display: grid;
    gap: 0.25rem;
}

.checklist-asset-stat span,
.checklist-compare-label {
    color: #5c6b82;
    font-size: 0.82rem;
}

.checklist-compare-card {
    height: 100%;
    padding: 1rem;
    border: 1px solid #e6edf8;
    border-radius: 14px;
    background: #fff;
    display: grid;
    gap: 0.3rem;
}

.checklist-compare-card-accent {
    background: linear-gradient(180deg, rgba(13, 110, 253, 0.08), rgba(255, 255, 255, 1));
    border-color: #bdd4ff;
}

.checklist-sticky-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #dbe7ff;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 -6px 18px rgba(30, 39, 65, 0.05);
}

#assetChecklistSummaryCard {
    border-radius: 14px;
}

#assetChecklistSummaryCard .table {
    margin-bottom: 0;
}

#checklistSafetyItemsContainer {
    display: grid;
    gap: 0.55rem;
}

#checklistSafetyModal .checklist-safety-check-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 58px;
    padding: 0.9rem 1rem;
    background: #fff;
}

#checklistSafetyModal .checklist-safety-check-row .form-check-input {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    border-color: #9ca3af;
    cursor: pointer;
}

#checklistSafetyModal .checklist-safety-check-row .form-check-input:checked {
    background-color: #198754;
    border-color: #198754;
}

#checklistSafetyModal .checklist-safety-check-row .form-check-input:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.18);
}

#checklistSafetyModal .checklist-safety-check-row .form-check-label {
    margin: 0;
    line-height: 1.35;
    cursor: pointer;
}

.closed-checklist-evidence-section {
    border-top: 1px solid #d9e2ec;
    padding-top: 1rem;
}

.closed-checklist-evidence-title {
    font-size: 1rem;
    font-weight: 700;
}

.closed-checklist-evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 0.75rem;
}

.closed-checklist-evidence-thumb {
    position: relative;
    display: grid;
    grid-template-rows: 92px auto;
    gap: 0.35rem;
    width: 100%;
    min-height: 128px;
    padding: 0.45rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    text-align: left;
    cursor: zoom-in;
}

.closed-checklist-evidence-thumb:hover,
.closed-checklist-evidence-thumb:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.14);
    outline: none;
}

.closed-checklist-evidence-thumb img {
    width: 100%;
    height: 92px;
    object-fit: cover;
    border-radius: 6px;
    background: #eef2f7;
}

.closed-checklist-evidence-thumb-loader {
    position: absolute;
    inset: 0.45rem 0.45rem auto;
    display: grid;
    place-items: center;
    height: 92px;
    border-radius: 6px;
    background: #eef2f7;
    color: #64748b;
    font-size: 0.78rem;
}

.closed-checklist-evidence-thumb.is-error {
    cursor: not-allowed;
}

.closed-checklist-evidence-thumb-caption {
    min-height: 1.9rem;
    overflow: hidden;
    color: #475569;
    font-size: 0.78rem;
    line-height: 1.2;
}

.checklist-evidence-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.78);
}

.checklist-evidence-preview-modal.is-open {
    display: flex;
}

.checklist-evidence-preview-dialog {
    position: relative;
    max-width: min(1100px, 96vw);
    max-height: 92vh;
}

.checklist-evidence-preview-image {
    display: block;
    max-width: min(1100px, 96vw);
    max-height: 84vh;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.checklist-evidence-preview-caption {
    margin-top: 0.6rem;
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
}

.checklist-evidence-preview-close {
    position: absolute;
    top: -0.9rem;
    right: -0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #111827;
    font-size: 1.7rem;
    line-height: 1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

@media (max-width: 991px) {
    .checklist-governance-banner {
        flex-direction: column;
    }

    .checklist-sticky-footer {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================
   6.2 PM Planning Distribution
   ============================================================ */
.low-performance-content {
    background: #ffffff;
}

.low-performance-weight-box {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.low-performance-weight-box span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    background: #f8fafc;
    color: #1f2937;
    font-weight: 700;
    font-size: 0.88rem;
}

.low-performance-toolbar {
    border: 1px solid #dbe5f1;
    border-radius: 8px;
    background: #f8fafc;
    padding: 1rem;
}

.low-performance-criteria {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid #d8e3f0;
    border-radius: 8px;
    background: #f7fbff;
    color: #334155;
    padding: 0.85rem 1rem;
    font-size: 0.94rem;
}

.low-performance-criteria i {
    color: #0f6fb2;
    font-size: 1.15rem;
    line-height: 1.35;
}

.low-performance-summary-text {
    margin-top: 0.25rem;
    color: #64748b;
    font-size: 0.88rem;
}

.low-performance-formula-list {
    margin: 0.45rem 0 0;
    padding-left: 1.1rem;
    color: #334155;
}

.low-performance-formula-list li + li {
    margin-top: 0.2rem;
}

.low-performance-empty {
    border: 1px dashed #b7c4d6;
    border-radius: 8px;
    background: #fbfdff;
    color: #64748b;
    padding: 2rem 1rem;
    text-align: center;
}

.low-performance-layout {
    display: grid;
    grid-template-columns: minmax(420px, 1.25fr) minmax(340px, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.low-performance-chart-panel,
.low-performance-action-panel {
    border: 1px solid #dbe5f1;
    border-radius: 8px;
    background: #ffffff;
    padding: 1rem;
}

.low-performance-panel-title {
    color: #1e2741;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.low-performance-chart-wrap {
    position: relative;
    min-height: 320px;
}

.low-performance-action-list {
    display: grid;
    gap: 0.75rem;
}

.low-performance-action-card {
    border: 1px solid #d8e3f0;
    border-left: 5px solid #64748b;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.85rem;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
}

.low-performance-action-card.focus-downtime {
    border-left-color: #dc2626;
}

.low-performance-action-card.focus-cost {
    border-left-color: #d97706;
}

.low-performance-action-card.focus-balanced {
    border-left-color: #0f766e;
}

.low-performance-action-header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}

.low-performance-rank {
    color: #4361ee;
    font-weight: 800;
    font-size: 0.82rem;
    margin-bottom: 0.15rem;
}

.low-performance-action-card h4 {
    margin: 0;
    color: #172033;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
}

.low-performance-path {
    color: #64748b;
    font-size: 0.84rem;
    margin-top: 0.2rem;
    word-break: break-word;
}

.low-performance-score {
    flex: 0 0 auto;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 0.25rem 0.5rem;
    font-size: 0.82rem;
    font-weight: 800;
}

.low-performance-action-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.low-performance-action-metric {
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.45rem 0.55rem;
    min-width: 0;
}

.low-performance-action-metric span,
.low-performance-action-hint {
    color: #64748b;
    font-size: 0.78rem;
}

.low-performance-action-metric strong {
    display: block;
    color: #111827;
    font-size: 0.9rem;
    line-height: 1.25;
    margin-top: 0.1rem;
    word-break: break-word;
}

.low-performance-action-hint {
    margin-top: 0.7rem;
    border-top: 1px solid #edf2f7;
    padding-top: 0.6rem;
}

.low-performance-steps {
    margin: 0.65rem 0 0;
    padding-left: 1.2rem;
    color: #334155;
    font-size: 0.88rem;
}

.low-performance-steps li + li {
    margin-top: 0.35rem;
}

@media (max-width: 1199.98px) {
    .low-performance-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .low-performance-action-metrics {
        grid-template-columns: 1fr;
    }

    .low-performance-action-header {
        flex-direction: column;
    }
}

.pm-planning-toolbar {
    padding: 1rem;
    border: 1px solid #dbe5f1;
    border-radius: 0.9rem;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f6fb 100%);
}

.pm-planning-metric-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pm-planning-metric-btn {
    border: 1px solid #89b7d9;
    background-color: #eef6fb;
    color: #0f4c75;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.65rem 1rem;
}

.pm-planning-metric-btn.active,
.pm-planning-metric-btn:hover {
    background-color: #0f4c75;
    border-color: #0f4c75;
    color: #ffffff;
}

.pm-planning-panel {
    border: 1px solid #dbe5f1;
    border-radius: 1rem;
    padding: 1rem;
    background: #ffffff;
}

.pm-planning-summary-card {
    height: 100%;
    border: 1px solid #dbe5f1;
    border-radius: 1rem;
    background: #ffffff;
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(15, 76, 117, 0.06);
}

.pm-planning-summary-card.active {
    border-color: #0f4c75;
    box-shadow: 0 12px 24px rgba(15, 76, 117, 0.12);
}

.pm-planning-summary-title {
    color: #5f6b7a;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.45rem;
}

.pm-planning-summary-value {
    color: #12344d;
    font-size: 1.55rem;
    font-weight: 700;
}

.pm-planning-table {
    table-layout: fixed;
    min-width: 980px;
}

.pm-planning-table th,
.pm-planning-table td {
    text-align: center;
    vertical-align: middle;
}

.pm-planning-period-col {
    width: 120px;
    min-width: 120px;
    text-align: left !important;
    background-color: #f8fafc;
}

.pm-planning-month-trigger {
    width: 100%;
    border: none;
    background: transparent;
    color: #0f4c75;
    font-weight: 700;
    padding: 0.25rem;
}

.pm-planning-month-trigger.active {
    color: #ffffff;
    background-color: #0f4c75;
    border-radius: 0.6rem;
}

.pm-planning-value-cell {
    padding: 0.25rem !important;
}

.pm-planning-cell-btn {
    width: 100%;
    min-height: 54px;
    border: 1px solid #d8e6f0;
    border-radius: 0.75rem;
    font-weight: 700;
    color: #12344d;
    background-color: #f9fcfe;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pm-planning-cell-btn:hover:not(.is-disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 76, 117, 0.12);
}

.pm-planning-cell-btn.is-disabled {
    cursor: default;
    color: #9aa7b2;
    background-color: #f3f6f9;
}

.pm-planning-calendar-table {
    table-layout: fixed;
    width: 100%;
}

.pm-planning-calendar-table th,
.pm-planning-calendar-table td {
    text-align: left;
    vertical-align: top;
}

.pm-planning-calendar-cell {
    padding: 0.3rem !important;
    height: 116px;
}

.pm-planning-calendar-cell.outside-month {
    background-color: #f6f8fb;
}

.pm-planning-calendar-cell.is-today {
    box-shadow: inset 0 0 0 2px #0f4c75;
}

.pm-planning-day-btn {
    width: 100%;
    height: 100%;
    border: 1px solid #d8e6f0;
    border-radius: 0.9rem;
    background-color: #f9fcfe;
    color: #12344d;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
    padding: 0.55rem;
}

.pm-planning-day-btn.is-disabled {
    border-style: dashed;
    color: #9aa7b2;
    background-color: #f3f6f9;
}

.pm-planning-day-number {
    font-size: 0.88rem;
    font-weight: 700;
}

.pm-planning-day-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
}

.pm-planning-detail-table-wrap {
    max-height: 55vh;
}

.pm-heat-0 {
    background-color: #f9fcfe;
}

.pm-heat-1 {
    background-color: #e7f3fb;
}

.pm-heat-2 {
    background-color: #cfe8f8;
}

.pm-heat-3 {
    background-color: #a8d4ef;
}

.pm-heat-4 {
    background-color: #78bbdf;
}

.pm-heat-5 {
    background-color: #3d95bf;
    color: #ffffff;
}

.pm-planning-cell-btn.is-week.pm-heat-0 {
    background-color: #f9fcfe;
}

.pm-planning-cell-btn.is-week.pm-heat-1 {
    background-color: #edf6fd;
}

.pm-planning-cell-btn.is-week.pm-heat-2 {
    background-color: #d9ecfb;
}

.pm-planning-cell-btn.is-week.pm-heat-3 {
    background-color: #b8daf4;
}

.pm-planning-cell-btn.is-week.pm-heat-4 {
    background-color: #89bee8;
}

.pm-planning-cell-btn.is-week.pm-heat-5 {
    background-color: #4a97d3;
    color: #ffffff;
}

.pm-planning-cell-btn.is-total.pm-heat-0 {
    background: linear-gradient(180deg, #f6faf8 0%, #eef7f3 100%);
}

.pm-planning-cell-btn.is-total.pm-heat-1 {
    background: linear-gradient(180deg, #edf7f3 0%, #e2f1ea 100%);
}

.pm-planning-cell-btn.is-total.pm-heat-2 {
    background: linear-gradient(180deg, #d7eee4 0%, #c8e5da 100%);
}

.pm-planning-cell-btn.is-total.pm-heat-3 {
    background: linear-gradient(180deg, #b7ddce 0%, #a4d2c1 100%);
}

.pm-planning-cell-btn.is-total.pm-heat-4 {
    background: linear-gradient(180deg, #7fc1ad 0%, #68b39d 100%);
    color: #103b32;
}

.pm-planning-cell-btn.is-total.pm-heat-5 {
    background: linear-gradient(180deg, #338a75 0%, #256c5d 100%);
    color: #ffffff;
    border-color: #2d7b68;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.pm-planning-cell-btn.is-disabled {
    color: #9aa7b2 !important;
    background-color: #f3f6f9 !important;
    border-color: #d8e2ea;
    box-shadow: none;
}

@media (max-width: 991px) {
    .pm-planning-day-value {
        font-size: 1.05rem;
    }

    .pm-planning-summary-value {
        font-size: 1.25rem;
    }
}

/* ============================================================
   Mobile Responsiveness Utilities
   ============================================================ */
.mobile-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-table-scroll > .table {
    margin-bottom: 0;
}

.skill-matrix-scroll {
    max-height: 70vh;
    overflow: auto;
}

.skill-matrix-table {
    min-width: 980px;
}

.standard-skill-editor {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.9rem;
}

.standard-skill-list-section {
    background: #ffffff;
}

.standard-skill-section-title {
    font-size: 1rem;
    font-weight: 700;
}

.standard-skill-editor .form-label {
    font-weight: 700;
}

.standard-skill-editor textarea {
    resize: vertical;
}

.standard-skill-editor-actions {
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
}

.skill-proposal-panel {
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    padding: 0.9rem;
}

.skill-proposal-action-group {
    display: inline-flex;
    gap: 0.45rem;
}

.skill-proposal-action-btn {
    align-items: center;
    display: inline-flex;
    font-size: 1.15rem;
    justify-content: center;
    min-height: 2.75rem;
    min-width: 3rem;
}

.skill-training-panel {
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    padding: 0.9rem;
}

.skill-training-form {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(180px, 1.1fr) minmax(220px, 1.3fr) minmax(140px, 0.7fr) minmax(180px, 1fr) minmax(150px, 0.75fr);
    align-items: end;
}

.skill-training-form .form-label {
    font-weight: 700;
}

.skill-training-form-action {
    align-self: end;
}

.skill-engine-principle {
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    border-left: 4px solid #0d6efd;
    border-radius: 8px;
    padding: 0.85rem 1rem;
}

.skill-engine-principle ul {
    display: grid;
    gap: 0.35rem;
    padding-left: 1.15rem;
}

.skill-engine-criteria-grid {
    display: grid;
    grid-template-columns: minmax(120px, 0.22fr) 1fr;
    gap: 0.55rem 0.85rem;
    align-items: start;
}

.skill-engine-criteria-step {
    font-weight: 700;
    color: #0f172a;
}

@media (max-width: 768px) {
    .skill-engine-criteria-grid {
        grid-template-columns: 1fr;
    }

    .skill-training-form {
        grid-template-columns: 1fr;
    }
}

.skill-proposal-evidence-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
}

.skill-proposal-detail-head {
    display: grid;
    gap: 0.15rem;
    margin-bottom: 0.65rem;
}

.skill-proposal-detail-reason {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    font-size: 0.86rem;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.75rem;
}

.skill-proposal-detail-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: grid;
    gap: 0.55rem;
    margin-top: 0.65rem;
    padding: 0.75rem;
}

.skill-proposal-detail-criterion {
    color: #0f172a;
    font-weight: 700;
}

.skill-proposal-evidence-list {
    display: grid;
    gap: 0.45rem;
}

.skill-proposal-evidence-item {
    align-items: center;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.wo-skill-mapping-filter {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.wo-skill-mapping-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.36fr);
    align-items: start;
}

.wo-skill-tag-panel {
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    padding: 0.9rem;
}

.wo-skill-tag-list {
    display: grid;
    gap: 0.5rem;
}

.wo-skill-tag-item {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.65rem;
}

.skill-matrix-table th,
.skill-matrix-table td {
    vertical-align: middle;
    white-space: nowrap;
}

.skill-matrix-table thead th {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 2;
}

.skill-matrix-table thead th.skill-name-header {
    max-width: 260px;
    min-width: 190px;
    vertical-align: top;
    white-space: normal;
}

.skill-name-header span,
.skill-name-header small {
    display: block;
    max-width: none;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.skill-name-header span {
    line-height: 1.25;
}

.skill-name-header small {
    color: #64748b;
    font-weight: 400;
    line-height: 1.2;
    margin-top: 0.2rem;
}

.sticky-skill-col {
    background: #fff;
    left: 0;
    position: sticky;
    z-index: 3;
}

.skill-level-ok {
    background: #dcfce7 !important;
    color: #166534;
    font-weight: 700;
}

.skill-level-gap-one {
    background: #fef9c3 !important;
    color: #854d0e;
    font-weight: 700;
}

.skill-level-gap-high {
    background: #fee2e2 !important;
    color: #991b1b;
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .wo-skill-mapping-filter,
    .wo-skill-mapping-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .content-section.card > .card-body {
        padding: 1rem;
    }

    .inline-fields {
        gap: 0.75rem;
    }

    .inline-fields > div {
        flex: 1 1 220px;
        min-width: 220px;
    }

    .inline-input {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .inline-input .form-label {
        margin-bottom: 0;
    }

    #workOrderTable,
    #reorderSparePartTable table,
    #withCodeTable,
    #noCodeTable,
    #roughTable,
    #cc_withCodeTable,
    #cc_noCodeTable,
    #skillMatrixUpdateTable,
    #sparePartTableDetails,
    #cbm-detail-table,
    #hvr-result-table,
    #popupOpenWOTable,
    #popupOpenStartedWOTable {
        min-width: 720px;
    }

    .cbm-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #spare-consumptionContent .d-flex.flex-wrap.gap-3,
    #roughConsumptionContent .d-flex.flex-wrap.gap-3 {
        align-items: stretch;
    }
}

@media (max-width: 575.98px) {
    .content-section {
        margin-bottom: 0.75rem;
    }

    .content-section.card {
        border-radius: 0.5rem;
    }

    .content-section.card > .card-body {
        padding: 0.85rem;
    }

    #updateEquipmentBomContent > .card-body,
    #updatePMBOMContent > .card-body {
        padding: 0.75rem;
    }

    #updateEquipmentBomContent .asset-bom-filter,
    #updateEquipmentBomContent .asset-bom-panel,
    #updatePMBOMContent .asset-bom-filter,
    #updatePMBOMContent .asset-bom-panel {
        padding: 0.65rem;
    }

    #updateEquipmentBomContent .asset-bom-layout,
    #updatePMBOMContent .asset-bom-layout {
        gap: 0.75rem;
    }

    #updateEquipmentBomContent .asset-bom-form-row,
    #updatePMBOMContent .asset-bom-form-row {
        grid-template-columns: minmax(0, 1fr);
    }

    #updateEquipmentBomContent .d-flex.justify-content-end.gap-2,
    #updatePMBOMContent .d-flex.justify-content-end.gap-2 {
        flex-wrap: wrap;
    }

    #updateEquipmentBomContent .d-flex.justify-content-end.gap-2 .btn,
    #updatePMBOMContent .d-flex.justify-content-end.gap-2 .btn {
        flex: 1 1 120px;
    }

    .card-title,
    .content-section h2 {
        font-size: 1.25rem;
        line-height: 1.3;
    }

    .button-container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .button-container .btn,
    .content-section .mt-4.text-end .btn {
        width: 100%;
        margin-left: 0 !important;
    }

    .inline-fields,
    #updateWorkOrderContent .d-flex.flex-nowrap.gap-3.overflow-auto,
    #updateWorkOrderContent .d-flex.align-items-center.gap-2.mb-3 {
        flex-wrap: wrap !important;
        overflow-x: visible !important;
    }

    .inline-fields > div,
    #updateWorkOrderContent .inline-input,
    #spare-consumptionContent .inline-input,
    #roughConsumptionContent .inline-input {
        flex: 1 1 100%;
        min-width: 100%;
        width: 100%;
    }

    #createWorkOrderContent .inline-fields > div {
        margin-left: 0 !important;
        max-width: 100%;
    }

    #createWorkOrderContent .form-control,
    #createWorkOrderContent .form-select,
    #createWorkOrderContent textarea.form-control {
        max-width: 100%;
    }

    #correctiveSparePartTableContainer {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #correctiveSparePartTableContainer .table {
        min-width: 560px;
        margin-bottom: 0;
    }

    #costByMachineContent > .card-body > .d-flex.justify-content-between {
        align-items: stretch !important;
        flex-direction: column;
        gap: 0.75rem;
    }

    #downloadConsumptionData_5_2 {
        width: 100%;
    }

    #costByMachineContent .d-flex.flex-wrap.gap-2.align-items-center {
        align-items: stretch !important;
    }

    #costByMachineContent .inline-input,
    #costByMachineContent .inline-input .form-select {
        width: 100% !important;
    }

    #cbm-time-selector-container > .d-flex.align-items-center {
        align-items: stretch !important;
        flex-wrap: wrap;
        gap: 0.65rem !important;
        overflow-x: visible;
    }

    #cbm-time-selector-container .form-check {
        flex: 1 1 calc(50% - 0.65rem);
        min-width: 0;
        margin-left: 0 !important;
    }

    #cbm-time-selector-container .dropdown {
        flex: 1 1 100%;
        min-width: 0;
    }

    #cbm-time-selector-container .dropdown-toggle {
        width: 100%;
        text-align: left;
    }

    #cbm-monthly-chart-container,
    #cbm-pareto-chart-container {
        height: 430px !important;
        overflow: hidden;
    }

    #workOrderTypeUpdate,
    #updateWorkOrderContent .form-control,
    #updateWorkOrderContent .form-select,
    #spare-consumptionContent .form-control,
    #spare-consumptionContent .form-select,
    #roughConsumptionContent .form-control,
    #roughConsumptionContent .form-select,
    #employeeSelect_sc,
    #rc_employeeSelect {
        width: 100% !important;
    }

    #updateWorkOrderContent #filtButton,
    #submitConsumption,
    #resetConsumption,
    #rc_submitBtn,
    #rc_cancelBtn,
    #cc_submitBtn,
    #cc_cancelBtn {
        width: 100%;
        margin-left: 0 !important;
    }

    #spare-consumptionContent > .card-body > div:last-child,
    #roughConsumptionContent .mt-4,
    #cc_detailContainer .mt-3:last-child {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }
}
