/* ==========================================================================
   PM MESIN KOMACK DASHBOARD — STYLESHEET (DESKTOP LEFT SIDEBAR + ANIMATED CHARTS)
   ========================================================================== */

:root {
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;

  --brand-primary: #1d4ed8;
  --brand-primary-hover: #1e40af;
  --brand-soft: #eff6ff;
  --brand-border: #bfdbfe;

  --status-done-bg: #dcfce7;
  --status-done-text: #15803d;
  --status-done-bar: #22c55e;

  --status-open-bg: #fef3c7;
  --status-open-text: #b45309;
  --status-open-bar: #f59e0b;

  --status-delay-bg: #fee2e2;
  --status-delay-text: #b91c1c;
  --status-delay-bar: #ef4444;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.16);
}

[data-theme="dark"] {
  --bg-page: #0b1120;
  --bg-card: #111827;
  --bg-subtle: #1e293b;
  --bg-hover: #263349;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --border-strong: #334155;

  --brand-primary: #3b82f6;
  --brand-primary-hover: #60a5fa;
  --brand-soft: rgba(59, 130, 246, 0.16);
  --brand-border: rgba(59, 130, 246, 0.35);

  --status-done-bg: rgba(34, 197, 94, 0.18);
  --status-done-text: #4ade80;
  --status-done-bar: #22c55e;

  --status-open-bg: rgba(245, 158, 11, 0.18);
  --status-open-text: #fbbf24;
  --status-open-bar: #f59e0b;

  --status-delay-bg: rgba(239, 68, 68, 0.18);
  --status-delay-text: #f87171;
  --status-delay-bar: #ef4444;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 44px rgba(0, 0, 0, 0.6);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ==================== BUTTONS & INPUTS ==================== */
button, input, select, textarea {
  font-family: inherit;
  font-size: 0.875rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--brand-primary);
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0.52rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--brand-primary);
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--bg-card);
  color: var(--status-delay-text);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  padding: 0.52rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease;
}

.btn-danger-outline:hover {
  background: var(--status-delay-bg);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 0.72rem 1.15rem;
  font-size: 0.95rem;
}

/* ==================== LOGIN SCREEN ==================== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.11), transparent 42%),
    radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.09), transparent 42%),
    var(--bg-page);
}

.login-topbar {
  width: 100%;
  max-width: 1120px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
}

.login-card {
  width: 100%;
  max-width: 410px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo-circle {
  width: 54px;
  height: 54px;
  margin: 0 auto 0.85rem;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand-primary);
  border: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-header h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.login-header p {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.login-form .form-group {
  margin-bottom: 1rem;
}

.login-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.38rem;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  padding: 0.68rem 2.4rem 0.68rem 2.55rem;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--bg-subtle);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input-with-icon input:focus {
  border-color: var(--brand-primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.pwd-eye-btn {
  position: absolute;
  right: 0.65rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.25rem;
}

.alert-error {
  background: var(--status-delay-bg);
  color: var(--status-delay-text);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  padding: 0.62rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.login-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==================== TOP STICKY HEADER ==================== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 45;
  height: 58px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  box-shadow: var(--shadow-xs);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
  min-width: 0;
}

.logo-text strong {
  font-size: 0.94rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-text small {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.role-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.role-admin {
  background: var(--brand-soft);
  color: var(--brand-primary);
  border: 1px solid var(--brand-border);
}

.role-viewer {
  background: var(--status-open-bg);
  color: var(--status-open-text);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.view-switcher {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 2px;
}

.view-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.28rem 0.6rem;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.view-opt.active {
  background: var(--bg-card);
  color: var(--brand-primary);
  box-shadow: var(--shadow-xs);
}

.btn-icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 0.34rem 0.68rem;
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-icon-pill:hover {
  background: var(--bg-hover);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  background: var(--status-delay-bg);
  color: var(--status-delay-text);
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 9px;
  padding: 0.34rem 0.68rem;
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-logout:hover {
  opacity: 0.88;
}

/* ==================== DESKTOP LEFT SIDEBAR + BODY SHELL ==================== */
.app-body-layout {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.15rem 1.35rem 2.5rem;
  align-items: start;
}

.desktop-sidebar {
  position: sticky;
  top: 74px;
  min-height: calc(100vh - 94px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0.95rem 0.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 0.6rem 0.55rem;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.sidebar-nav-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.72rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.sidebar-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-primary);
  border-color: var(--brand-border);
  font-weight: 700;
}

