/* Auto-paired 1:1 with js/app.js — edit styles for that module here */

.toolbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.app-bar-name {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.3px;
}

.toolbar:not(.collapsed) .more-panel {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 0 0 24px 24px;
  box-shadow: var(--shadow-md);
  padding: 18px;
}

.sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  margin-top: 16px;
  margin-bottom: 40px;
}

.hwrap .kicker {
  color: var(--mut);
}

.hwrap h1 {
  color: var(--ink);
  letter-spacing: -1px;
}

.hwrap .sub {
  color: var(--mut);
}

[data-theme="professional"] .toolbar { box-shadow: 0 1px 4px -1px rgba(11,95,165,.12); }

[data-theme="professional"] .app-bar-name { color: var(--navy); }

[data-theme="professional"] .app-bar-menu-btn:hover { border-color: var(--pro-blue); color: var(--pro-blue); }

[data-theme="professional"] .toolbar:not(.collapsed) .app-bar-menu-btn {
  background: var(--pro-blue-lt); border-color: rgba(11,95,165,.35); color: var(--pro-blue-d);
}

[data-theme="professional"] .toolbar-backdrop { background: rgba(11, 42, 71, .45); }

[data-theme="dark"] .toolbar,
[data-theme="dark"] .app-bar,
[data-theme="dark"] .topbar {
  background: #0c0c0e !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  color: #f5f5f7;
}

[data-theme="dark"] .app-bar-name,
[data-theme="dark"] .breadcrumb {
  color: #f5f5f7 !important;
}

[data-theme="dark"] .app-bar-menu-btn,
[data-theme="dark"] .top-icon-btn,
[data-theme="dark"] .rail-toggle-btn {
  color: #aeaeb2 !important;
  border-color: transparent !important;
}

[data-theme="dark"] .app-bar-menu-btn:hover,
[data-theme="dark"] .top-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f5f5f7 !important;
}

[data-theme="dark"] .sheet {
  background: transparent;
  color: #f5f5f7;
}

[data-theme="dark"] .sheet-inline-controls input,
[data-theme="dark"] .sheet-inline-controls select,
[data-theme="dark"] .sheet-control-group input,
[data-theme="dark"] .sheet-control-group select,
[data-theme="dark"] .sheet-op-box {
  background: #1c1c1f !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f5f5f7 !important;
}

[data-theme="dark"] .sheet-control-label {
  color: #8e8e93;
}

[data-theme="dark"] .sheet {
  background: #0c0c0e !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

[data-theme="dark"] .sheet-unified-control {
  background: #161618 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

[data-theme="dark"] .sheet-stage-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #aeaeb2 !important;
  box-shadow: none !important;
}

[data-theme="dark"] .sheet-stage-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f5f5f7 !important;
}

