/* =====================================================================
   BRAND-THEME.CSS — Override Warna Antarmuka Utama & Layout
   Memastikan palet baru (Biru Terang, Biru Dongker, Lime) diterapkan
   dan layout fitur khusus (seperti Hide Topbar) berjalan semestinya.
   ===================================================================== */

/* Shift 1 (data-sheet-shift="0") — Ungu */
.compact-shift-option[data-sheet-shift="0"],
.compact-shift-option[data-sheet-shift="0"].on,
.compact-shift-option[data-sheet-shift="0"].is-active {
  background-color: #7e22ce !important;
  border-color: #6b21a8 !important;
  color: #fff !important;
  box-shadow: 0 1px 3px rgba(126, 34, 206, 0.35) !important;
}

/* Shift 2 (data-sheet-shift="1") — Oranye */
.compact-shift-option[data-sheet-shift="1"],
.compact-shift-option[data-sheet-shift="1"].on,
.compact-shift-option[data-sheet-shift="1"].is-active {
  background-color: #ea580c !important;
  border-color: #c2410c !important;
  color: #fff !important;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.35) !important;
}

/* Shift 3 (data-sheet-shift="2") — Kuning */
.compact-shift-option[data-sheet-shift="2"],
.compact-shift-option[data-sheet-shift="2"].on,
.compact-shift-option[data-sheet-shift="2"].is-active {
  background-color: #eab308 !important;
  border-color: #ca8a04 !important;
  color: #1e293b !important;
  box-shadow: 0 1px 3px rgba(234, 179, 8, 0.35) !important;
}

/* =========================================================
   EFEK TIMBUL (3D) MULTI-WARNA UNTUK TOMBOL TAB ISSUE
   ========================================================= */