.sidebar-nav-item.active::before {
  content: "";
  position: absolute;
  left: -0.75rem;
  top: 22%;
  bottom: 22%;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-primary);
}

.snav-left {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.snav-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.snav-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.sidebar-nav-item.active .snav-badge {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: transparent;
}

.snav-badge-green {
  background: var(--status-done-bg);
  color: var(--status-done-text);
  border-color: transparent;
}

.sidebar-bottom-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 13px;
  padding: 0.85rem;
}

.sidebar-next-label {
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--brand-primary);
  margin-bottom: 0.25rem;
}

.sidebar-next-week {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary);
}

.sidebar-next-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  margin-bottom: 0.65rem;
}

.btn-sidebar-quick {
  width: 100%;
  background: var(--bg-card);
  color: var(--brand-primary);
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-sidebar-quick:hover {
  background: var(--brand-primary);
  color: #ffffff;
}

/* ==================== MAIN WORKSPACE AREA ==================== */
.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.95rem 1.05rem;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0.22rem 0 0.15rem;
}

.kpi-done .kpi-value { color: var(--status-done-text); }
.kpi-open .kpi-value { color: var(--status-open-text); }
.kpi-delay .kpi-value { color: var(--status-delay-text); }
.kpi-compliance .kpi-value { color: var(--brand-primary); }

.kpi-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.progress-track {
  width: 100%;
  height: 7px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.42rem;
  border: 1px solid var(--border-color);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #10b981);
  border-radius: 999px;
  transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Tab Panels */
.tab-panel {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.tab-panel.active {
  display: flex;
}

/* Spotlight Banner */
.spotlight-card {
  background: linear-gradient(135deg, var(--brand-soft) 0%, var(--bg-card) 75%);
  border: 1px solid var(--brand-border);
  border-radius: 15px;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
}

.spotlight-tag {
  display: inline-block;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--brand-primary);
  background: var(--bg-card);
  border: 1px solid var(--brand-border);
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.35rem;
}

.spotlight-info h2 {
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.spotlight-info p {
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.spotlight-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Filter Panel */
.filter-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.95rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-xs);
}

.filter-top-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.search-box {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 0.82rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.56rem 0.85rem 0.56rem 2.4rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-subtle);
  color: var(--text-primary);
  outline: none;
}

.search-box input:focus {
  border-color: var(--brand-primary);
  background: var(--bg-card);
}

.compact-search {
  max-width: 300px;
}

.compact-search input {
  padding-left: 0.85rem;
}

.btn-filter-toggle {
  display: none;
  white-space: nowrap;
}

.filter-selects {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
}

.filter-selects select,
.matrix-controls select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 0.81rem;
  font-weight: 600;
  outline: none;
}

.filter-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.81rem;
  color: var(--text-muted);
}

.quick-status-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.pill-filter {
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.24rem 0.72rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-filter.active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

/* ==================== EXECUTION CARDS (MOBILE) & TABLE (DESKTOP) ==================== */
.exec-cards-grid {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.pm-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--status-open-bar);
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: var(--shadow-xs);
}

.pm-card.is-done {
  border-left-color: var(--status-done-bar);
}

.pm-card.is-delay {
  border-left-color: var(--status-delay-bar);
}

.pm-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.pm-week-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.badge-week {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand-primary);
  border: 1px solid var(--brand-border);
  font-weight: 800;
  font-size: 0.74rem;
  padding: 0.15rem 0.5rem;
  border-radius: 7px;
}

.period-text {
  font-size: 0.77rem;
  color: var(--text-muted);
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.56rem;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.status-done {
  background: var(--status-done-bg);
  color: var(--status-done-text);
}

.status-open {
  background: var(--status-open-bg);
  color: var(--status-open-text);
}

.status-delay {
  background: var(--status-delay-bg);
  color: var(--status-delay-text);
}

.pm-machine-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.ms-number-box {
  min-width: 54px;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  text-align: center;
}

.ms-number-box small {
  display: block;
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-muted);
}

.ms-number-box strong {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-primary);
}

.ms-details h3 {
  font-size: 0.92rem;
  font-weight: 700;
}

.ms-details p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pm-note-box {
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.pm-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.6rem;
}

.pic-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-action-btns {
  display: flex;
  gap: 0.4rem;
}