[data-theme="dark"] .sheet-stage-btn[data-sheet-stage="mixing"].on {
  background: linear-gradient(180deg, #1cc46b, #118c4a) !important;
}

[data-theme="dark"] .sheet-stage-btn[data-sheet-stage="filling"].on {
  background: linear-gradient(180deg, #4f83f7, #2563eb) !important;
}

[data-theme="dark"] .sheet-stage-btn[data-sheet-stage="steril"].on {
  background: linear-gradient(180deg, #ec4f98, #d52774) !important;
}

[data-theme="dark"] .sheet-stage-btn[data-sheet-stage="visual"].on {
  background: linear-gradient(180deg, #9857e0, #7e22ce) !important;
}

[data-theme="dark"] .sheet-stage-btn[data-sheet-stage="kemas"].on {
  background: linear-gradient(180deg, #f79a4f, #ea580c) !important;
}

[data-theme="dark"] .sheet-date-trigger {
  background: #1c1c1f !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f5f5f7 !important;
  box-shadow: none !important;
}

[data-theme="dark"] .sheet-mini-segment {
  background: #1c1c1f !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
}

[data-theme="dark"] .sheet-mini-segment button {
  color: #aeaeb2 !important;
  background: transparent !important;
}

[data-theme="dark"] .sheet-mini-segment button.on {
  background: #f5f5f7 !important;
  color: #0c0c0e !important;
  box-shadow: none !important;
}

[data-theme="dark"] .sheet-op-box {
  background: #1c1c1f !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f5f5f7 !important;
}

[data-theme="dark"] .sheet-op-box::placeholder {
  color: #636366 !important;
}

[data-theme="dark"] .sheet-op-box:focus {
  border-color: rgba(255, 255, 255, 0.25) !important;
  background: #0c0c0e !important;
}

[data-theme="dark"] .sheet-op-box.filled {
  background: #222226 !important;
  color: #f5f5f7 !important;
}

[data-theme="dark"] .sheet-control-label,
[data-theme="dark"] .sheet-op-control .sheet-control-label {
  color: #8e8e93 !important;
}

[data-theme="dark"] .sheet-kpi-row {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
  background: transparent !important;
}

[data-theme="dark"] .sheet-kpi {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
  color: #f5f5f7 !important;
}

[data-theme="dark"] .sheet-kpi span {
  color: inherit !important;
}

[data-theme="dark"] .hwrap {
  background: #0c0c0e !important;
  box-shadow: none !important;
}

[data-theme="dark"] .ms-card,
[data-theme="dark"] .sheet-card,
[data-theme="dark"] .glass-card {
  background: #161618 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #f5f5f7 !important;
  box-shadow: none !important;
}

[data-theme="dark"] .sheet-kpi b,
[data-theme="dark"] .sheet-kpi span {
  color: #f5f5f7 !important;
}

[data-theme="dark"] .sheet-kpi[data-kpi="P"],
[data-theme="dark"] .sheet-kpi[data-kpi="Q"] {
  background: rgba(255, 105, 97, 0.12) !important;
  border-color: rgba(255, 105, 97, 0.25) !important;
}

[data-theme="dark"] .sheet-kpi-oee {
  background: #1c1c1f !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .sheet-op-box {
  background: rgba(24, 42, 66, 0.70) !important;
  border: 1px solid rgba(151, 183, 225, 0.13) !important;
  color: #edf4ff !important;
}

[data-theme="dark"] .sheet-op-box:hover {
  background: rgba(35, 57, 86, 0.76) !important;
}

[data-theme="dark"] .sheet-op-box:focus {
  background: rgba(20, 39, 63, 0.88) !important;
  border-color: rgba(32, 215, 164, 0.72) !important;
  box-shadow: 0 0 0 3px rgba(32, 215, 164, 0.12) !important;
}

[data-theme="dark"] .sheet-op-box.filled {
  background: rgba(32, 215, 164, 0.15) !important;
  border-color: rgba(32, 215, 164, 0.4) !important;
  color: #20d7a4 !important;
}

[data-theme="dark"] .sheet-op-box::placeholder {
  color: #74849c !important;
}

[data-theme="dark"] .sheet-stage-btn {
  background: rgba(24, 42, 66, 0.70) !important;
  border-color: rgba(151, 183, 225, 0.13) !important;
  color: #a7b6ca !important;
}

[data-theme="dark"] .sheet-stage-btn:not(.on):hover {
  background: rgba(35, 57, 86, 0.76) !important;
  color: #edf4ff !important;
  border-color: rgba(151, 183, 225, 0.22) !important;
}

.app-bar-inner { flex-direction: row !important; }

.app-bar-menu-btn { order: 1 !important; }

.app-bar-badges { order: 2 !important; }

[data-theme="dark"] .app-bar-menu-btn {
  background: #0d3d2e !important;
  border: 1px solid rgba(52, 211, 153, 0.35) !important;
  color: #6ee7b7 !important;
  border-radius: 12px !important;
}

.sheet-shift-control .sheet-mini-segment button,
.sheet-line-control .sheet-mini-segment button {
  min-width: 28px;
  padding: 4px 6px;
  font-size: 11px;
  white-space: nowrap;
}

.sheet-inline-controls {
  display: flex !important;
  flex-direction: column;
  flex-wrap: nowrap !important;

  overflow: visible !important;

  gap: 6px !important;

  align-items: stretch;

  padding-bottom: 4px;

  min-height: 40px;
}

.sheet-inline-controls > * {
  flex: 0 0 auto !important;
  white-space: nowrap;
}

.sheet-top-row {
  display: flex;

  align-items: center;

  gap: 6px;

  flex-wrap: nowrap;

  overflow-x: auto;

  -webkit-overflow-scrolling: touch;

  scrollbar-width: none;
}

.sheet-top-row::-webkit-scrollbar {
  display: none;
}

.sheet-op-control {
  display: flex;

  align-items: center;

  gap: 6px;

  flex-wrap: nowrap !important;

  flex: 1 1 auto;

  min-width: 0;
}

.sheet-op-control .sheet-control-label {
  white-space: nowrap;
  font-size: 8.5px;
}

.sheet-op-row {
  display: flex;

  align-items: center;

  width: 100%;

  flex-wrap: nowrap !important;

  overflow-x: auto;

  -webkit-overflow-scrolling: touch;

  scrollbar-width: none;
}

.sheet-op-row::-webkit-scrollbar {
  display: none;
}

.sheet-op-boxes {
  display: flex;

  gap: 3px;

  flex-wrap: nowrap !important;

  flex: 1 1 auto;

  justify-content: center !important;

  overflow-x: auto;

  -webkit-overflow-scrolling: touch;

  scrollbar-width: none;
}

.sheet-op-boxes::-webkit-scrollbar {
  display: none;
}

.sheet-op-box {
  flex: 0 0 auto;

  width: 32px;
  min-width: 28px;

  text-align: center;

  text-transform: uppercase;

  font: 700 10px var(--mono);

  border: 1px solid #d6dee5;
  border-radius: 5px;

  padding: 4px 1px;

  background: #fbfcfd;
}

.sheet-op-box::placeholder {
  color: #b6c4cf;
  font-size: 7.5px;
  text-transform: none;
}

.sheet-op-box:hover {
  background: #f4f8fa;
}

.sheet-op-box.filled {
  border-color: rgba(18,161,80,.5);
  background: rgba(18,161,80,.06);
}

.sheet-date-control {
  margin-left: 0 !important;
  flex: 0 0 auto !important;
}

.sheet-date-trigger:hover,
.sheet-date-trigger:focus-visible {
  outline: none;

  border-color: var(--sheet-accent);

  background: var(--sheet-accent-soft);

  color: var(--sheet-accent);
}

.sheet-date-icon {
  font-size: 11px;
  line-height: 1;
}

.sheet-date-chevron {
  font-size: 10px;
  color: var(--mut);
}

.sheet-unified-control[data-stage="mixing"] {
  --sheet-accent: #168a4a;
  --sheet-accent-soft: rgba(22,138,74,.11);
}

.sheet-unified-control[data-stage="filling"] {
  --sheet-accent: #2563eb;
  --sheet-accent-soft: rgba(37,99,235,.10);
}

.sheet-unified-control[data-stage="steril"] {
  --sheet-accent: #db2777;
  --sheet-accent-soft: rgba(219,39,119,.10);
}

.sheet-unified-control[data-stage="visual"] {
  --sheet-accent: #7e22ce;
  --sheet-accent-soft: rgba(126,34,206,.10);
}

.sheet-unified-control[data-stage="kemas"] {
  --sheet-accent: #ea580c;
  --sheet-accent-soft: rgba(234,88,12,.10);
}

.sheet-process-tabs {
  display: flex;

  align-items: center;

  gap: 4px;

  overflow-x: auto;

  overscroll-behavior-x: contain;

  -webkit-overflow-scrolling: touch;

  scrollbar-width: none;

  padding: 0 0 7px;

  margin: 0;
}

.sheet-process-tabs::-webkit-scrollbar {
  display: none;
}

.sheet-stage-btn:hover {
  transform: translateY(-1px);
  border-color: var(--sheet-accent);
}

.sheet-control-group {
  display: inline-flex;

  align-items: center;

  gap: 5px;

  flex: 0 0 auto;

  min-width: 0;
}

.sheet-control-label {
  font: 800 9px var(--mono);

  letter-spacing: .75px;

  text-transform: uppercase;

  color: var(--mut);
}

.sheet-control-divider {
  width: 1px;
  height: 22px;

  background: var(--line);

  flex: 0 0 auto;
}

.sheet-mini-segment {
  display: inline-flex;

  align-items: stretch;

  gap: 2px;

  padding: 2px;

  border: 1px solid var(--line);

  border-radius: 8px;

  background: #f6f8fa;
}

.sheet-mini-segment button {
  min-width: 25px;

  height: 27px;

  padding: 3px 7px;

  border: 0;

  border-radius: 6px;

  background: transparent;

  color: var(--ink2);

  font: 800 11.5px var(--mono);

  line-height: 1;

  cursor: pointer;

  transition:
    background .15s,
    color .15s,
    box-shadow .15s,
    transform .12s;
}

.sheet-mini-segment button:hover {
  background: #eaf0f4;
}

.sheet-mini-segment button.on {
  box-shadow: 0 1px 5px -3px rgba(0,0,0,.45);
}

.sheet-kpi-row {
  position:relative;
  z-index:5;
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 4px;

  margin-top: 5px;

  padding-top: 5px;

  border-top: 1px solid var(--line2);
}

.sheet-kpi span {
  flex: 0 0 auto;
  opacity: .95;
}

.sheet-kpi b {
  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;

  color: var(--kpi-color);

  font-size: 10px;

  font-weight: 900;
}

.sheet-kpi:nth-child(1) {
  --kpi-color: #16a34a;
}

.sheet-kpi:nth-child(2) {
  --kpi-color: #2563eb;
}

.sheet-kpi:nth-child(3) {
  --kpi-color: #7c3aed;
}

.sheet-kpi-oee {
  --kpi-color: #ea580c;

  color: #c2410c;

  background:
    linear-gradient(
      180deg,
      rgba(234,88,12,.14),
      rgba(234,88,12,.08)
    );

  border-color: rgba(234,88,12,.28);

  box-shadow:
    inset 0 -2px 0 rgba(234,88,12,.18);
}

.sheet-kpi-oee b {
  color: #c2410c;
}

@media (max-width: 640px) {

  .sheet-unified-control {
    margin-bottom: 10px;

    padding: 7px 7px 6px;

    border-radius: 10px;
  }

  .sheet-process-tabs {
    gap: 3px;

    padding-bottom: 6px;
  }

  .sheet-stage-btn {
    padding: 5px 9px;

    font-size: 10.5px;
  }

  .sheet-inline-controls {
    gap: 5px;
  }

  .sheet-control-label {
    font-size: 8px;

    letter-spacing: .55px;
  }

  .sheet-control-divider {
    height: 20px;
  }

  .sheet-mini-segment {
    gap: 1px;

    padding: 1px;

    border-radius: 7px;
  }

  .sheet-mini-segment button {
    min-width: 23px;

    height: 26px;

    padding: 3px 6px;

    font-size: 11px;

    border-radius: 5px;
  }

  .sheet-date-trigger {
    min-height: 29px;

    padding: 4px 7px;

    gap: 4px;

    font-size: 9.5px;
  }

  .sheet-kpi-row {
    gap: 3px;

    margin-top: 4px;

    padding-top: 4px;
  }

  .sheet-kpi {
    min-height: 23px;

    padding: 2px 3px;

    font-size: 7.5px;

    border-radius: 6px;
  }

  .sheet-kpi b {
    font-size: 9px;
  }
}

@media (max-width: 420px) {

  .sheet-mini-segment button {
    min-width: 24px !important;

    padding: 3px 4px !important;

    font-size: 10px !important;
  }

  .sheet-date-trigger {
    font-size: 9px !important;

    padding: 4px 5px !important;
  }

  .sheet-op-control .sheet-control-label {
    font-size: 7px;
  }
}

@media (max-width: 390px) {

  .sheet-control-label {
    display: none;
  }

  .sheet-control-divider {
    margin: 0 1px;
  }

  .sheet-date-trigger {
    max-width: 128px;

    overflow: hidden;

    text-overflow: ellipsis;
  }

  .sheet-date-trigger #sheetDateText {
    overflow: hidden;

    text-overflow: ellipsis;
  }

  .sheet-kpi {
    gap: 2px;

    min-height: 22px;

    padding: 2px;

    font-size: 7.2px;
  }

  .sheet-kpi b {
    font-size: 8.6px;
  }

  .sheet-op-box {
    width: 24px;

    min-width: 22px;

    font-size: 8px;

    padding: 2px 1px;
  }
}

.sheet-inline-controls {
  width: 100%;
  box-sizing: border-box;
}

.sheet {
  background: rgba(250,253,255,.78);
  border-color: rgba(255,255,255,.72);
  box-shadow: 0 28px 80px rgba(13,33,53,.20);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
}

.hwrap {
  background:
    linear-gradient(135deg, rgba(13,33,53,.95), rgba(22,60,86,.88)),
    linear-gradient(160deg, rgba(18,161,80,.16), transparent 55%);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.08);
}

.sheet-unified-control {
  border-color: rgba(255,255,255,.80);
  background: linear-gradient(180deg, rgba(255,255,255,.93), rgba(248,252,255,.76));
  box-shadow: 0 16px 34px rgba(15,36,55,.10), inset 0 1px 0 rgba(255,255,255,.80);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}

.sheet-stage-btn {
  border-color: rgba(185,199,210,.64);
  background: rgba(255,255,255,.80);
  box-shadow: 0 2px 8px rgba(15,36,55,.06);
}

.sheet-stage-btn:hover { transform: translateY(-1px) scale(1.01); }

.sheet-stage-btn.on {
  box-shadow: 0 8px 18px -8px var(--sheet-accent), inset 0 1px 0 rgba(255,255,255,.20);
}

.sheet-stage-btn[data-sheet-stage="mixing"].on { background: linear-gradient(180deg,#1cc46b,#118c4a); }

.sheet-stage-btn[data-sheet-stage="filling"].on { background: linear-gradient(180deg,#4f83f7,#2563eb); }

.sheet-stage-btn[data-sheet-stage="steril"].on { background: linear-gradient(180deg,#ec4f98,#d52774); }

.sheet-stage-btn[data-sheet-stage="visual"].on { background: linear-gradient(180deg,#9857e0,#7e22ce); }

.sheet-stage-btn[data-sheet-stage="kemas"].on { background: linear-gradient(180deg,#f79a4f,#ea580c); }

.sheet-inline-controls {
  padding: 3px 0;
}

.sheet-mini-segment {
  background: rgba(241,246,249,.78);
  border-color: rgba(180,195,206,.72);
  box-shadow: inset 0 1px 1px rgba(15,36,55,.05);
}

.sheet-mini-segment button:hover { transform: translateY(-1px); }

.sheet-mini-segment button.on { box-shadow: 0 4px 9px rgba(15,36,55,.12); }

.sheet-date-trigger {
  background: rgba(255,255,255,.90);
  border-color: rgba(180,195,206,.72);
  box-shadow: 0 3px 10px rgba(15,36,55,.06);
}

.sheet-kpi-row {
  border-top-color: rgba(195,207,216,.64);
}

.sheet-kpi::after {
  content: '';
  position: absolute;
  right: -12px;
  top: -12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--kpi-color) 14%, transparent);
}

.sheet-kpi span {
  position: relative;
  z-index: 1;
  font-weight: 900;
  letter-spacing: .2px;
}

.sheet-kpi b {
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
}

.sheet-kpi {
  --kpi-color: #94a3b8; /* abu-abu default sebelum kalkulasi jalan */
}

.sheet-kpi[data-state="red"]    { --kpi-color: #ef4444; }

.sheet-kpi[data-state="yellow"] { --kpi-color: #f59e0b; }

.sheet-kpi[data-state="green"]  { --kpi-color: #22c55e; }

.sheet-kpi[data-state="blue"]   { --kpi-color: #3b82f6; }

.sheet-kpi.kpi-achieved {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 0 0 1px color-mix(in srgb, var(--kpi-color) 45%, transparent),
    0 4px 14px color-mix(in srgb, var(--kpi-color) 32%, transparent);
}

.sheet-kpi.kpi-achieved .kpi-stars {
  opacity: 1;
}

.sheet-kpi.kpi-achieved .kpi-stars::before {
  animation: kpiStarPop 1.3s ease-out infinite;
}

.sheet-kpi.kpi-achieved .kpi-stars::after {
  animation: kpiStarPop 1.3s ease-out .4s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .kpi-fill { transition: none; }
  .sheet-kpi.kpi-achieved .kpi-stars::before,
  .sheet-kpi.kpi-achieved .kpi-stars::after {
    animation: none;
    opacity: .9;
  }
}

.sheet-kpi-oee {
  background: linear-gradient(135deg, rgba(255,247,238,.98), rgba(255,237,220,.88));
  box-shadow: inset 0 -2px 0 rgba(234,88,12,.18), 0 3px 12px rgba(234,88,12,.08);
}

@media (max-width: 390px) {
  body::before {
    background:
      radial-gradient(500px 280px at 15% 10%, rgba(255,255,255,.60), transparent 70%),
      radial-gradient(460px 260px at 90% 16%, rgba(115,190,255,.10), transparent 72%);
  }
  .sheet {
    border-radius: 14px;
  }
  .sheet-unified-control {
    padding-left: 6px;
    padding-right: 6px;
  }
  .sheet-stage-btn {
    padding-left: 8px;
    padding-right: 8px;
  }
  .sheet-kpi {
    min-height: 24px;
    border-radius: 8px;
  }
}

[data-theme="dark"] .sheet {
  background: #0c0c0e !important;
  border-color: rgba(255,255,255,0.06) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

[data-theme="dark"] .sheet-unified-control {
  background: #161618 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

[data-theme="dark"] .sheet-stage-btn {
  background: #1c1c1f !important;
  border-color: rgba(255,255,255,0.1) !important;
  color: #aeaeb2 !important;
  box-shadow: none !important;
}

[data-theme="dark"] .sheet-stage-btn:not(.on):hover {
  background: #222226 !important;
  color: #f5f5f7 !important;
}

[data-theme="dark"] .sheet-stage-btn[data-sheet-stage="mixing"].on {
  background: linear-gradient(180deg,#1cc46b,#118c4a) !important;
}

[data-theme="dark"] .sheet-stage-btn[data-sheet-stage="filling"].on {
  background: linear-gradient(180deg,#4f83f7,#2563eb) !important;
}

[data-theme="dark"] .sheet-stage-btn[data-sheet-stage="steril"].on {
  background: linear-gradient(180deg,#ec4f98,#d52774) !important;
}

[data-theme="dark"] .sheet-stage-btn[data-sheet-stage="visual"].on {
  background: linear-gradient(180deg,#9857e0,#7e22ce) !important;
}

[data-theme="dark"] .sheet-stage-btn[data-sheet-stage="kemas"].on {
  background: linear-gradient(180deg,#f79a4f,#ea580c) !important;
}

[data-theme="dark"] .sheet-date-trigger {
  background: #1c1c1f !important;
  border-color: rgba(255,255,255,0.1) !important;
  color: #f5f5f7 !important;
  box-shadow: none !important;
}

[data-theme="dark"] .sheet-mini-segment {
  background: #1c1c1f !important;
  border-color: rgba(255,255,255,0.1) !important;
  box-shadow: none !important;
}

[data-theme="dark"] .sheet-mini-segment button {
  color: #aeaeb2 !important;
}

[data-theme="dark"] .sheet-mini-segment button.on {
  background: #f5f5f7 !important;
  color: #0c0c0e !important;
  box-shadow: none !important;
}

[data-theme="dark"] .sheet-op-box {
  background: #1c1c1f !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #f5f5f7 !important;
}

[data-theme="dark"] .sheet-op-box:hover { background: #222226 !important; }

[data-theme="dark"] .sheet-op-box:focus {
  background: #0c0c0e !important;
  border-color: rgba(255,255,255,0.28) !important;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08) !important;
}

[data-theme="dark"] .sheet-op-box.filled {
  background: rgba(52, 211, 153, 0.15) !important;
  border-color: rgba(52, 211, 153, 0.4) !important;
  color: #34d399 !important;
}

[data-theme="dark"] .sheet-op-box::placeholder { color: #636366 !important; }

[data-theme="dark"] .sheet-kpi {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.1) !important;
  box-shadow: none !important;
}

[data-theme="dark"] .sheet-kpi b,
[data-theme="dark"] .sheet-kpi span { color: #f5f5f7 !important; }

.app-bar-inner {
  max-width: var(--page); margin: 0 auto; position: relative; z-index: 1;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  flex-direction: row; /* menu kiri → badges kanan */
}

.app-bar-title { display: flex; align-items: center; gap: 7px; flex: none; }

.app-bar-logo { font-size: 18px; line-height: 1; }

.app-bar-name { font: 800 14.5px var(--mono); letter-spacing: .3px; color: var(--navy); white-space: nowrap; }

.app-bar-badges {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
  order: 2;
}

.app-bar-badges::-webkit-scrollbar { display: none; }

.app-bar-menu-btn:hover { border-color: #b8c6d0; color: var(--ink); }

.toolbar:not(.collapsed) .app-bar-menu-btn {
  background: var(--green-bg); border-color: rgba(18,161,80,.4); color: var(--green-d);
}

.toolbar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(13, 33, 53, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.toolbar:not(.collapsed) .toolbar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  max-width: var(--page, min(100vw - 24px, 1680px));
  width: 100%;
  margin: 12px auto 72px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 30px 70px -35px rgba(13,33,53,.45);
  overflow: hidden; animation: rise .5s cubic-bezier(.22,.8,.3,1) both;
}

.hwrap::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg,rgba(255,255,255,.03) 0 1px,transparent 1px 26px);
  pointer-events: none;
}

.stripe { height: 6px; background: repeating-linear-gradient(-45deg,var(--green) 0 14px,var(--navy) 14px 28px); }

.sheet-f {
  padding: 14px 28px; border-top: 1px solid var(--line);
  background: #fafcfd; font: 12px var(--mono); color: #8fa2b2;
  display: flex; gap: 16px; flex-wrap: wrap;
}

.sheet-f span:first-child { margin-right: auto; }

@media (max-width: 768px) {
  .twrap { gap: 8px; }
  .pos { flex: 1 1 100%; min-width: 0; justify-content: center; }
  .navmode, .shiftsel { flex: 1 1 45%; }
  .navmode button, .shiftsel button { flex: 1; justify-content: center; padding: 11px 4px; font-size: 12px; }
  .nm-cap { display: none; }
  .hint { display: none; }
  #lastSaved { flex: 1 1 100%; text-align: center; }
  #btnReset, #btnSave { flex: 1 1 40%; padding: 13px 10px; }
  .sheet { margin: 12px 10px 30px; }
  .hwrap { padding: 16px 16px; }
  .sec { padding: 16px 14px; }
  .sec-h h2 { font-size: 21px; }
  .filter-grid { grid-template-columns: 1fr; }
  .sheet-f { padding: 12px 14px; }
  .preview-bar { right: 10px; bottom: 10px; gap: 6px; }
  .preview-btn { font-size: 10px; padding: 6px 10px; }
}

.sheet .hwrap,
.sheet .stripe {
  display: none !important;
}

@media (max-width: 768px) {
  
  /* ---- TOOLBAR: Kompak, padding minimal ---- */
  .toolbar {
    padding: 6px 10px;
    gap: 6px;
  }
  .twrap {
    gap: 6px;
  }
  
  /* ---- Toolbar Toggle Button: Lebih kecil ---- */
  .toolbar-toggle {
    padding: 6px 10px;
    font-size: 11px;
    gap: 4px;
  }
  
  /* ---- Shift Indicator: Ringkas ---- */
  .shift-indicator {
    padding: 7px 12px;
    font-size: 12px;
    gap: 6px;
  }
  
  /* ---- OEE Indicator: Lebih compact ---- */
  .oee-indicator {
    padding: 7px 12px;
    font-size: 12px;
    gap: 6px;
  }
  .oee-indicator .oi-label {
    font-size: 9px;
  }
  
  /* ---- Position Indicator: Hemat tempat ---- */
  .pos {
    padding: 7px 12px;
    font-size: 12px;
    min-width: auto;
    gap: 6px;
  }
  
  /* ---- Navigation Mode & Shift Selector ---- */
  .navmode, .shiftsel {
    padding: 2px;
    gap: 2px;
  }
  .nm-cap {
    font-size: 9px;
    padding: 0 4px 0 7px;
    letter-spacing: 1px;
  }
  .navmode button, .shiftsel button {
    font-size: 11px;
    padding: 6px 10px;
    gap: 4px;
    letter-spacing: .4px;
  }
  
  /* ---- Input Mode Buttons ---- */
  .inputmode {
    gap: 1px;
    padding: 2px;
  }
  .inputmode button {
    padding: 5px 8px;
    font-size: 11px;
  }
  
  /* ---- Help Button ---- */
  .help-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  
  /* ---- View Toggle Buttons ---- */
  .view-toggle button {
    padding: 6px 10px;
    font-size: 11px;
  }
  
  /* ---- Preset Column Buttons: Lebih ringkas ---- */
  .col-preset-bar {
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
  }
  .col-preset-btn {
    padding: 6px 10px;
    font-size: 11px;
    gap: 4px;
  }
  
  /* ---- Column Toggle Header: Compact ---- */
  .col-toggle-head {
    padding: 6px 10px;
    font-size: 10.5px;
    gap: 4px;
    letter-spacing: .6px;
  }
  
  /* ---- Column Toggle Bar: Hemat ruang ---- */
  .col-toggle-bar {
    gap: 6px;
    padding: 6px 10px;
  }
  .col-toggle-bar label {
    font-size: 11px;
    padding: 2px 6px;
    gap: 3px;
  }
  
  /* ---- Legend: Lebih ringkas ---- */
  .legend {
    gap: 6px;
    margin-bottom: 10px;
  }
  .lg {
    font-size: 11px;
    padding: 4px 10px;
    gap: 5px;
  }
  .sw {
    width: 8px;
    height: 8px;
  }
  
  /* ---- Buttons: Padding minimal ---- */
  .btn {
    padding: 8px 14px;
    font-size: 13px;
    gap: 6px;
  }
  
  /* ---- Section Padding: Hemat ruang ---- */
  .sec {
    padding: 14px 16px;
  }
  
  /* ---- Section Header: Compact ---- */
  .sec-h {
    gap: 8px;
    margin-bottom: 10px;
  }
  .sec-h .no {
    font-size: 15px;
    padding: 3px 8px;
  }
  .sec-h h2 {
    font-size: 18px;
  }
  .sec-h .sub2 {
    font-size: 11px;
  }
  
  /* ---- Filter Grid: Optimal untuk mobile ---- */
  .filter-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  /* ---- Operator Grid: Dual column ---- */
  .operator-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* ---- Product Grid: Single column ---- */
  .product-grid {
    grid-template-columns: 1fr;
  }
  
  /* ---- Edit Info / Sync Chip ---- */
  .edit-info {
    font-size: 10px;
    padding: 4px 10px;
    gap: 4px;
  }
  .sync-dot {
    width: 6px;
    height: 6px;
  }
  
  /* ---- Form Fields: Hemat padding ---- */
  .field {
    margin-bottom: 12px;
  }
  .field label {
    font-size: 11px;
    margin-bottom: 4px;
    letter-spacing: .6px;
  }
  .field input, .field select {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  /* ---- Shift Selector dalam Field ---- */
  .field .shiftsel {
    padding: 3px;
  }
  .field .shiftsel button {
    padding: 7px 3px;
    font-size: 11px;
  }

  /* ---- Sheet Wrapper ---- */
  .sheet {
    margin: 14px auto 40px;
    border-radius: 10px;
  }
  
  /* ---- Header Wrap ---- */
  .hwrap {
    padding: 14px 16px;
    gap: 12px;
  }
  .brand {
    gap: 10px;
  }
  .mark {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
  h1 {
    font-size: clamp(18px, 4vw, 26px);
    letter-spacing: .6px;
  }
  .clock {
    font-size: 20px;
    letter-spacing: .8px;
  }
  .date {
    font-size: 10px;
  }
  
  /* ---- Screen Navigation Tabs ---- */
  .screen-nav {
    flex: 1 1 100%;
    justify-content: center;
  }
  .screen-tab {
    flex: 1 1 calc(33.333% - 4px);
    justify-content: center;
    padding: 7px 2px;
    font-size: 9.5px;
  }
}

@media (max-width: 480px) {
  
  /* ---- BODY & ROOT ---- */
  body {
    font-size: 14px;
  }
  
  /* ---- TOOLBAR: Ultra compact ---- */
  .toolbar {
    padding: 4px 8px;
    gap: 4px;
  }
  .twrap {
    gap: 4px;
  }
  
  /* ---- Toolbar Toggle ---- */
  .toolbar-toggle {
    padding: 5px 8px;
    font-size: 10px;
    gap: 3px;
  }
  
  /* ---- Shift Indicator: Mini ---- */
  .shift-indicator {
    padding: 5px 10px;
    font-size: 11px;
    gap: 4px;
  }
  .si-dot {
    width: 7px;
    height: 7px;
  }
  
  /* ---- OEE Indicator: Mini ---- */
  .oee-indicator {
    padding: 5px 10px;
    font-size: 11px;
    gap: 4px;
  }
  .oee-indicator .oi-label {
    font-size: 8px;
    letter-spacing: .6px;
  }
  
  /* ---- Position Indicator: Minimal ---- */
  .pos {
    padding: 5px 10px;
    font-size: 11px;
    min-width: auto;
    gap: 4px;
  }
  .pos-dot {
    width: 7px;
    height: 7px;
  }
  
  /* ---- Nav Mode & Shift Selector ---- */
  .navmode, .shiftsel {
    padding: 1px;
    gap: 1px;
  }
  .nm-cap {
    font-size: 8px;
    padding: 0 3px 0 5px;
    letter-spacing: .8px;
  }
  .navmode button, .shiftsel button {
    font-size: 10px;
    padding: 5px 8px;
    gap: 3px;
    letter-spacing: .3px;
  }
  
  /* ---- Input Mode: Ultra compact ---- */
  .inputmode {
    gap: 0;
    padding: 1px;
  }
  .inputmode button {
    padding: 4px 7px;
    font-size: 10px;
    border-radius: 5px;
  }
  
  /* ---- Help Button ---- */
  .help-btn {
    padding: 5px 8px;
    font-size: 10px;
  }
  
  /* ---- View Toggle: Vertical pada mobile mini ---- */
  .view-toggle {
    width: 100%;
    flex-direction: column;
    margin-top: 8px;
  }
  .view-toggle button {
    width: 100%;
    padding: 6px 8px;
    font-size: 10px;
  }
  
  /* ---- Preset Column Buttons: Stacked ---- */
  .col-preset-bar {
    gap: 4px;
    margin-bottom: 6px;
    flex-direction: column;
  }
  .col-preset-btn {
    width: 100%;
    padding: 5px 8px;
    font-size: 10px;
    gap: 3px;
    justify-content: center;
  }
  
  /* ---- Column Toggle: Lebih ringkas ---- */
  .col-toggle-head {
    width: 100%;
    padding: 5px 8px;
    font-size: 10px;
    gap: 3px;
    letter-spacing: .5px;
  }
  
  /* ---- Column Toggle Bar: Horizontal scroll friendly ---- */
  .col-toggle-bar {
    gap: 4px;
    padding: 4px 8px;
    overflow-x: auto;
    white-space: nowrap;
  }
  .col-toggle-bar label {
    font-size: 10px;
    padding: 2px 5px;
    gap: 2px;
    flex-shrink: 0;
  }
  
  /* ---- Legend: Hemat sekali ---- */
  .legend {
    gap: 4px;
    margin-bottom: 8px;
  }
  .lg {
    font-size: 10px;
    padding: 3px 8px;
    gap: 4px;
  }
  .sw {
    width: 7px;
    height: 7px;
  }
  
  /* ---- Buttons: Lebih kecil ---- */
  .btn {
    padding: 7px 12px;
    font-size: 12px;
    gap: 5px;
  }
  
  /* ---- Section Padding ---- */
  .sec {
    padding: 12px 12px;
  }
  .sec + .sec {
    border-top: 1px dashed var(--line);
  }
  
  /* ---- Section Header ---- */
  .sec-h {
    gap: 6px;
    margin-bottom: 8px;
  }
  .sec-h .no {
    font-size: 13px;
    padding: 2px 6px;
    letter-spacing: .5px;
  }
  .sec-h h2 {
    font-size: 16px;
    letter-spacing: .8px;
  }
  .sec-h .sub2 {
    font-size: 10px;
    margin-top: 1px;
  }
  
  /* ---- Filter Grid: Single column ---- */
  .filter-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  /* ---- Operator Grid: Single column ---- */
  .operator-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  /* ---- Product Grid: Single column ---- */
  .product-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  /* ---- Split Input ---- */
  .split-input {
    gap: 4px;
  }
  .split-input-3 {
    flex-wrap: wrap;
    gap: 4px;
  }
  .split-input-3 input:first-child {
    flex: 1 1 100%;
  }
  .split-input-3 input:nth-child(2),
  .split-input-3 input:last-child {
    flex: 1 1 calc(50% - 2px);
  }
  
  /* ---- Edit Info / Sync Chip ---- */
  .edit-info {
    font-size: 9px;
    padding: 3px 8px;
    gap: 3px;
  }
  .sync-dot {
    width: 5px;
    height: 5px;
  }
  
  /* ---- Form Fields ---- */
  .field {
    margin-bottom: 10px;
  }
  .field label {
    font-size: 10px;
    margin-bottom: 3px;
    letter-spacing: .5px;
  }
  .field input, .field select {
    padding: 9px 10px;
    font-size: 13px;
  }
  
  /* ---- Shift Selector dalam Field ---- */
  .field .shiftsel {
    padding: 2px;
  }
  .field .shiftsel button {
    padding: 6px 2px;
    font-size: 10px;
  }

  /* ---- Sheet ---- */
  .sheet {
    margin: 10px 8px 35px;
    border-radius: 8px;
    border-width: 0.5px;
  }
  
  /* ---- Header Wrap ---- */
  .hwrap {
    padding: 10px 12px;
    gap: 8px;
  }
  .brand {
    gap: 8px;
  }
  .mark {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
  .kicker {
    font-size: 9px;
    letter-spacing: 2px;
    margin-bottom: 2px;
  }
  h1 {
    font-size: clamp(16px, 3vw, 22px);
    letter-spacing: .5px;
  }
  .sub {
    font-size: 11px;
    margin-top: 2px;
  }
  .hud {
    gap: 8px;
  }
  .clock {
    font-size: 18px;
    letter-spacing: .6px;
  }
  .date {
    font-size: 9px;
  }
  .led {
    font-size: 9px;
    padding: 4px 8px;
    gap: 5px;
    letter-spacing: 1px;
  }
  .led i {
    width: 6px;
    height: 6px;
  }
  
  /* ---- Screen Navigation: Tight layout ---- */
  .screen-nav {
    flex: 1 1 100%;
    justify-content: space-around;
    gap: 0;
  }
  .screen-tab {
    flex: 1 1 auto;
    justify-content: center;
    padding: 6px 1px;
    font-size: 8.5px;
    white-space: nowrap;
  }
  
  /* ---- KBD (keyboard hint) ---- */
  kbd {
    font-size: 10px;
    padding: 0 4px;
  }
  
  /* ---- Hint text ---- */
  .hint {
    font-size: 10px;
  }
  #lastSaved {
    font-size: 10px;
  }
  
  /* ---- Help Panel: Compact ---- */
  .help-panel {
    padding: 8px !important;
  }
  .help-panel p {
    font-size: 10px;
    line-height: 1.4;
    margin-bottom: 6px;
  }
}

/* ---------- Stack OPE + OEE 365 di atas log sheet ---------- */
.sheet-kpi-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 8px;
}
.sheet-kpi-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}
.sheet-kpi-row-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 0 8px;
  border-radius: 8px;
  font: 700 11px var(--font-sans, 'IBM Plex Sans', sans-serif);
  letter-spacing: .4px;
  color: var(--text-secondary, #475569);
  background: var(--bg-surface-hover, #f1f5f9);
  border: 1px solid var(--border-default, #e2e8f0);
  flex: none;
}
.sheet-kpi-row-365 .sheet-kpi-row-label {
  color: #0b5fa5;
  background: rgba(11, 95, 165, 0.08);
  border-color: rgba(11, 95, 165, 0.25);
}
[data-theme="dark"] .sheet-kpi-row-label {
  background: var(--bg-surface-hover, #1c1c1f);
  color: var(--text-secondary, #aeaeb2);
  border-color: var(--border-default, rgba(255,255,255,.08));
}
[data-theme="dark"] .sheet-kpi-row-365 .sheet-kpi-row-label {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.28);
}
.sheet-kpi-row-365 .sheet-kpi {
  /* sedikit lebih ringkas supaya dua baris tidak memakan terlalu banyak ruang */
  min-height: 0;
}
@media (max-width: 640px) {
  .sheet-kpi-row-label {
    width: 100%;
    min-height: 24px;
    justify-content: flex-start;
  }
}

/* ============================================================
   KPI OPE + 365 — full width desktop (isi space kosong)
   ============================================================ */
.sheet-kpi-stack {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 10px;
}

.sheet-kpi-stack .sheet-kpi-row {
  display: grid !important;
  grid-template-columns: 48px repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100%;
  align-items: stretch;
  margin: 0;
  padding: 0;
  border-top: none;
  flex-wrap: nowrap;
}

.sheet-kpi-stack .sheet-kpi-row-label {
  min-width: 0;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .5px;
  border-radius: 10px;
  padding: 0 6px;
}

.sheet-kpi-stack .sheet-kpi {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}

.sheet-kpi-stack .sheet-kpi span {
  font-size: 12px;
  font-weight: 800;
}

.sheet-kpi-stack .sheet-kpi b {
  font-size: 15px !important;
  font-weight: 800;
}

/* Warna label A/P/Q/OEE via data-kpi (bukan nth-child — child 1 = label) */
.sheet-kpi-stack .sheet-kpi[data-kpi="A"],
.sheet-kpi-stack .sheet-kpi[data-kpi="A365"] { --kpi-color: #16a34a; }
.sheet-kpi-stack .sheet-kpi[data-kpi="P"],
.sheet-kpi-stack .sheet-kpi[data-kpi="P365"] { --kpi-color: #2563eb; }
.sheet-kpi-stack .sheet-kpi[data-kpi="Q"],
.sheet-kpi-stack .sheet-kpi[data-kpi="Q365"] { --kpi-color: #7c3aed; }
.sheet-kpi-stack .sheet-kpi[data-kpi="OEE"],
.sheet-kpi-stack .sheet-kpi[data-kpi="OEE365"],
.sheet-kpi-stack .sheet-kpi-oee { --kpi-color: #ea580c; }

@media (min-width: 1200px) {
  .sheet-kpi-stack .sheet-kpi {
    min-height: 46px;
    padding: 10px 18px;
  }
  .sheet-kpi-stack .sheet-kpi b {
    font-size: 17px !important;
  }
  .sheet-kpi-stack .sheet-kpi span {
    font-size: 13px;
  }
  .sheet-kpi-stack .sheet-kpi-row {
    gap: 12px !important;
    grid-template-columns: 56px repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  /* Tetap horizontal (label + A + P + Q + OEE sebaris) — jangan wrap jadi 2 kolom.
     Elemen diperkecil supaya tetap muat & rapi di layar ponsel. */
  .sheet-kpi-stack .sheet-kpi-row {
    grid-template-columns: 30px repeat(4, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }
  .sheet-kpi-stack .sheet-kpi-row-label {
    font-size: 10px;
  }
  .sheet-kpi-stack .sheet-kpi {
    min-height: 32px;
    padding: 4px 2px;
    gap: 2px;
    flex-direction: column;
    line-height: 1.1;
  }
  .sheet-kpi-stack .sheet-kpi span {
    font-size: 9px;
  }
  .sheet-kpi-stack .sheet-kpi b {
    font-size: 11px !important;
  }
}

@media (max-width: 380px) {
  /* Ponsel sangat sempit: susut lagi, tetap 5 kolom sebaris (flexible). */
  .sheet-kpi-stack .sheet-kpi-row {
    grid-template-columns: 24px repeat(4, minmax(0, 1fr)) !important;
    gap: 3px !important;
  }
  .sheet-kpi-stack .sheet-kpi {
    padding: 3px 1px;
    min-height: 28px;
  }
  .sheet-kpi-stack .sheet-kpi span {
    font-size: 8px;
  }
  .sheet-kpi-stack .sheet-kpi b {
    font-size: 10px !important;
  }
}

/* Selalu tampilkan 3 slot produk (Produk 1 + 2 cadangan). Tidak lagi disembunyikan. */
#masterProductGrid > div.field:nth-child(2),
#masterProductGrid > div.field:nth-child(3) {
  display: block;
}

/* Kelas show-prod tetap didukung untuk kompatibilitas, tapi tidak wajib */
#masterProductGrid > div.field.show-prod {
  display: block !important;
}