/* =====================================================================
   MAINTENANCE CONTROL · GLB / RSK - FIELD-TOOL CSS
   Designed for Mobile-First Field Operations (360px - 430px)
   ===================================================================== */

:root {
  --bg: #F3F1EA;
  --surface: #FFFFFF;
  --text: #17261E;
  --text-muted: #5C6B62;
  --border: #DAD6C9;
  --border-chip: #C9C4B4;
  --primary: #1E5B40;
  --primary-soft: #E1EEE6;

  /* Status Groups */
  --group-bap-bg: #DDEFE6;
  --group-bap-text: #0F4A2F;
  --group-bap-bar: #1E7A4F;

  --group-qc-bg: #E0E8F7;
  --group-qc-text: #1F3E80;
  --group-qc-bar: #3A63B8;

  --group-qa-bg: #EDE0F7;
  --group-qa-text: #4A1F80;
  --group-qa-bar: #7B3DB8;

  --group-spk-bg: #FBEBC8;
  --group-spk-text: #6B4300;
  --group-spk-bar: #C98A12;

  --group-nospk-bg: #F8DAD6;
  --group-nospk-text: #8A1C14;
  --group-nospk-bar: #C0392B;

  --group-skip-bg: #E6E4DD;
  --group-skip-text: #3F3F3A;
  --group-skip-bar: #8A877C;

  /* Window Pills */
  --win-overdue-bg: #17261E;
  --win-overdue-text: #FFFFFF;
  --win-hurry-bg: #8A1C14;
  --win-hurry-text: #FFFFFF;
  --win-due-bg: #FBEBC8;
  --win-due-text: #6B4300;
  --win-relax-bg: #ECE9DF;
  --win-relax-text: #3F3F3A;

  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius-card: 16px;
  --radius-chip: 22px;
  --radius-sheet: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-wrapper {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.04);
}

/* Offline Banner */
.offline-banner {
  background-color: #8A1C14;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  display: none;
}
.offline-banner.active {
  display: flex;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px 8px 16px;
}

.header-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.header-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #2ECC71;
}
.status-dot.offline {
  background-color: #E67E22;
}

.tab-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.cutoff-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: 10px;
}

/* Coordinator Chip Scroller */
.coord-scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.coord-scroller::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-chip);
  border: 1px solid var(--border-chip);
  background-color: var(--surface);
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.15s ease;
}
.chip:active {
  transform: scale(0.97);
}
.chip.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.chip-count {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 12px;
  background-color: rgba(0, 0, 0, 0.07);
}
.chip.active .chip-count {
  background-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* Content Area */
.tab-content {
  flex: 1;
  padding: 16px 16px calc(76px + var(--safe-bottom)) 16px;
  display: none;
}
.tab-content.active {
  display: block;
}

/* =====================================================================
   TAB 1: RINGKASAN
   ===================================================================== */
.hero-card {
  background-color: var(--primary);
  color: #FFFFFF;
  border-radius: var(--radius-card);
  padding: 18px 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(30, 91, 64, 0.15);
}

.hero-header {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2px;
}

.hero-main-stat {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 14px;
  font-family: var(--font-mono);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 12px;
}

.hero-sub-stat {
  display: flex;
  flex-direction: column;
}

.hero-sub-val {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #FFFFFF;
}

.hero-sub-lbl {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.2;
}

/* My Tasks Box */
.my-tasks-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-bottom: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 6px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.my-task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.my-task-item:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.my-task-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.my-task-petak {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.my-task-act {
  font-size: 13px;
  color: var(--text-muted);
}

/* Changes Card */
.changes-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-bottom: 16px;
}

.change-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.change-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.tag-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
  margin-top: 2px;
}
.tag-baru { background-color: #DDEFE6; color: #0F4A2F; }
.tag-keluar { background-color: #F8DAD6; color: #8A1C14; }
.tag-pindah { background-color: #E0E8F7; color: #1F3E80; }

.change-text {
  color: var(--text);
  line-height: 1.35;
}

/* Per Tahap Section */
.stages-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-bottom: 16px;
}

.stage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  min-height: 44px;
}
.stage-row:last-child {
  border-bottom: none;
}

.stage-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 4px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.stage-info {
  flex: 1;
  min-width: 0;
}

.stage-name-wrap {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.stage-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-left: 8px;
}

.progress-track {
  height: 5px;
  background-color: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Jendela Waktu Grid */
.window-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.window-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  cursor: pointer;
  min-height: 44px;
}
.window-card:active {
  background-color: var(--bg);
}

.window-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.window-val {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

/* =====================================================================
   TAB 2: PETAK
   ===================================================================== */
.search-bar {
  position: relative;
  margin-bottom: 10px;
}

.search-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-size: 14px;
  font-family: var(--font-sans);
  border: 1px solid var(--border-chip);
  border-radius: var(--radius-chip);
  background-color: var(--surface);
  color: var(--text);
  min-height: 44px;
  outline: none;
}
.search-input:focus {
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Phase Group Filter Scroller */
.filter-scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filter-scroller::-webkit-scrollbar {
  display: none;
}

/* Coordinator Advanced Filter Box */
.adv-filter-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px;
  margin-bottom: 12px;
}

.adv-filter-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
  margin-top: 8px;
}
.adv-filter-title:first-child {
  margin-top: 0;
}