.btn-quick-done {
  background: var(--status-done-bg);
  color: var(--status-done-text);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 9px;
  padding: 0.42rem 0.7rem;
  font-size: 0.77rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

.btn-quick-done:hover {
  background: #22c55e;
  color: #ffffff;
}

/* Desktop Data Table */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  text-align: left;
  padding: 0.68rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.compact-table th,
.compact-table td {
  padding: 0.52rem 0.7rem;
  font-size: 0.79rem;
}

.clickable-row {
  cursor: pointer;
  transition: background 0.14s ease;
}

.table-action-group {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

/* ==================== TAB 2: CAPAIAN & ANIMATED CHARTS ==================== */
.section-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.section-header-bar h2 {
  font-size: 1.18rem;
  font-weight: 800;
}

.section-header-bar p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.export-actions,
.matrix-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* Entrance Keyframes for Chart Cards & Elements */
@keyframes chartCardReveal {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes legendFadeSlide {
  0% {
    opacity: 0;
    transform: translateX(12px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmerSweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(200%);
  }
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.chart-card:hover {
  box-shadow: var(--shadow-sm);
}

.chart-card.animate-enter {
  opacity: 0;
  animation: chartCardReveal 0.62s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--card-idx, 0) * 95ms);
}

.chart-card h3 {
  font-size: 0.98rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.chart-sub-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.chart-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.95rem;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.dot-plan { background: #3b82f6; }
.dot-done { background: #22c55e; }
.dot-delay { background: #ef4444; }

/* Donut Chart & Animated SVG Segments */
.donut-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding-top: 0.65rem;
  flex-wrap: wrap;
}

.donut-svg {
  overflow: visible;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.08));
}

.donut-arc {
  transition:
    stroke-dasharray 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    stroke-dashoffset 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    stroke-width 0.2s ease;
  cursor: pointer;
}

.donut-arc:hover {
  stroke-width: 21;
}

.donut-legend-list {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
  font-size: 0.85rem;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  opacity: 0;
  animation: legendFadeSlide 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--leg-idx, 0) * 110ms + 180ms);
}

/* Category Breakdown Bars */
.category-bars {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding-top: 0.65rem;
}

.cat-item-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  font-weight: 700;
  margin-bottom: 0.32rem;
}

.animated-progress-fill {
  position: relative;
  overflow: hidden;
  transition: width 0.95s cubic-bezier(0.22, 1, 0.36, 1);
}

.animated-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shimmerSweep 1.3s ease-out 0.35s 1;
}

/* Monthly Vertical Column Chart (Okt 2026 - Des 2027) */
.monthly-chart-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.monthly-bars-stage {
  min-width: 760px;
  height: 210px;
  display: grid;
  grid-template-columns: repeat(15, minmax(46px, 1fr));
  gap: 0.45rem;
  align-items: end;
  padding: 1.25rem 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border-strong);
  background: linear-gradient(to top, var(--bg-subtle) 0%, transparent 100%);
  border-radius: 10px 10px 0 0;
}

.month-col-group {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  cursor: pointer;
  padding: 0.25rem 0.15rem 0;
  border-radius: 8px;
  transition: background 0.16s ease, transform 0.16s ease;
}

.month-col-group:hover {
  background: var(--brand-soft);
  transform: translateY(-2px);
}

.month-bars-pair {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 0 3px;
}

.mbar-col {
  width: 12px;
  min-height: 3px;
  border-radius: 5px 5px 0 0;
  transition: height 0.88s cubic-bezier(0.22, 1, 0.36, 1), filter 0.16s ease;
}

.month-col-group:hover .mbar-col {
  filter: brightness(1.08);
}

