/**
 * OEE365.CSS — desain khusus halaman OEE 365 (efek silver / brushed metal)
 * Tidak mempengaruhi OEE standar, wizard, atau modul lain.
 */

/* ---- Latar section ---- */
.sec.sec-oee365.active {
  padding: 12px 10px 24px;
}

.oee365-panel {
  max-width: 920px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  /* Plat logam silver */
  background: linear-gradient(145deg, #ffffff 0%, #e2e8f0 48%, #cbd5e1 100%);
  border: 1.5px solid #94a3b8;
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.28),
    0 2px 0 rgba(255, 255, 255, 0.85) inset,
    0 -1px 0 rgba(15, 23, 42, 0.08) inset;
}

/* ---- Header metal gelap ---- */
.oee365-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px 16px;
  background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%);
  border-bottom: 2px solid #1a202c;
  position: relative;
}
.oee365-head::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 2px;
}

.oee365-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font: 900 13px system-ui, sans-serif;
  letter-spacing: 0.4px;
  color: #0f172a;
  background: linear-gradient(180deg, #ffffff 0%, #94a3b8 100%);
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 2px 4px rgba(0, 0, 0, 0.2);
}

.oee365-head-text h2 {
  margin: 0;
  font: 700 22px system-ui, sans-serif;
  color: #fff;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  letter-spacing: 0.3px;
}

.oee365-sub {
  margin: 4px 0 0;
  font: 500 12.5px system-ui, sans-serif;
  color: #cbd5e1;
  line-height: 1.35;
}

/* ---- Tabel ---- */
.oee365-table-wrap {
  padding: 0;
}

.oee365-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font: 500 13.5px system-ui, sans-serif;
  color: #334155;
}

.oee365-table thead th {
  padding: 12px 20px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  color: #1e293b;
  background: linear-gradient(180deg, #f1f5f9 0%, #cbd5e1 100%);
  border-bottom: 2px solid #94a3b8;
}

.oee365-th-val {
  text-align: right !important;
  width: 28%;
}

.oee365-table tbody td {
  padding: 11px 20px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.55);
}

.oee365-table tbody tr:nth-child(even of :not(.oee365-sec):not(.oee365-result-row)) td,
.oee365-table tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.7);
}

/* Section header rows (silver band) */
.oee365-table tr.oee365-sec td {
  padding: 10px 20px;
  font: 700 11.5px system-ui, sans-serif;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #0f172a;
  background: linear-gradient(180deg, #e2e8f0 0%, #94a3b8 100%) !important;
  border-bottom: 1px solid #64748b;
  border-top: 1px solid #cbd5e1;
}

.oee365-code {
  display: inline-block;
  min-width: 2.4em;
  margin-right: 8px;
  font: 700 13px 'IBM Plex Mono', ui-monospace, monospace;
  color: #0f172a;
}

.oee365-hint {
  display: block;
  margin-top: 2px;
  margin-left: calc(2.4em + 8px);
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
}

.oee365-val {
  text-align: right !important;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  width: 28%;
  border-left: 1.5px solid #94a3b8;
}

.oee365-val-accent {
  /* samakan dengan warna OEE standar (calculation.js: #f87171 / #2ee27e) */
  color: #f87171 !important;
  font-weight: 700;
}

.oee365-result-row td {
  background: #fff !important;
  color: #374151 !important;
  border-bottom: 2px solid #374151;
  padding-top: 14px;
  padding-bottom: 14px;
}

.oee365-val-result {
  font: 800 17px system-ui, sans-serif !important;
  color: inherit !important;
}

.oee365-result-row.is-good td {
  background: #16a34a !important;
  color: #fff !important;
}

.oee365-result-row.is-bad td {
  background: #dc2626 !important;
  color: #fff !important;
}

.oee365-result-row .oee365-code {
  color: inherit;
}

/* ---- Kotak formula (brushed green metal) ---- */
.oee365-formula {
  margin: 16px 20px 20px;
  padding: 14px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1.5px solid #86efac;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 4px 12px rgba(22, 101, 52, 0.08);
  color: #166534;
  font: 600 13.5px system-ui, sans-serif;
  line-height: 1.5;
}

.oee365-formula .d-item {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.oee365-formula .d-item.ok {
  color: #166534;
}

.oee365-formula .d-item small,
.oee365-formula small {
  display: block;
  margin-top: 6px;
  font-weight: 500;
  font-size: 12.5px;
  color: #15803d;
}

.oee365-formula b {
  font-weight: 800;
  color: #14532d;
}

/* ---- Dark theme ---- */
[data-theme="dark"] .oee365-panel {
  background: linear-gradient(145deg, #334155 0%, #1e293b 50%, #0f172a 100%);
  border-color: #475569;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .oee365-table thead th {
  background: linear-gradient(180deg, #475569 0%, #334155 100%);
  color: #e2e8f0;
  border-color: #64748b;
}

[data-theme="dark"] .oee365-table tbody td {
  background: rgba(15, 23, 42, 0.55);
  color: #cbd5e1;
  border-color: #334155;
}

[data-theme="dark"] .oee365-table tr.oee365-sec td {
  background: linear-gradient(180deg, #475569 0%, #334155 100%) !important;
  color: #f1f5f9;
}

[data-theme="dark"] .oee365-code,
[data-theme="dark"] .oee365-val {
  color: #f8fafc;
}

[data-theme="dark"] .oee365-val {
  border-left-color: #64748b;
}

[data-theme="dark"] .oee365-val-result {
  color: inherit !important;
}
[data-theme="dark"] .oee365-val-accent {
  color: #f87171 !important;
}

[data-theme="dark"] .oee365-formula {
  background: linear-gradient(135deg, #14532d 0%, #166534 100%);
  border-color: #22c55e;
  color: #bbf7d0;
}

[data-theme="dark"] .oee365-formula .d-item.ok,
[data-theme="dark"] .oee365-formula small {
  color: #bbf7d0;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .oee365-head {
    padding: 14px 14px 12px;
    gap: 10px;
  }
  .oee365-head-text h2 {
    font-size: 18px;
  }
  .oee365-sub {
    font-size: 11.5px;
  }
  .oee365-table thead th,
  .oee365-table tbody td {
    padding: 10px 12px;
    font-size: 12.5px;
  }
  .oee365-th-val,
  .oee365-val {
    width: 32%;
  }
  .oee365-formula {
    margin: 12px;
    padding: 12px 14px;
    font-size: 12.5px;
  }
}
