/* 설비관리 5개 화면 공용 스타일.
   품질관리와 같이 모든 선택자를 .equipment-page 로 한정해 다른 화면과 충돌하지 않게 한다. */

.equipment-page { height: 100%; display: grid; gap: 3px; }

.equipment-page .panel { background: #fff; border: 1px solid #858585; position: relative; overflow: hidden; }
.equipment-page .panel-head {
    height: 42px; background: var(--mes-panel-head); color: #fff;
    display: flex; align-items: center; gap: 8px; padding: 0 8px; font-size: 18px; font-weight: 700;
}
.equipment-page .panel-head .icon { color: var(--mes-orange); }
.equipment-page .head-note { margin-left: auto; margin-right: 8px; font-size: 12px; color: #DCE4E9; white-space: nowrap; }
.equipment-page .head-rule { margin-left: 16px; font-size: 12px; font-weight: 700; color: #FFE082; white-space: nowrap; }

/* ===== 조회조건 ===== */
.equipment-page .search-fields {
    position: absolute; left: 0; right: 0; top: 42px; height: 64px;
    display: flex; align-items: center; gap: 10px; padding: 0 12px;
}
.equipment-page .search-fields label { font-size: 15.5px; white-space: nowrap; }
.equipment-page .search-fields input,
.equipment-page .search-fields select {
    height: 31px; padding: 2px 7px;
    border: 1px solid #D4D4D4; background: #fff; outline: none; font-size: 15px; box-shadow: none;
}
.equipment-page .search-fields .date { width: 150px; }
.equipment-page .search-fields .normal { width: 170px; }
.equipment-page .search-fields .pick { width: 150px; }
.equipment-page .search-fields .search-btn {
    margin-left: auto; width: 100px; height: 38px; border: 0;
    background: var(--mes-new); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
}

/* ===== 요약 칸 ===== */
.equipment-page .summary-wrap { height: 100%; display: grid; gap: 3px; padding: 3px; }
.equipment-page .summary-wrap.cols-4 { grid-template-columns: repeat(4, 1fr); }
.equipment-page .summary-wrap.cols-5 { grid-template-columns: repeat(5, 1fr); }
.equipment-page .sum { border: 1px solid #9A9A9A; background: #fff; display: grid; grid-template-columns: 1.08fr .92fr; min-width: 0; }
.equipment-page .sum .label { display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; background: #F4F4F4; text-align: center; }
.equipment-page .sum .value {
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1;
}
.equipment-page .sum.total .value { color: #222; }
.equipment-page .sum.run .value { color: #1A6E42; }
.equipment-page .sum.stop .value { color: #7A7A7A; }
.equipment-page .sum.alarm .value { color: #C94949; }
.equipment-page .sum.comm .value { color: #E58C00; }
.equipment-page .sum.rate .value { color: #1E88E5; }
.equipment-page .sum.small .value { font-size: 18px; }

/* ===== 본문 ===== */
.equipment-page .work { display: grid; gap: 3px; min-height: 0; }
.equipment-page .rightcol { display: grid; gap: 3px; min-height: 0; overflow: hidden; }

/* ===== 표 ===== */
.equipment-page .grid-wrap { position: absolute; left: 0; right: 0; top: 42px; bottom: 0; overflow: auto; scrollbar-gutter: stable; }
.equipment-page .tbl { border-collapse: collapse; table-layout: fixed; width: 100%; font-size: 14px; }
.equipment-page .tbl th {
    position: sticky; top: 0; z-index: 2; height: 40px; background: var(--mes-grid-head); color: #fff;
    border-right: 1px solid #547083; border-bottom: 1px solid #ddd;
    padding: 0 6px; font-weight: 700; white-space: nowrap; text-align: left;
}
.equipment-page .tbl th.sortable { cursor: pointer; user-select: none; }
.equipment-page .tbl th.sortable:hover { background: #31576D; }
.equipment-page .tbl th .sort-icon { margin-left: 5px; color: #B7C6D0; font-size: 11px; }
.equipment-page .tbl th.active .sort-icon { color: #fff; font-size: 12px; font-weight: 800; }
.equipment-page .tbl td {
    height: 37px; border-right: 1px solid #D1D1D1; border-bottom: 1px solid #DEDEDE;
    padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.equipment-page .tbl tbody tr { cursor: pointer; }
.equipment-page .tbl tbody tr:hover td { background: #E8F4F2; }
.equipment-page .tbl tbody tr.selected td { background: var(--mes-grid-selected); }
.equipment-page .tbl tbody tr.no-row td { color: #777; background: #F3F3F3; cursor: default; }
.equipment-page .center { text-align: center; }
.equipment-page .number { text-align: right; }
.equipment-page .danger { color: #C94949; font-weight: 700; }

/* ===== 상태 배지 ===== */
.equipment-page .badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 70px; height: 26px; padding: 0 8px;
    font-size: 13px; font-weight: 700; border: 1px solid #A7A7A7;
}
.equipment-page .badge.run { background: #E8F5EE; color: #1A6E42; }
.equipment-page .badge.stop { background: #EEF1F4; color: #4A4A4A; }
.equipment-page .badge.alarm { background: #FBE0DF; color: #A72D28; }
.equipment-page .badge.offline { background: #FFF4CC; color: #8A6500; }
.equipment-page .badge.normal { background: #E8F5EE; color: #1A6E42; }
.equipment-page .badge.warn { background: #FFF4CC; color: #8A6500; }
.equipment-page .badge.danger { background: #FBE0DF; color: #A72D28; }
.equipment-page .badge.active { background: #C94949; color: #fff; border-color: #A72D28; }
.equipment-page .badge.clear { background: #3CB371; color: #fff; border-color: #2E8B57; }

/* ===== 게이지 (소모품 사용률) ===== */
.equipment-page .gauge { height: 16px; background: #EEF1F3; border: 1px solid #CCD2D6; position: relative; }
.equipment-page .gauge i { display: block; height: 100%; background: #26A69A; }
.equipment-page .gauge.warn i { background: #FFAB00; }
.equipment-page .gauge.danger i { background: #C94949; }
.equipment-page .gauge span {
    position: absolute; left: 0; right: 0; top: -1px; text-align: center;
    font-size: 11px; line-height: 15px; color: #102027;
}

/* ===== 차트 ===== */
.equipment-page .chart-area { position: absolute; left: 18px; right: 18px; top: 58px; bottom: 34px; }
.equipment-page .bars { height: 100%; display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; }
.equipment-page .bar-col { flex: 1; max-width: 70px; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.equipment-page .stack { width: 34px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.equipment-page .stack .run { background: #26A69A; }
.equipment-page .stack .stop { background: #C7CDD1; }
.equipment-page .bar-value { position: absolute; top: -20px; left: -22px; right: -22px; text-align: center; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.equipment-page .bar-label { position: absolute; bottom: -21px; left: -18px; right: -18px; text-align: center; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.equipment-page .legend { position: absolute; right: 12px; top: 48px; display: flex; gap: 14px; font-size: 12px; font-weight: 700; }
.equipment-page .legend i { display: inline-block; width: 17px; height: 10px; margin-right: 5px; }
.equipment-page .legend i.run { background: #26A69A; }
.equipment-page .legend i.stop { background: #C7CDD1; }

/* ===== 상세 · 폼 ===== */
.equipment-page .info-grid {
    position: absolute; left: 12px; right: 12px; top: 50px; bottom: 10px;
    display: grid; grid-template-columns: 96px minmax(90px, 1fr); gap: 8px 10px; align-items: center;
}
.equipment-page .lab { text-align: right; font-size: 14px; white-space: nowrap; }
.equipment-page .field {
    height: 30px; padding: 4px 7px; background: #E7E7E7; border: 1px solid #C6C6C6;
    font-size: 14px; display: flex; align-items: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.equipment-page .form-body { position: absolute; left: 12px; right: 12px; top: 50px; bottom: 62px; overflow: auto; }
.equipment-page .form-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.equipment-page .form-row > label { text-align: right; font-size: 14px; }
.equipment-page .input {
    height: 30px; padding: 3px 7px; background: #fff; font-size: 14px; outline: none;
    border-style: solid; border-width: 1px;
    border-color: #ECECEC #E6E6E6 #838383 #ECECEC;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.96);
}
.equipment-page .input.read { background: #E7E7E7; color: #666; border: 1px solid #C6C6C6; box-shadow: none; }
.equipment-page .form-message { font-size: 12.5px; color: #1B6B5C; margin-top: 4px; }
.equipment-page .form-message.error { color: #BD3737; }
.equipment-page .buttons {
    position: absolute; left: 12px; right: 12px; bottom: 12px; height: 40px;
    display: flex; gap: 6px; justify-content: flex-end;
}
.equipment-page .crud { width: 92px; height: 40px; border: 0; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.equipment-page .crud:disabled { opacity: .42; cursor: not-allowed; }
.equipment-page .crud.new { background: var(--mes-new); }
.equipment-page .crud.save { background: var(--mes-edit); }
.equipment-page .crud.replace { background: var(--mes-add); color: #222; }