.mbar-plan { background: #3b82f6; }
.mbar-done { background: #22c55e; }
.mbar-delay { background: #ef4444; }

.month-col-val {
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 0.22rem;
}

.month-col-label {
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.42rem;
  text-align: center;
  line-height: 1.15;
}

.monthly-table-wrap {
  margin-top: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

/* 16-Group Horizontal Bar Chart */
.group-bars-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
}

.group-bar-row {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr) 74px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 9px;
  font-size: 0.81rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.group-bar-row:hover {
  background: var(--bg-hover);
}

.bar-tracks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 5px 6px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.bar-line {
  height: 8px;
  border-radius: 999px;
  transition: width 0.88s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-plan { background: #3b82f6; }
.bar-done { background: #22c55e; }

/* ==================== TAB 3: MATRIX 65 WEEK ==================== */
.matrix-legend-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.65rem 1rem;
}

.m-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.72rem;
}

.m-plan { background: var(--status-open-bg); color: var(--status-open-text); }
.m-done { background: var(--status-done-bg); color: var(--status-done-text); }
.m-delay { background: var(--status-delay-bg); color: var(--status-delay-text); }

.matrix-scroll-container {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-xs);
}

.matrix-table {
  border-collapse: collapse;
  font-size: 0.75rem;
  width: max-content;
}

.matrix-table th,
.matrix-table td {
  border: 1px solid var(--border-color);
  padding: 0.38rem 0.45rem;
  text-align: center;
  white-space: nowrap;
}

.matrix-table th {
  background: var(--bg-subtle);
  font-weight: 700;
}

.sticky-col-1 {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--bg-card);
  font-weight: 800;
  min-width: 56px;
}

.sticky-col-2 {
  position: sticky;
  left: 56px;
  z-index: 3;
  background: var(--bg-card);
  font-weight: 700;
  min-width: 46px;
}

.matrix-table thead .sticky-col-1,
.matrix-table thead .sticky-col-2 {
  background: var(--bg-subtle);
  z-index: 4;
}

.matrix-cell-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.72rem;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.matrix-cell-btn:hover {
  transform: scale(1.16);
}

/* ==================== TAB 4: MASTER 46 MESIN ==================== */
.machine-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 0.85rem;
}

.machine-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.95rem;
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.machine-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.meta-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* ==================== MOBILE STICKY BOTTOM NAV ==================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  height: 62px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  grid-template-columns: repeat(5, 1fr);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
}

.bnav-item {
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  cursor: pointer;
  font-weight: 700;
  transition: color 0.15s ease;
}

.bnav-item.active {
  color: var(--brand-primary);
}

.bnav-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.bnav-text {
  font-size: 0.68rem;
}

/* ==================== MODAL & TOAST ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-dialog {
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title-wrap h3 {
  font-size: 1.12rem;
  font-weight: 800;
  margin-top: 0.3rem;
}

.btn-close-x {
  background: none;
  border: none;
  font-size: 1.55rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.modal-machine-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.8rem;
  font-size: 0.8rem;
}

.viewer-notice {
  background: var(--status-open-bg);
  color: var(--status-open-text);
  padding: 0.62rem 0.85rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

#pm-exec-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.form-group label {
  display: block;
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.32rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.56rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--bg-subtle);
  color: var(--text-primary);
  outline: none;
}

.checklist-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 11px;
  padding: 0.72rem;
}

.chk-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.81rem;
  cursor: pointer;
}

.chk-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding-top: 0.45rem;
}

.toast {
  position: fixed;
  bottom: 4.6rem;
  right: 1.25rem;
  z-index: 70;
  background: #0f172a;
  color: #ffffff;
  padding: 0.68rem 1.05rem;
  border-radius: 11px;
  font-size: 0.83rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

/* ==================== EXPLICIT DESKTOP vs MOBILE VIEW SWITCHING ==================== */
/* 1. Forced Desktop Mode (even on narrower windows) */
body.force-desktop .desktop-sidebar {
  display: flex !important;
}
body.force-desktop .mobile-bottom-nav {
  display: none !important;
}
body.force-desktop .exec-cards-grid {
  display: none !important;
}
body.force-desktop .desktop-only-block {
  display: block !important;
}

/* 2. Forced Mobile Mode (even on wide screens) */
body.force-mobile .app-body-layout {
  display: block !important;
  max-width: 640px;
  padding: 0.85rem 0.85rem 5.4rem;
}
body.force-mobile .desktop-sidebar {
  display: none !important;
}
body.force-mobile .mobile-bottom-nav {
  display: grid !important;
}
body.force-mobile .kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body.force-mobile .kpi-compliance {
  grid-column: span 2;
}
body.force-mobile .spotlight-card {
  flex-direction: column;
  align-items: flex-start;
}
body.force-mobile .btn-filter-toggle {
  display: inline-flex;
}
body.force-mobile .filter-selects.collapsed-on-mobile {
  display: none;
}
body.force-mobile .filter-selects {
  grid-template-columns: 1fr;
}
body.force-mobile .exec-cards-grid {
  display: flex !important;
}
body.force-mobile .desktop-only-block {
  display: none !important;
}
body.force-mobile .charts-grid {
  grid-template-columns: 1fr;
}
body.force-mobile .group-bar-row {
  grid-template-columns: 115px minmax(0, 1fr) 58px;
}