/* 1. Tombol OPEN (Warna Orange Timbul) */
.issue-tab[data-issue-tab="open"].is-on {
  background: linear-gradient(145deg, #f97316, #ea580c) !important; 
  color: #ffffff !important;
  border-color: #fb923c !important;
  box-shadow: 
    0 4px 6px -1px rgba(234, 88, 12, 0.4),
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  transform: translateY(-2px);
}

/* 2. Tombol CLOSED (Warna Hijau Timbul) */
.issue-tab[data-issue-tab="closed"].is-on {
  background: linear-gradient(145deg, #22c55e, #16a34a) !important; 
  color: #ffffff !important;
  border-color: #4ade80 !important;
  box-shadow: 
    0 4px 6px -1px rgba(22, 163, 74, 0.4),
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  transform: translateY(-2px);
}

/* 3. Tombol SEMUA (Warna Biru Timbul / Sesuai gaya saat ini) */
.issue-tab[data-issue-tab="all"].is-on {
  background: linear-gradient(145deg, #3b82f6, #2563eb) !important; 
  color: #ffffff !important;
  border-color: #60a5fa !important;
  box-shadow: 
    0 4px 6px -1px rgba(37, 99, 235, 0.4),
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  transform: translateY(-2px);
}

/* 4. Mempercantik Badge Angka di Dalam Tombol Saat Aktif */
.issue-tab.is-on .wn-badge {
  background: rgba(255, 255, 255, 0.25) !important; /* Badge jadi transparan putih */
  color: #ffffff !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); /* Efek cekung pada badge */
}

/* 5. Efek Saat Ditekan (Amblas) Berlaku untuk Semua Tombol */
.issue-tab.is-on:active {
  transform: translateY(1px) !important; /* Tombol turun ke bawah */
  box-shadow: 
    inset 0 3px 5px rgba(0, 0, 0, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* 3. Interaksi Input & Fokus */
input:focus, 
select:focus, 
textarea:focus,
.sheet-op-box:focus {
  border-color: var(--brand-600) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-600) 20%, transparent) !important;
}

.sheet-op-box.filled {
  background-color: var(--success-bg) !important;
  border-color: var(--success-600) !important;
  color: var(--success-600) !important;
}

/* 4. Tombol Utama */
.btn-primary,
#btnAdd,
#fpSave,
#ffSave {
  background-color: var(--brand-700) !important;
  border-color: var(--brand-700) !important;
  color: #fff !important;
}

.btn-primary:hover,
#btnAdd:hover,
#fpSave:hover,
#ffSave:hover {
  background-color: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
}

/* 5. Lencana Status & OEE Pills */
.ope-pill.a,
.ope-pill.p,
.ope-pill.q,
.cloud-status {
  background-color: var(--success-bg) !important; 
  color: var(--success-600) !important;
  border-color: color-mix(in srgb, var(--success-600) 40%, transparent) !important;
}

.cloud-status::before {
  background-color: var(--success-600) !important;
}

/* 6. HIDE TOPBAR KONTROL */
body.topbar-hidden .app-bar-badges,
body.topbar-hidden .app-bar-profile {
  display: none !important;
}

body.topbar-hidden .toolbar.app-bar {
  min-height: 52px !important;
  height: 52px !important;
  background: transparent !important;
  border-bottom: none !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

body.topbar-hidden .app-bar-menu-btn {
  pointer-events: auto !important;
}

.btn-hide-header {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: none; 
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}
.btn-hide-header:hover {
  background: var(--slate-100);
  color: var(--text-primary);
}
body.screen-weekly .btn-hide-header {
  display: grid !important;
}

.btn-show-header {
  position: fixed !important;
  top: 12px !important;
  right: 16px !important;
  z-index: 9999 !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text-primary) !important;
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  display: grid !important;
  place-items: center !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
  pointer-events: auto !important;
}

.btn-show-header[hidden] {
  display: none !important;
}

.btn-show-header:hover {
  background: var(--brand-50) !important;
  color: var(--brand-700) !important;
  border-color: var(--brand-600) !important;
}

/* 7. FULLSCREEN WEEKLY MEETING (DASHBOARD) */
body.screen-weekly .sheet {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
}

body.screen-weekly .weekly-layout {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  min-height: calc(100vh - 52px); 
}

/* 8. MODE IKON UNTUK SIDEBAR WEEKLY MEETING */
.weekly-layout.is-side-icons {
  grid-template-columns: 72px 1fr !important;
}

.weekly-layout.is-side-icons .weekly-sidebar {
  overflow: hidden;
  padding-inline: 4px;
}

.weekly-layout.is-side-icons .weekly-sidebar-brand {
  justify-content: center;
  padding-inline: 8px;
}

.weekly-layout.is-side-icons .weekly-sidebar-brand > div,
.weekly-layout.is-side-icons .weekly-nav-divider,
.weekly-layout.is-side-icons .wn-label,
.weekly-layout.is-side-icons .weekly-sidebar-foot {
  display: none !important;
}

.weekly-layout.is-side-icons .weekly-nav {
  padding-inline: 6px;
}

.weekly-layout.is-side-icons .weekly-nav-item {
  justify-content: center;
  padding-inline: 4px;
}

.weekly-layout.is-side-icons .wn-icon {
  width: auto;
}

.weekly-side-toggle {
  position: absolute;
  z-index: 40;
  top: 16px;
  left: 248px; 
  width: 24px;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.weekly-side-toggle:hover {
  background: var(--brand-600);
  color: #fff;
  border-color: var(--brand-600);
}

.weekly-layout.is-side-icons .weekly-side-toggle {
  left: 60px; 
}

@media (max-width: 960px) {
  .weekly-side-toggle {
    display: none !important;
  }
}

/* =====================================================================
   9. STICKY SIDEBAR WEEKLY MEETING (Tambahan Baru)
   Mempertahankan sidebar tetap di posisinya saat di-scroll (Desktop)
   ===================================================================== */
@media (min-width: 961px) {
  body.screen-weekly .weekly-layout {
    overflow: visible !important;
  }
  body.screen-weekly .weekly-sidebar {
    position: sticky !important;
    top: 52px; /* Disesuaikan dengan tinggi topbar */
    align-self: start;
    height: calc(100vh - 52px);
    overflow: hidden;
    z-index: 25;
  }
}

/* =====================================================================
   10. SIDEBAR WEEKLY MEETING TERSEMBUNYI (Ctrl+B) → dashboard layar penuh
   Hanya desktop; di layar sempit sidebar sudah satu kolom.
   ===================================================================== */
@media (min-width: 961px) {
  .weekly-layout.is-side-hidden {
    grid-template-columns: 0 minmax(0, 1fr) !important;
  }
  .weekly-layout.is-side-hidden .weekly-sidebar {
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .weekly-layout.is-side-hidden .weekly-sidebar-resizer { display: none !important; }
  /* Tombol tetap ada (kecil, di pojok kiri) supaya sidebar bisa dimunculkan lagi. */
  .weekly-layout.is-side-hidden .weekly-side-toggle {
    left: 6px;
    top: 8px;
    opacity: 0.55;
  }
  .weekly-layout.is-side-hidden .weekly-side-toggle:hover,
  .weekly-layout.is-side-hidden .weekly-side-toggle:focus-visible { opacity: 1; }
}
@media print {
  .weekly-layout.is-side-hidden .weekly-side-toggle { display: none !important; }
}