.adv-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.adv-row::-webkit-scrollbar {
  display: none;
}

.adv-chip {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-chip);
  border: 1px solid var(--border);
  background-color: var(--bg);
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}
.adv-chip.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.btn-secondary {
  border: 1px solid var(--border-chip);
  background-color: var(--surface);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-chip);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-chip);
}
.filter-tag button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 2px;
  flex-wrap: wrap;
}

.sort-count {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-weight: 600;
  flex-shrink: 0;
}

.sort-bar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
  justify-content: flex-end;
}

.sort-bar::-webkit-scrollbar { display: none; }

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.sort-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.sort-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.sort-dir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.1s;
}

.sort-dir:hover {
  background: rgba(255,255,255,0.45);
}


/* Petak Card */
.petak-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease;
}
.petak-card:active {
  transform: scale(0.99);
  border-color: var(--primary);
}

.petak-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.petak-id-area {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.petak-id {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.petak-area-spec {
  font-size: 12px;
  color: var(--text-muted);
}

/* Window Pill */
.window-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.window-pill.OverDue { background-color: var(--win-overdue-bg); color: var(--win-overdue-text); }
.window-pill.Hurry { background-color: var(--win-hurry-bg); color: var(--win-hurry-text); }
.window-pill.Due { background-color: var(--win-due-bg); color: var(--win-due-text); }
.window-pill.Relax { background-color: var(--win-relax-bg); color: var(--win-relax-text); }

.petak-activity {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}

.petak-status-due {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.status-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.due-note {
  font-size: 12px;
  color: var(--text-muted);
}
.due-note.overdue {
  color: #8A1C14;
  font-weight: 600;
}

.card-divider {
  height: 1px;
  background-color: var(--border);
  margin-bottom: 8px;
}

.card-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}

.card-supervisor {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  background-color: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
}
.empty-state-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.empty-state-desc {
  font-size: 13px;
  margin-bottom: 14px;
}

/* =====================================================================
   TAB 3: PENGAWAS
   ===================================================================== */
.supervisor-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  min-height: 44px;
}
.supervisor-card:active {
  border-color: var(--primary);
  background-color: #FAFAF7;
}

.sup-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.sup-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.sup-count {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.sup-bar {
  height: 6px;
  background-color: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.sup-bar-fill {
  height: 100%;
  background-color: var(--primary);
  border-radius: 3px;
}

.sup-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.sup-alert-summary {
  display: flex;
  gap: 10px;
}
.sup-badge-red {
  color: #8A1C14;
  font-weight: 600;
}
.sup-badge-orange {
  color: #6B4300;
  font-weight: 600;
}

/* =====================================================================
   BOTTOM NAVIGATION
   ===================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  height: calc(64px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50;
}

.nav-item {
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  cursor: pointer;
  min-height: 44px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.nav-item.active {
  color: var(--primary);
}
.nav-item.active .nav-icon-box {
  background-color: var(--primary-soft);
  color: var(--primary);
}

.nav-icon-box {
  padding: 4px 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

/* =====================================================================
   BOTTOM SHEET (DETAIL PETAK)
   ===================================================================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(23, 38, 30, 0.45);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  max-height: 85vh;
  background-color: var(--surface);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  z-index: 100;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
  padding-bottom: var(--safe-bottom);
}
.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-handle-bar {
  padding: 10px 0 4px 0;
  display: flex;
  justify-content: center;
  cursor: grab;
}
.sheet-handle {
  width: 40px;
  height: 4px;
  background-color: var(--border);
  border-radius: 2px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 18px 12px 18px;
  border-bottom: 1px solid var(--border);
}

.sheet-petak-id {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.sheet-petak-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-close {
  background: none;
  border: none;
  padding: 8px;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
}
.btn-close:active {
  background-color: var(--bg);
}

.sheet-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Detail Section Boxes */
.detail-action-box {
  border-radius: var(--radius-card);
  padding: 14px;
}
.action-box-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.action-box-main {
  font-size: 18px;
  font-weight: 700;
  margin: 4px 0;
}
.action-box-pic {
  font-size: 13px;
  font-weight: 500;
}

.detail-section {
  background-color: #FAFAF7;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
}

.detail-sec-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Activity Flow */
.flow-step {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 14px;
}
.flow-step:last-child {
  padding-bottom: 0;
}
.flow-step::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 18px;
  bottom: -2px;
  width: 2px;
  background-color: var(--border);
}
.flow-step:last-child::before {
  display: none;
}

.flow-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.flow-step.current .flow-dot {
  background-color: var(--primary);
  color: #FFFFFF;
}

.flow-content {
  flex: 1;
}
.flow-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}
.flow-act {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.flow-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.last-status-card {
  margin: 0 0 8px;
  padding: 7px 9px;
  border-left: 3px solid var(--primary);
  border-radius: 0 7px 7px 0;
  background: rgba(30, 91, 64, 0.06);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.last-status-detail {
  margin-top: 7px;
  padding: 9px 10px;
  border: 1px solid rgba(30, 91, 64, 0.18);
  border-radius: 8px;
  background: rgba(30, 91, 64, 0.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.last-status-detail.muted {
  color: var(--text-muted);
  font-weight: 400;
}

.last-status-label {
  display: block;
  margin-bottom: 2px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* SPK & Progress */
.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--border);
}
.data-row:last-child {
  border-bottom: none;
}
.data-label {
  color: var(--text-muted);
}
.data-val {
  font-weight: 600;
  color: var(--text);
}
.data-val.mono {
  font-family: var(--font-mono);
}

/* QC & BAP */
.qc-bar-wrap {
  position: relative;
  height: 12px;
  background-color: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  margin: 10px 0 6px 0;
}
.qc-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s ease;
}
.qc-threshold-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 95%;
  width: 2px;
  background-color: #17261E;
  z-index: 2;
}
.qc-threshold-label {
  position: absolute;
  top: -16px;
  left: 95%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

/* WhatsApp Button */
.btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: #1E5B40;
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--radius-chip);
  border: none;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
  width: 100%;
}
.btn-wa:active {
  background-color: #164631;
}

/* Utility classes */
.text-danger {
  color: #8A1C14;
}
.bg-danger-soft {
  background-color: #F8DAD6;
}

/* =====================================================================
   LOGIN GATE — Halaman Password
   ===================================================================== */

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(30,91,64,0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(30,91,64,0.12) 0%, transparent 60%),
    linear-gradient(160deg, #0f1f17 0%, #17261E 45%, #1a2e22 100%);
  overflow: hidden;
}

/* Background pattern subtle */
.login-gate::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,0.015) 40px,
      rgba(255,255,255,0.015) 41px
    );
  pointer-events: none;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 40px 32px 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06) inset,
    0 32px 64px rgba(0,0,0,0.5),
    0 8px 16px rgba(0,0,0,0.3);
  animation: loginCardIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Logo Icon */