/* 3. Auto Responsive Breakpoint (when body.view-auto) */
@media (max-width: 959px) {
  body.view-auto .app-body-layout {
    display: block;
    padding: 0.85rem 0.85rem 5.4rem;
  }
  body.view-auto .desktop-sidebar {
    display: none;
  }
  body.view-auto .mobile-bottom-nav {
    display: grid;
  }
  body.view-auto .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.view-auto .kpi-compliance {
    grid-column: span 2;
  }
  body.view-auto .spotlight-card {
    flex-direction: column;
    align-items: flex-start;
  }
  body.view-auto .btn-filter-toggle {
    display: inline-flex;
  }
  body.view-auto .filter-selects.collapsed-on-mobile {
    display: none;
  }
  body.view-auto .filter-selects {
    grid-template-columns: 1fr;
  }
  body.view-auto .exec-cards-grid {
    display: flex;
  }
  body.view-auto .desktop-only-block {
    display: none;
  }
  body.view-auto .charts-grid {
    grid-template-columns: 1fr;
  }
  body.view-auto .group-bar-row {
    grid-template-columns: 115px minmax(0, 1fr) 58px;
  }
  .logo-text small,
  .view-label,
  .theme-label,
  .logout-label {
    display: none;
  }
}

#login-username,
#login-password {
  padding-left: 2.4rem;  /* ~42px, melewati ikon kiri */
  padding-right: 2.4rem;  /* ~40px, aman dari ikon mata di kanan */
}

/* Beri ruang di atas agar konten awal tidak tertutup header fixed */
.app-shell {
  padding-top: 74px;
}