.login-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #2d7a54 0%, #1E5B40 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(30,91,64,0.45);
}

/* Title & Subtitle */
.login-title {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.login-subtitle {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  text-align: center;
  margin-bottom: 32px;
  letter-spacing: 0.01em;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 16px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-text-security: disc;
  letter-spacing: 0.08em;
  box-sizing: border-box;
}

.login-input::placeholder {
  color: rgba(255,255,255,0.25);
  font-weight: 400;
  letter-spacing: 0;
}

.login-input:focus {
  border-color: rgba(76,175,120,0.7);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 0 3px rgba(76,175,120,0.15);
}

.login-input.shake {
  animation: shakeInput 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
  border-color: rgba(200,60,50,0.7) !important;
  box-shadow: 0 0 0 3px rgba(200,60,50,0.15) !important;
}

@keyframes shakeInput {
  0%,100% { transform: translateX(0); }
  15%  { transform: translateX(-8px); }
  30%  { transform: translateX( 7px); }
  45%  { transform: translateX(-6px); }
  60%  { transform: translateX( 5px); }
  75%  { transform: translateX(-4px); }
  90%  { transform: translateX( 2px); }
}

/* Show/Hide password button */
.login-eye-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: rgba(255,255,255,0.35);
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.login-eye-btn:hover { color: rgba(255,255,255,0.75); }

/* Error */
.login-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: #ff8a80;
  padding: 8px 12px;
  background: rgba(200,60,50,0.12);
  border: 1px solid rgba(200,60,50,0.25);
  border-radius: 8px;
  animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Login Button */
.login-btn {
  margin-top: 6px;
  height: 52px;
  background: linear-gradient(135deg, #2d7a54 0%, #1E5B40 100%);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(30,91,64,0.4);
  width: 100%;
}

.login-btn:hover {
  opacity: 0.9;
  box-shadow: 0 6px 20px rgba(30,91,64,0.55);
}

.login-btn:active {
  transform: scale(0.98);
  opacity: 0.85;
}

/* Footer note */
.login-footer {
  margin-top: 28px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.22);
  letter-spacing: 0.01em;
}

/* Hide gate after login */
.login-gate.hidden {
  animation: loginGateOut 0.35s ease forwards;
  pointer-events: none;
}

@keyframes loginGateOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* =====================================================================
   EPIC & MODERN ENHANCEMENTS: FULL STACK DASHBOARD (LUAS, DATES, TABLE)
   ===================================================================== */

/* Responsive Container Expansion */
.app-wrapper {
  max-width: 1060px;
  transition: max-width 0.2s ease;
}

/* Super-Charged Hero Card */
.hero-card {
  background: linear-gradient(135deg, #123825 0%, #1E5B40 45%, #297452 100%);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  color: #FFFFFF;
  margin-bottom: 16px;
  box-shadow: 0 10px 26px rgba(18, 56, 37, 0.28);
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.hero-actions-group {
  display: flex;
  gap: 6px;
}
.hero-action-btn {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
  backdrop-filter: blur(4px);
}
.hero-action-btn:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}
.hero-main-stat-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.hero-stat-block {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.hero-stat-divider {
  font-size: 32px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 300;
}
.hero-main-stat {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}
.hero-ha-stat {
  color: #79DFB0;
}
.hero-stat-unit {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
}
.hero-sub-val-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.hero-sub-ha {
  font-size: 11px;
  color: #79DFB0;
  font-family: var(--font-mono);
  font-weight: 600;
}
.section-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Filter Toolbar & Area Scroller */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.view-toggle-wrap {
  flex-shrink: 0;
}
.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.view-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* Clear Search Button */
.search-bar {
  position: relative;
}
.clear-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.clear-search-btn:hover {
  color: var(--text);
}

/* Date Badges & Stepper Pills */
.card-dates-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px 0;
}
.date-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #F3F1EA;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.date-badge-pill strong {
  color: var(--text);
  font-weight: 600;
}
.date-badge-pill.apply {
  background: #E8F4EC;
  color: #145A32;
  border: 1px solid rgba(20, 90, 50, 0.15);
}
.date-badge-pill.completion {
  background: #EAF2F8;
  color: #1B4F72;
  border: 1px solid rgba(27, 79, 114, 0.15);
}
.date-badge-pill.due {
  background: #FEF9E7;
  color: #7D6608;
  border: 1px solid rgba(125, 102, 8, 0.15);
}

/* Ringkasan kartu petak: hanya informasi keputusan utama */
.petak-simple-info {
  display: grid;
  gap: 10px;
  margin-top: 13px;
}

.petak-simple-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.petak-simple-label {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.last-activity-value {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.last-activity-value span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
}

.completion-date-value {
  font-size: 15px;
  font-weight: 700;
}

.current-activity-value,
.supervisor-value {
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.window-remaining {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 15px;
  font-weight: 750;
}

.window-remaining.expired {
  background: #F8DAD6;
  color: #8A1C14;
}

/* Status Tahap Badge Dinamis */
.stage-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  white-space: nowrap;
}

/* Compact Table View */
.petak-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow-x: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
}
.petak-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}
.petak-table th {
  background: #F8F7F3;
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 2;
}
.petak-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #ECEAE1;
  color: var(--text);
  vertical-align: middle;
}
.petak-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}
.petak-table tbody tr:hover {
  background: rgba(30, 91, 64, 0.05);
}