/* ==================== TOP FLOATING PILL HEADER (TRANSLUCENT) ==================== */
.app-header {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  height: 56px;
  width: calc(100% - 1.5rem);
  max-width: 1496px;
  margin: 0;
  padding: 0 0.75rem 0 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;

  /* Bentuk Kapsul (Floating Pill) */
  border-radius: 999px;

  /* Efek Translucent (Frosted Glass) - Light Mode */
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Efek Translucent - Dark Mode */
[data-theme="dark"] .app-header {
  background: rgba(17, 24, 39, 0.72);
  border-color: rgba(51, 65, 85, 0.6);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
/* ==================== MOBILE FLOATING BOTTOM NAV + BOUNCE ==================== */
@keyframes navSpringBounce {
  0%   { transform: scale(0.84) translateY(2px); }
  45%  { transform: scale(1.06) translateY(-3px); }
  75%  { transform: scale(0.97) translateY(0); }
  100% { transform: scale(1) translateY(0); }
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 1.5rem);
  max-width: 480px;
  z-index: 45;
  height: 64px;
  padding: 4px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  grid-template-columns: repeat(5, 1fr);
  box-shadow: var(--shadow-lg);
}

.bnav-item {
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 0.18s ease,
    background-color 0.2s ease,
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Efek membal saat disentuh / diklik */
.bnav-item:active {
  transform: scale(0.86);
}

.bnav-item.active {
  color: var(--brand-primary);
  background: var(--brand-soft);
}

/* Efek membal halus pada ikon & teks saat tab aktif tanpa membesar berlebihan */
.bnav-item.active .bnav-icon,
.bnav-item.active .bnav-text {
  animation: navSpringBounce 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bnav-icon {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-block;
}

.bnav-text {
  font-size: 0.67rem;
  display: inline-block;
}

.snav-icon,
.bnav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.18s ease, background-color 0.2s ease, transform 0.25s ease;
}

.sidebar-nav-item:hover .snav-icon,
.sidebar-nav-item.active .snav-icon {
  color: var(--brand-primary);
}

.mobile-bottom-nav {
  border-radius: 999px;
  height: 66px;
  padding: 6px 10px;
}

.bnav-item {
  gap: 0.22rem;
  background: transparent !important;
}

.bnav-icon {
  width: 38px;
  height: 30px;
  border-radius: 999px;
}

.bnav-item.active .bnav-icon {
  background: var(--brand-soft);
  color: var(--brand-primary);
}

.bnav-item.active .bnav-text {
  color: var(--brand-primary);
}

/* ==================== COMPACT FLOATING HEADER ON SCROLL ==================== */
.app-header {
  transition:
    height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    max-width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.25s ease,
    box-shadow 0.25s ease;
}

.app-header .logo-mark,
.app-header .logo-text strong,
.app-header .logo-text small,
.app-header .role-badge,
.app-header .header-controls {
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Kondisi Ringkas Dasar Saat Di-scroll */
.app-header.is-scrolled {
  height: 44px;
  padding: 0 0.65rem;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.13);
}

[data-theme="dark"] .app-header.is-scrolled {
  background: rgba(17, 24, 39, 0.86);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.app-header.is-scrolled .logo-mark {
  width: 28px;
  height: 28px;
}

.app-header.is-scrolled .logo-mark svg {
  width: 15px;
  height: 15px;
}

.app-header.is-scrolled .logo-text strong {
  font-size: 0.84rem;
}

.app-header.is-scrolled .logo-text small {
  display: none;
}

.app-header.is-scrolled .role-badge {
  width: 24px;
  height: 24px;
}

/* ==================== MOBILE VIEW SAAT DI-SCROLL ==================== */
body.force-mobile .app-header.is-scrolled {
  width: calc(100% - 2.6rem);
  max-width: 410px;
}

body.force-mobile .app-header.is-scrolled .view-label,
body.force-mobile .app-header.is-scrolled .theme-label,
body.force-mobile .app-header.is-scrolled .logout-label {
  display: none;
}

@media (max-width: 959px) {
  body.view-auto .app-header.is-scrolled {
    width: calc(100% - 2.6rem);
    max-width: 410px;
  }
  body.view-auto .app-header.is-scrolled .view-label,
  body.view-auto .app-header.is-scrolled .theme-label,
  body.view-auto .app-header.is-scrolled .logout-label {
    display: none;
  }
}

/* ==================== DESKTOP VIEW: HANYA LOGO & JUDUL SAAT SCROLL ==================== */
body.force-desktop .app-header.is-scrolled {
  width: max-content;
  max-width: 340px;
  gap: 0;
  padding: 0 0.75rem 0 0.55rem;
}

body.force-desktop .app-header.is-scrolled .header-controls {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  margin-left: 0;
}

/* Membesar Kembali Saat Kursor Diarahkan (Hover) */
body.force-desktop .app-header.is-scrolled:hover {
  height: 56px;
  width: calc(100% - 1.5rem);
  max-width: 1496px;
  gap: 0.65rem;
  padding: 0 0.75rem 0 0.9rem;
}

body.force-desktop .app-header.is-scrolled:hover .header-controls {
  max-width: 600px;
  opacity: 1;
  overflow: visible;
  pointer-events: auto;
}

body.force-desktop .app-header.is-scrolled:hover .logo-mark {
  width: 32px;
  height: 32px;
}

body.force-desktop .app-header.is-scrolled:hover .logo-mark svg {
  width: 18px;
  height: 18px;
}

body.force-desktop .app-header.is-scrolled:hover .logo-text strong {
  font-size: 0.94rem;
}

body.force-desktop .app-header.is-scrolled:hover .logo-text small {
  display: block;
}

body.force-desktop .app-header.is-scrolled:hover .role-badge {
  width: 26px;
  height: 26px;
}

/* Berlaku juga saat layar >= 960px dalam mode view-auto */
@media (min-width: 960px) {
  body.view-auto .app-header.is-scrolled {
    width: max-content;
    max-width: 340px;
    gap: 0;
    padding: 0 0.75rem 0 0.55rem;
  }
  body.view-auto .app-header.is-scrolled .header-controls {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    margin-left: 0;
  }
  body.view-auto .app-header.is-scrolled:hover {
    height: 56px;
    width: calc(100% - 1.5rem);
    max-width: 1496px;
    gap: 0.65rem;
    padding: 0 0.75rem 0 0.9rem;
  }
  body.view-auto .app-header.is-scrolled:hover .header-controls {
    max-width: 600px;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
  }
  body.view-auto .app-header.is-scrolled:hover .logo-mark {
    width: 32px;
    height: 32px;
  }
  body.view-auto .app-header.is-scrolled:hover .logo-mark svg {
    width: 18px;
    height: 18px;
  }
  body.view-auto .app-header.is-scrolled:hover .logo-text strong {
    font-size: 0.94rem;
  }
  body.view-auto .app-header.is-scrolled:hover .logo-text small {
    display: block;
  }
  body.view-auto .app-header.is-scrolled:hover .role-badge {
    width: 26px;
    height: 26px;
  }
}