/* Toast Notification */
.toast-msg {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(23, 38, 30, 0.95);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(6px);
}
.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive Desktop & Tablet Grid */
@media (min-width: 768px) {
  .app-wrapper {
    max-width: 1060px;
    padding: 0 16px;
  }
  .app-header {
    border-radius: 0 0 16px 16px;
  }
  .hero-grid {
    gap: 16px;
  }
  .window-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  #petakCardsList {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .petak-card {
    margin-bottom: 0;
  }
  #pengawasCardsList {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .supervisor-card {
    margin-bottom: 0;
  }
  .bottom-sheet {
    max-width: 620px;
    left: 50%;
    transform: translate(-50%, 100%);
    border-radius: 20px 20px 0 0;
  }
  .bottom-sheet.open {
    transform: translate(-50%, 0);
  }
}
@media (min-width: 1040px) {
  #petakCardsList {
    grid-template-columns: repeat(3, 1fr);
  }
  #pengawasCardsList {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =====================================================================
   MOBILE FIELD UI · optimized for 360–430 px and one-hand operation
   ===================================================================== */
@media (max-width: 767px) {
  :root {
    --radius-card: 14px;
    --radius-sheet: 18px;
  }

  html {
    scroll-padding-top: 142px;
  }

  body {
    font-size: 16px;
    line-height: 1.5;
    overscroll-behavior-y: none;
  }

  .app-wrapper {
    max-width: none;
    box-shadow: none;
  }

  .app-header {
    padding: 10px 12px 8px;
    background: rgba(243, 241, 234, 0.96);
    backdrop-filter: blur(14px);
    box-shadow: 0 4px 18px rgba(23, 38, 30, 0.07);
  }

  .header-topbar {
    min-height: 28px;
    margin-bottom: 2px;
  }

  .header-label {
    max-width: 48%;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sync-status {
    gap: 5px;
    font-size: 12px;
  }

  .sync-status .btn-link {
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
  }

  .tab-title {
    font-size: 1.45rem;
    line-height: 1.15;
  }

  .cutoff-info {
    margin: 3px 0 8px;
    font-size: 12px;
    line-height: 1.35;
  }

  .coord-scroller,
  .filter-scroller {
    margin-inline: -12px;
    padding-inline: 12px;
    scroll-padding-inline: 12px;
    scroll-snap-type: x proximity;
  }

  .adv-row,
  .sort-bar {
    max-width: 100%;
    margin-inline: 0;
    padding-inline: 0;
    scroll-padding-inline: 0;
    scroll-snap-type: x proximity;
  }

  .coord-scroller > *,
  .filter-scroller > *,
  .adv-row > *,
  .sort-bar > * {
    scroll-snap-align: start;
  }

  .chip,
  .adv-chip,
  .sort-btn,
  .view-toggle-btn,
  .btn-secondary {
    min-height: 44px;
    font-size: 14px;
  }

  .tab-content {
    padding: 12px 12px calc(86px + var(--safe-bottom));
  }

  .hero-card {
    padding: 15px 14px;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(18, 56, 37, 0.22);
  }

  .hero-top-row {
    align-items: flex-start;
    margin-bottom: 14px;
  }

  .hero-header {
    width: 100%;
    font-size: 12px;
  }

  .hero-actions-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hero-action-btn {
    min-height: 42px;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 11px;
    font-size: 13px;
  }

  .hero-main-stat-wrap {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) auto minmax(0, 1.35fr);
    gap: 8px;
    margin-bottom: 14px;
  }

  .hero-stat-block {
    min-width: 0;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 2px 6px;
  }

  .hero-main-stat {
    max-width: 100%;
    font-size: clamp(1.75rem, 9vw, 2.35rem);
    overflow-wrap: anywhere;
  }

  .hero-stat-divider {
    align-self: center;
    font-size: 24px;
  }

  .hero-stat-unit {
    width: 100%;
    font-size: 12px;
  }

  .hero-grid {
    gap: 5px;
    padding-top: 11px;
  }

  .hero-sub-stat {
    min-width: 0;
    padding-inline: 4px;
  }

  .hero-sub-val-wrap {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

  .hero-sub-val {
    font-size: 1.2rem;
  }

  .hero-sub-ha,
  .hero-sub-lbl,
  .section-subtitle {
    font-size: 12px;
    line-height: 1.25;
  }

  .changes-card,
  .stages-card,
  .my-tasks-card,
  .supervisor-card,
  .petak-card,
  .adv-filter-box {
    border-radius: 14px;
  }

  .section-head {
    gap: 8px;
    align-items: flex-start;
  }

  .section-title {
    font-size: 15px;
    line-height: 1.35;
  }

  .window-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .window-card {
    min-height: 92px;
    padding: 13px;
  }

  .search-input {
    min-height: 50px;
    padding-left: 44px;
    padding-right: 42px;
    border-radius: 13px;
    font-size: 16px;
  }

  .filter-toolbar {
    align-items: stretch;
    min-width: 0;
  }

  .view-toggle-wrap {
    display: none;
  }

  .filter-toolbar .filter-scroller {
    min-width: 0;
    width: auto;
    flex: 1;
  }

  .list-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .sort-bar {
    width: 100%;
    justify-content: flex-start;
  }

  .sort-count {
    font-size: 14px;
  }

  .petak-card {
    margin-bottom: 11px;
    padding: 14px;
    border-width: 1px 1px 1px 5px;
    box-shadow: 0 3px 12px rgba(23, 38, 30, 0.06);
  }

  .petak-card-top {
    align-items: flex-start;
    gap: 8px;
  }

  .petak-simple-row {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 9px;
  }

  .petak-simple-row-stack {
    align-items: start;
  }

  .petak-simple-label,
  .last-activity-value {
    font-size: 14px;
  }

  .status-pill {
    white-space: normal;
    line-height: 1.3;
  }

  .petak-id {
    font-size: 17px;
    line-height: 1.2;
  }

  .petak-area-spec,
  .card-supervisor,
  .flow-meta,
  .due-note {
    font-size: 13px;
  }

  .petak-activity {
    margin-top: 10px;
    font-size: 16px;
    line-height: 1.35;
  }

  .last-status-card {
    padding: 9px 10px;
    font-size: 13px;
    line-height: 1.45;
  }

  .petak-status-due {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .status-pill,
  .window-pill {
    font-size: 12px;
    line-height: 1.25;
  }

  .card-action-row {
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
  }

  .bottom-nav {
    min-height: calc(68px + var(--safe-bottom));
    padding: 6px 8px calc(6px + var(--safe-bottom));
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 20px rgba(23, 38, 30, 0.1);
  }

  .nav-item {
    min-height: 54px;
    border-radius: 12px;
    font-size: 12px;
  }

  .nav-item.active {
    background: var(--primary-soft);
  }

  .bottom-sheet {
    width: 100%;
    max-height: 96dvh;
    border-radius: 20px 20px 0 0;
  }

  .sheet-handle-bar {
    height: 22px;
  }

  .sheet-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 14px 12px;
    background: var(--surface);
    box-shadow: 0 4px 10px rgba(23, 38, 30, 0.05);
  }

  .sheet-petak-id {
    font-size: 20px;
  }

  .sheet-petak-sub {
    font-size: 13px;
  }

  .btn-close {
    width: 44px;
    height: 44px;
  }

  .sheet-body {
    padding: 14px 14px calc(24px + var(--safe-bottom));
  }

  .detail-section,
  .detail-action-box {
    padding: 14px;
    border-radius: 13px;
  }

  .detail-sec-title,
  .flow-label {
    font-size: 12px;
  }

  .flow-act {
    font-size: 16px;
  }

  .last-status-detail {
    padding: 10px 11px;
    font-size: 14px;
  }

  .data-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    padding: 9px 0;
    font-size: 14px;
  }

  .data-val {
    width: 100%;
    overflow-wrap: anywhere;
  }

  .btn-wa {
    min-height: 52px;
    font-size: 15px;
  }

  .login-card {
    width: min(100% - 24px, 390px);
    padding: 26px 20px;
  }
}

@media (max-width: 374px) {
  .header-label {
    display: none;
  }

  .header-topbar {
    justify-content: flex-end;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-sub-stat {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 7px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .hero-sub-stat:last-child {
    border-bottom: 0;
  }

  .hero-sub-val-wrap {
    align-items: baseline;
    flex-direction: row;
    gap: 6px;
    order: 2;
  }

  .hero-sub-lbl {
    order: 1;
  }
}
