/* ==========================================================================
   E-Report - employee-facing design system
   --------------------------------------------------------------------------
   Scope:  Employee Home / Aktivitas  (views/aktivitas/home.xhtml)

   Everything is namespaced under `.er` so it cannot affect the SDI/admin pages
   or the login page, which keep using main.css. No global element selectors
   (body, h1, input, ...) are used, for the same reason.

   Tokens follow docs/design/UX-DESIGN-SPECIFICATION.md:
     breakpoints  600 / 1024 / 1440   (sm / md / lg / xl)
     spacing      4 8 12 16 24 32 48 64
     radius       4 inputs+buttons, 8 cards, 999 pills
     mobile-first: base rules target phones, enhanced upward

   ASCII only, deliberately. The rest of the project is ASCII and the servlet
   response is not forced to UTF-8, so non-ASCII punctuation here would render
   as mojibake. Use "-" rather than a dash character.
   ========================================================================== */

/* PrimeFaces' own theme hides accessibility-only wrappers with display:none.
   Restated here so the rules below behave identically whether or not the theme
   stylesheet happens to be loaded - without it, a native control inside such a
   wrapper becomes visible and can duplicate a styled indicator. */
.er .ui-helper-hidden-accessible {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  display: none;
}

.er {
  /* colour roles */
  --er-surface: #f5f6f8;
  --er-surface-raised: #ffffff;
  --er-surface-sunken: #eef0f3;
  --er-surface-alt: #fafbfc;
  --er-text-primary: #16202b;
  --er-text-secondary: #5b6572;
  --er-text-disabled: #98a1ac;
  --er-border: #e0e4ea;
  --er-border-strong: #c2c9d2;
  --er-primary: #14548c;
  --er-primary-hover: #0f4270;
  --er-primary-subtle: #e9f1f9;
  --er-success: #17683c;
  --er-success-subtle: #e7f4ec;
  --er-warning: #8a5300;
  --er-warning-subtle: #fdf4e4;
  --er-danger: #a3231f;
  --er-danger-subtle: #fdeceb;
  --er-neutral-state: #6b7280;
  --er-neutral-subtle: #eef0f3;
  --er-focus-ring: #2b7fd4;

  /* spacing scale */
  --er-s1: 4px;
  --er-s2: 8px;
  --er-s3: 12px;
  --er-s4: 16px;
  --er-s5: 24px;
  --er-s6: 32px;
  --er-s7: 48px;
  --er-s8: 64px;

  /* radius */
  --er-r-sm: 4px;
  --er-r-md: 8px;
  --er-r-pill: 999px;

  /* elevation: three levels only */
  --er-e1: 0 1px 2px rgba(16, 24, 40, 0.05);
  --er-e2: 0 2px 6px rgba(16, 24, 40, 0.07);
  --er-e3: 0 10px 30px rgba(16, 24, 40, 0.18);

  /* one place that decides how much room the fixed footer needs. Measured from
     the footer's real height (progress block + action + padding) plus a gap, so
     the last control can always be scrolled clear of it. */
  --er-footer-h: 164px;

  --er-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  background: var(--er-surface);
  color: var(--er-text-primary);
  font-family: var(--er-font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Header
   Mobile: burger + brand + Keluar.  Desktop: brand, then one nav row.
   -------------------------------------------------------------------------- */
.er-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--er-surface-raised);
  border-bottom: 1px solid var(--er-border);
}

.er-topbar__inner {
  display: flex;
  align-items: center;
  gap: var(--er-s3);
  height: 56px;
  padding: 0 var(--er-s4);
  max-width: 1120px;
  margin: 0 auto;
}

.er-topbar__brand {
  display: flex;
  align-items: center;
  gap: var(--er-s2);
  min-width: 0;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--er-text-primary);
}

/* Brand mark. This is the SAME asset the login page shows, in a fixed 30x30
   box. object-fit: contain guarantees the aspect ratio is never distorted if
   the artwork ever changes shape, and display:block removes the inline-image
   baseline gap so the mark and the "E-Report" wordmark sit on one line. */
.er-topbar__logo {
  display: block;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  object-fit: contain;
}

.er-topbar__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.er-topbar__spacer { flex: 1 1 auto; }

/* The hamburger. A <label> bound to the drawer checkbox: no JavaScript, and it
   stays focusable and operable from the keyboard as a real form control. */
.er-burger {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: calc(var(--er-s2) * -1);
  border: 0;
  border-radius: var(--er-r-sm);
  background: transparent;
  color: var(--er-text-primary);
  font-size: 20px;
  flex: 0 0 auto;
}

.er-burger::-webkit-details-marker { display: none; }
.er-burger::marker { content: ""; }
.er-burger:hover { background: var(--er-surface-sunken); }

/* The drawer toggle is the first child of .er and is never visible. `position:
   fixed` keeps it out of flow so it cannot shift the header, while still being
   focusable and operable from the keyboard. */
.er-drawer-toggle {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* Header actions stay compact but still meet the 44px touch target */
.er-topbar .er-btn {
  min-height: 44px;
  padding: 0 var(--er-s3);
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Desktop navigation
   -------------------------------------------------------------------------- */
.er-navdesk { display: none; }

.er-nav__list { list-style: none; margin: 0; padding: 0; }

.er-nav__item {
  display: flex;
  align-items: center;
  gap: var(--er-s2);
  min-height: 44px;
  padding: 0 var(--er-s3);
  border-radius: var(--er-r-sm);
  color: var(--er-text-primary);
  text-decoration: none;
  font-size: 15px;
  border-bottom: 2px solid transparent;
}

.er-nav__item:hover { background: var(--er-primary-subtle); }

.er-nav__item:focus-visible {
  outline: 2px solid var(--er-focus-ring);
  outline-offset: 2px;
}

.er-nav__item--active {
  color: var(--er-primary);
  font-weight: 600;
  background: var(--er-primary-subtle);
}

/* --------------------------------------------------------------------------
   Mobile drawer
   A fixed overlay, so it never pushes the page content down.
   Toggled by a visually hidden checkbox - CSS only, no JavaScript.
   -------------------------------------------------------------------------- */
.er-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 999;
  width: 300px;
  max-width: 84vw;
  background: var(--er-surface-raised);
  box-shadow: var(--er-e3);
  transform: translateX(-100%);
  transition: transform 180ms ease-out, visibility 180ms;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.er-drawer-toggle:checked ~ .er-drawer {
  transform: translateX(0);
  visibility: visible;
}

.er-drawer-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 998;
  background: rgba(16, 24, 40, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease-out, visibility 180ms;
  cursor: pointer;
}

.er-drawer-toggle:checked ~ .er-drawer-overlay {
  opacity: 1;
  visibility: visible;
}

.er-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--er-s3);
  padding: var(--er-s4);
  border-bottom: 1px solid var(--er-border);
}

.er-drawer__title { font-size: 16px; font-weight: 600; margin: 0; }

.er-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--er-r-sm);
  cursor: pointer;
  color: var(--er-text-secondary);
  font-size: 18px;
}

.er-drawer__close:hover { background: var(--er-surface-sunken); }

.er-drawer__body { padding: var(--er-s3) var(--er-s3) var(--er-s5); }

.er-drawer__group + .er-drawer__group { margin-top: var(--er-s4); }

.er-drawer__legend {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--er-text-secondary);
  padding: 0 var(--er-s3) var(--er-s2);
}

.er-drawer .er-nav__item { font-size: 16px; }

/* --------------------------------------------------------------------------
   Page shell
   -------------------------------------------------------------------------- */
.er-main {
  display: block;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--er-s3);
  /* Reserve room for the fixed footer so it can never cover the last control */
  padding-bottom: calc(var(--er-footer-h) + var(--er-s5));
}

.er-page-head { margin-bottom: var(--er-s4); }

.er-page-head__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--er-text-secondary);
  margin: 0 0 var(--er-s1);
}

.er-page-head__title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 var(--er-s2);
}

.er-page-head__lede {
  margin: 0;
  color: var(--er-text-secondary);
  font-size: 14px;
  max-width: 62ch;
}

.er-section { margin-bottom: var(--er-s4); }

.er-section__title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 var(--er-s3);
}

/* --------------------------------------------------------------------------
   Card
   On phones a hairline border is enough separation - the elevation is held
   back until the cards sit side by side (md and up), so the stacked layout
   does not read as a pile of floating panels.
   -------------------------------------------------------------------------- */
.er-card {
  background: var(--er-surface-raised);
  border: 1px solid var(--er-border);
  border-radius: var(--er-r-md);
  overflow: hidden;
}

.er-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--er-s2);
  padding: var(--er-s3) var(--er-s3) 0;
}

.er-card__title { font-size: 15px; font-weight: 600; margin: 0; }
.er-card__body { padding: var(--er-s3); }

/* --------------------------------------------------------------------------
   Dashboard grid
   -------------------------------------------------------------------------- */
.er-grid { display: grid; gap: var(--er-s3); grid-template-columns: 1fr; }

.er-stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--er-s2);
  align-items: stretch;
}

@media (min-width: 640px) {
  .er-stat-row--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.er-stat {
  background: var(--er-surface-sunken);
  border-radius: var(--er-r-md);
  padding: 10px var(--er-s3);
  min-width: 0;
}

.er-stat__value {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.er-stat__label {
  font-size: 13px;
  color: var(--er-text-secondary);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Progress
   -------------------------------------------------------------------------- */
.er-progress {
  height: 8px;
  border-radius: var(--er-r-pill);
  background: var(--er-surface-sunken);
  overflow: hidden;
}

.er-progress__bar {
  display: block;
  height: 100%;
  background: var(--er-primary);
  border-radius: var(--er-r-pill);
  transition: width 180ms ease-out;
}

.er-progress__bar--done { background: var(--er-success); }

.er-progress__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--er-s3);
  margin-bottom: var(--er-s2);
  font-size: 14px;
}

.er-progress__count { font-weight: 600; }
.er-progress__pct { color: var(--er-text-secondary); font-size: 13px; }

/* --------------------------------------------------------------------------
   Pills. Three states stay visually distinct on purpose: "not recorded" must
   never look identical to "No".
   -------------------------------------------------------------------------- */
.er-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--er-s1);
  padding: 2px var(--er-s2);
  border-radius: var(--er-r-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.er-pill--success { background: var(--er-success-subtle); color: var(--er-success); }
.er-pill--warning { background: var(--er-warning-subtle); color: var(--er-warning); }
.er-pill--danger { background: var(--er-danger-subtle); color: var(--er-danger); }
.er-pill--neutral { background: var(--er-neutral-subtle); color: var(--er-neutral-state); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.er-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--er-s2);
  min-height: 44px;
  padding: 0 var(--er-s4);
  border-radius: var(--er-r-sm);
  border: 1px solid transparent;
  font-family: var(--er-font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 140ms ease-out, border-color 140ms ease-out;
}

.er-btn--primary { background: var(--er-primary); color: #fff; }
.er-btn--primary:hover { background: var(--er-primary-hover); }
.er-btn--secondary {
  background: var(--er-surface-raised);
  color: var(--er-text-primary);
  border-color: var(--er-border-strong);
}
.er-btn--secondary:hover { background: var(--er-primary-subtle); }
.er-btn--block { width: 100%; }

.er-btn:focus-visible {
  outline: 2px solid var(--er-focus-ring);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Section card
   -------------------------------------------------------------------------- */
.er-habit {
  background: var(--er-surface-raised);
  border: 1px solid var(--er-border);
  border-radius: var(--er-r-md);
  margin-bottom: var(--er-s2);
  overflow: hidden;
}

.er-habit__head {
  display: flex;
  align-items: flex-start;
  gap: var(--er-s2);
  padding: var(--er-s3) var(--er-s3) var(--er-s2);
  border-bottom: 1px solid var(--er-border);
}

.er-habit__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: var(--er-r-sm);
  background: var(--er-primary-subtle);
  color: var(--er-primary);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.er-habit__title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.er-habit__hint {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--er-text-secondary);
}

.er-habit__body { padding: var(--er-s3); }

/* --------------------------------------------------------------------------
   Field rows
   Label above control by default; label BESIDE the control for the small
   inline choices (a radio pair, a single checkbox), which is both shorter and
   easier to scan down the page.
   -------------------------------------------------------------------------- */
.er-group {
  border: 0;
  margin: 0 0 var(--er-s3);
  padding: 0;
}

.er-group:last-child { margin-bottom: 0; }

.er-group__legend {
  padding: 0 0 var(--er-s2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--er-text-secondary);
}

.er-row { padding: 9px 0; }
.er-row:first-of-type { padding-top: 0; }
.er-row:last-of-type { padding-bottom: 0; }
.er-row + .er-row { border-top: 1px solid var(--er-border); }

.er-row__label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--er-text-primary);
  margin-bottom: var(--er-s2);
}

.er-row__help {
  display: block;
  font-size: 13px;
  color: var(--er-text-secondary);
  margin: -6px 0 var(--er-s2);
}

.er-row__field { display: block; }

/* A row whose control is a small inline choice: label on the left, control
   held to the right edge. A long label wraps inside its own column and the
   control stays put, so it never drifts to a confusing position.
   The whole control keeps a >=44px tall hit area via min-height on the
   choice itself, so the compact look does not cost touch usability. */
.er-row-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--er-s3);
  row-gap: var(--er-s2);
}

.er-row-inline > .er-row__label { margin-bottom: 0; }
.er-row-inline > .er-row__field { justify-self: end; }

/* The conditional detail that belongs to a ticked checkbox: its own full-width
   row under the label/checkbox row, never squeezed into the control column. */
.er-row-inline > .er-cond { grid-column: 1 / -1; }

/* --------------------------------------------------------------------------
   Text inputs
   -------------------------------------------------------------------------- */
.er .er-input,
.er .er-input.ui-inputfield {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: var(--er-s2) var(--er-s3);
  
  /* --- Perubahan Utama --- */
  border: none; /* Menghilangkan semua border */
  border-bottom: 2px solid var(--er-border-strong); /* Hanya menambahkan border bawah */
  border-radius: 0; /* Menghilangkan lengkungan sudut */
  box-shadow: none; /* Mencegah bayangan bawaan PrimeFaces */
  
  /* Opsional: Ubah ke 'transparent' jika ingin menyatu dengan warna background form */
  background: var(--er-surface-raised); 
  
  color: var(--er-text-primary);
  font-family: var(--er-font);
  font-size: 16px;
  
  /* Menambahkan animasi transisi halus saat diklik */
  transition: border-bottom-color 0.3s ease; 
}

/* Tampilan saat input diklik/fokus */
.er .er-input:focus,
.er .er-input.ui-inputfield:focus {
  outline: none; /* Menghilangkan kotak biru/outline bawaan browser */
  border-bottom: 2px solid var(--er-focus-ring); /* Garis bawah berubah warna saat fokus */
  box-shadow: none;
}

.er .er-input::placeholder { 
  color: var(--er-text-disabled); 
}

/* Memastikan wrapper password dari PrimeFaces mengambil lebar penuh */
.er-login__field .ui-password,
.er-login__field .ui-input-icon-right {
  width: 100%;
  display: block; 
}

/* Memastikan ikon mata posisinya pas dan tidak tertutup border */
.er-login__field .ui-input-icon-right > i {
  margin-top: -10px; /* Sesuaikan jika ikon mata tidak di tengah secara vertikal */
}

/* --------------------------------------------------------------------------
   Yes/No radio group (p:selectOneRadio)

   DOM PrimeFaces actually renders for each option:

     <div id="form:g">                       <- .ui-selectoneradio  (radiogroup)
       <div role="radio">                    <- plain wrapper, no class
         <div class="ui-radiobutton">
           <div class="ui-helper-hidden-accessible"><input type="radio"/></div>
           <div class="ui-radiobutton-box">...</div>
         </div>
         <label for="form:g:0">Ya</label>     <- SIBLING of .ui-radiobutton
       </div>
       <div role="radio"> ... </div>
     </div>

   Two things that were previously wrong and are the root cause of the broken
   radios:
     1. The rules targeted `.ui-selectoneradio > label`. The label is not a
        direct child, so the segments never applied and the options collapsed.
     2. `.ui-radiobutton { display: none }` hid the indicator outright, and the
        real <input> lives inside .ui-helper-hidden-accessible, so NO indicator
        was visible at all.

   So: the PrimeFaces radio indicator is shown, and the wrapper that PrimeFaces
   already made clickable carries the touch target. Option markup and bindings
   are untouched.

   The wrapper is deliberately NOT drawn as a bordered segment/button any more.
   A Ya/Tidak pair is a plain native-looking choice: a visible radio circle,
   its label, and nothing else. The 44px minimum height on the option keeps the
   tap target comfortable without a single pixel of decoration around it.
   -------------------------------------------------------------------------- */
.er .er-choice .ui-selectoneradio {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--er-s2) var(--er-s4);
  border: 0;
  background: transparent;
  overflow: visible;
  vertical-align: middle;
}

/* The per-option wrapper. PrimeFaces gives it no class, so match it by the
   role it declares for assistive technology. */
.er .er-choice .ui-selectoneradio > [role="radio"] {
  display: inline-flex;
  align-items: center;
  gap: var(--er-s1);
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

/* The indicator stays VISIBLE, and exactly one is drawn.
   PrimeFaces emits BOTH a native <input type="radio"> and its own
   .ui-radiobutton-box. The native input sits inside
   .ui-helper-hidden-accessible, which the PrimeFaces theme sets to
   `display: none`, so it never shows - but it stays the accessible control.
   Styling it would force it back into view and produce two circles per option,
   which is why the visual is drawn on the PrimeFaces box instead. */
.er .er-choice .ui-selectoneradio .ui-radiobutton {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.er .er-choice .ui-selectoneradio .ui-radiobutton-box {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--er-border-strong);
  border-radius: 50%;
  background: var(--er-surface-raised);
  position: relative;
}

/* PrimeFaces keeps the icon span blank and adds ui-state-active to the box when
   checked, so the dot is drawn from the wrapper state. */
.er .er-choice .ui-selectoneradio .ui-radiobutton-box.ui-state-active {
  border-color: var(--er-primary);
}

.er .er-choice .ui-selectoneradio .ui-radiobutton-box.ui-state-active::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--er-primary);
}

/* Belt and braces: if a theme ever leaves the icon span visible, do not let it
   draw a second mark inside the box. */
.er .er-choice .ui-selectoneradio .ui-radiobutton-box .ui-icon {
  display: none;
}

.er .er-choice .ui-selectoneradio > [role="radio"] label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--er-text-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

/* Selected option. PrimeFaces marks the wrapper with aria-checked, which is the
   most reliable signal. Without the old box background, the state is carried by
   the filled dot plus the label weight/colour - never by colour alone. */
.er .er-choice .ui-selectoneradio > [role="radio"][aria-checked="true"] label {
  color: var(--er-primary);
  font-weight: 600;
}

/* Keyboard focus must be visible: the input itself is visually hidden, so
   surface focus on the wrapper. Deliberately keyed on :focus-visible only -
   PrimeFaces also adds ui-state-focus on a plain click, and now that an option
   is just a circle and a word, drawing a focus ring around the option that was
   clicked LAST would read as a second, competing selection. */
.er .er-choice .ui-selectoneradio > [role="radio"]:has(input:focus-visible) {
  outline: 2px solid var(--er-focus-ring);
  outline-offset: 2px;
  border-radius: var(--er-r-sm);
}

/* --------------------------------------------------------------------------
   Standalone checkbox (PrimeFaces p:selectBooleanCheckbox support)
   -------------------------------------------------------------------------- */
.er .er-choice {
  display: inline-flex;
  align-items: center;
  gap: var(--er-s2);
  cursor: pointer;
}

.er .er-choice .ui-selectbooleancheckbox {
  display: inline-flex;
  align-items: center;
}

.er .er-choice .ui-chkbox {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.er .er-choice .ui-chkbox-box {
  position: relative;
  width: 22px;
  height: 22px;
  border: 2px solid var(--er-border-strong);
  border-radius: var(--er-r-sm);
  background: var(--er-surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
  cursor: pointer;
}

/* The drawn box stays small and native looking, but the TAPPABLE region is
   grown to ~40px with a transparent overlay. Pointer events on a pseudo
   element are delivered to its originating element, so PrimeFaces' own click
   handler on the box still fires - no extra JavaScript, no larger visual box. */
.er .er-choice .ui-chkbox-box::after {
  content: "";
  position: absolute;
  inset: -9px;
}

.er .er-choice .ui-chkbox-box:hover {
  border-color: var(--er-primary);
  background: var(--er-primary-subtle);
}

.er .er-choice .ui-chkbox-box.ui-state-active {
  background-color: var(--er-primary);
  border-color: var(--er-primary);
}

.er .er-choice .ui-chkbox-box .ui-chkbox-icon {
  font-size: 14px;
  color: #ffffff;
}

.er .er-choice .ui-selectbooleancheckbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--er-primary);
}

/* --------------------------------------------------------------------------
   Read-only status list on the dashboard
   -------------------------------------------------------------------------- */
.er-status-list { list-style: none; margin: 0; padding: 0; }

.er-status-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--er-s3);
  padding: 6px 0;
  border-top: 1px solid var(--er-border);
  font-size: 14px;
}

.er-status-list li:first-child { border-top: 0; }
.er-status-list__label { min-width: 0; }

/* --------------------------------------------------------------------------
   Fixed footer
   -------------------------------------------------------------------------- */
.er-footbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--er-border);
  box-shadow: 0 -1px 6px rgba(16, 24, 40, 0.06);
}

.er-footbar__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px var(--er-s3);
  display: flex;
  flex-direction: column;
  gap: var(--er-s2);
}

.er-footbar__progress { min-width: 0; }

.er-footbar__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--er-s3);
  font-size: 13px;
  margin-bottom: 6px;
}

.er-footbar__count { font-weight: 600; }
.er-footbar__pct { color: var(--er-text-secondary); }

.er-footbar__note {
  margin: 0;
  font-size: 12px;
  color: var(--er-text-secondary);
}

/* --------------------------------------------------------------------------
   Small utilities
   -------------------------------------------------------------------------- */
.er-note { font-size: 13px; color: var(--er-text-secondary); }
.er-stack { display: flex; flex-direction: column; gap: var(--er-s3); }
.er-inline { display: flex; flex-wrap: wrap; gap: var(--er-s2); align-items: center; }

.er-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.er .ui-growl,
.er .ui-messages { max-width: 100%; }

/* ==========================================================================
   md - phone landscape / small tablet
   ========================================================================== */
@media (min-width: 600px) {
  .er-main {
    padding: var(--er-s5);
    padding-bottom: calc(var(--er-footer-h) + var(--er-s5));
  }
  .er-topbar__inner { padding: 0 var(--er-s5); }
  .er-card__header { padding: var(--er-s4) var(--er-s4) 0; }
  .er-card__body { padding: var(--er-s4); }
  .er-grid { gap: var(--er-s4); }
  .er-stat-row { gap: var(--er-s3); }
  .er-stat { padding: var(--er-s3); }
  /* Elevation returns only where the cards stop being a single stacked column. */
  .er-card, .er-habit { box-shadow: var(--er-e1); }
  .er-habit { margin-bottom: var(--er-s3); }
  .er-habit__head { padding: var(--er-s4) var(--er-s5) var(--er-s3); }
  .er-habit__body { padding: var(--er-s4) var(--er-s5) var(--er-s5); }
  .er-group { margin-bottom: var(--er-s4); }
  .er-group__legend { font-size: 12px; padding-bottom: var(--er-s3); }
  .er-row { padding: var(--er-s3) 0; }
  .er-page-head__title { font-size: 24px; }
  .er-stat-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .er-footbar__inner { padding: var(--er-s3) var(--er-s5); }
}

/* ==========================================================================
   lg - tablet / small laptop: navigation returns to the header row
   ========================================================================== */
@media (min-width: 1024px) {
  .er-burger { display: none; }
  .er-topbar__inner { height: 60px; }

  .er-navdesk {
    display: block;
    border-top: 1px solid var(--er-border);
  }

  .er-navdesk .er-nav__list {
    display: flex;
    align-items: center;
    gap: var(--er-s1);
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 var(--er-s5);
  }

  .er-navdesk .er-nav__item {
    height: 48px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
  }

  .er-navdesk .er-nav__item--active {
    background: transparent;
    border-bottom-color: var(--er-primary);
  }

  .er-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Above the tablet breakpoint the label column is given a floor so the
     controls line up down the page instead of hugging ragged label widths. */
  .er-row-inline {
    grid-template-columns: minmax(170px, 1fr) auto;
    column-gap: var(--er-s4);
  }

  /* "Akun Saya" read-only label/value rows (er-row--inline). Unchanged: that
     page's pairs only become one line from lg up. */
  .er-row--inline {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) auto;
    align-items: center;
    gap: var(--er-s4);
  }

  .er-row--inline .er-row__label { margin-bottom: 0; }
  .er-row--inline .er-row__field { justify-self: end; }

  /* Footer becomes one comfortable row */
  .er-footbar__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--er-s5);
  }

  .er-footbar__progress { flex: 1 1 auto; max-width: 420px; }
  .er-footbar__action { flex: 0 0 auto; }
  .er-btn--block { width: auto; }

  /* Single-row footer is shorter, so it needs less reserved space */
  .er { --er-footer-h: 104px; }

  /* The drawer is a mobile affordance only */
  .er-drawer,
  .er-drawer-overlay { display: none; }
}

/* ==========================================================================
   xl - desktop
   ========================================================================== */
@media (min-width: 1440px) {
  .er-main { padding-top: var(--er-s6); }
}

/* ==========================================================================
   Riwayat (views/aktivitas/list.xhtml)
   --------------------------------------------------------------------------
   One markup, two layouts (UX spec 2.5):
     base  - below lg: the table is re-laid-out as one card per record, and
             every cell carries its own visible label. No horizontal scroll.
     lg+   - a real table with a header row inside a scroll container, which
             only scrolls if the viewport is genuinely narrower than the table.
   Nothing here hides data: the same values are rendered either way.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Period filter
   -------------------------------------------------------------------------- */
.er-filter {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--er-s4);
  align-items: start;
}

.er-filter__field { min-width: 0; }

.er-filter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--er-s2);
}

/* flex-basis wins over .er-btn--block's width, so the pair sits side by side
   only when both buttons plus the gap actually fit. */
.er-filter__actions .er-btn { flex: 1 1 200px; }

/* Same pattern for the profile page's Simpan / Batal pair. */
.er-formactions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--er-s2);
  margin-top: var(--er-s5);
}

.er-formactions .er-btn { flex: 1 1 200px; }

/* --------------------------------------------------------------------------
   Akun Saya: keep the account card from stretching across a wide desktop.
   Scoped to .er-account and .er-formactions, both of which exist on that page
   only, so no other page is affected.
   -------------------------------------------------------------------------- */
@media (min-width: 600px) {
  .er-account .er-row__field { max-width: 520px; }

  /* One compact action row instead of two half-page-wide buttons. */
  .er-formactions .er-btn {
    flex: 0 1 auto;
    width: auto;
    min-width: 200px;
  }
}

/* Label beside value at tablet width and up, with the value starting right
   after the label column rather than pushed to the far edge of the card. */
@media (min-width: 768px) {
  .er-account .er-row--inline {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    gap: var(--er-s4);
    align-items: baseline;
  }

  .er-account .er-row--inline .er-row__label { margin-bottom: 0; }

  .er-account .er-row--inline .er-row__field {
    justify-self: start;
    max-width: none;
  }
}

/* --------------------------------------------------------------------------
   p:commandButton draws its own .ui-button skin, and PrimeFaces injects its
   theme stylesheet after this one, so a variant declared only as
   .er-btn--secondary loses the cascade and every button renders in the theme's
   default blue - a "Reset" that looks identical in weight to the primary
   action. These rules restore the declared variant for the buttons the Riwayat
   and Akun Saya pages own. They are deliberately scoped to those containers so
   the already-finished Aktivitas Hari Ini page is not restyled.
   -------------------------------------------------------------------------- */
.er :is(.er-filter__actions, .er-listfoot, .er-empty__actions, .er-formactions) .er-btn.ui-button {
  min-height: 44px;
  padding: 0 var(--er-s4);
  border-radius: var(--er-r-sm);
  background-image: none;
  box-shadow: none;
  text-shadow: none;
  font-family: var(--er-font);
  font-size: 15px;
  font-weight: 600;
}

.er :is(.er-filter__actions, .er-listfoot, .er-empty__actions, .er-formactions) .er-btn--primary.ui-button {
  background: var(--er-primary);
  border: 1px solid var(--er-primary);
  color: #ffffff;
}

.er :is(.er-filter__actions, .er-listfoot, .er-empty__actions, .er-formactions) .er-btn--primary.ui-button:hover {
  background: var(--er-primary-hover);
  border-color: var(--er-primary-hover);
}

.er :is(.er-filter__actions, .er-listfoot, .er-empty__actions, .er-formactions) .er-btn--secondary.ui-button {
  background: var(--er-surface-raised);
  border: 1px solid var(--er-border-strong);
  color: var(--er-text-primary);
}

.er :is(.er-filter__actions, .er-listfoot, .er-empty__actions, .er-formactions) .er-btn--secondary.ui-button:hover {
  background: var(--er-primary-subtle);
  color: var(--er-text-primary);
}

/* The PrimeFaces icon inherits the button's own text colour. */
.er :is(.er-filter__actions, .er-listfoot, .er-empty__actions, .er-formactions) .er-btn.ui-button .ui-icon,
.er :is(.er-filter__actions, .er-listfoot, .er-empty__actions, .er-formactions) .er-btn.ui-button .ui-button-icon-left {
  color: inherit;
}

/* PrimeFaces wraps the calendar input in an inline-block span; make the whole
   control fill its field and keep the picker trigger a full touch target.
   Scoped to the Riwayat filter card: Aktivitas Hari Ini also renders a
   p:calendar, and that page is finished, so it must not be restyled here. */
.er-filter .ui-calendar {
  display: block;
  width: 100%;
}

.er-filter .ui-datepicker-trigger.ui-button {
  min-height: 44px;
  width: 44px;
  margin-left: var(--er-s1);
}

/* --------------------------------------------------------------------------
   List heading and paging footer
   -------------------------------------------------------------------------- */
.er-listhead { margin-bottom: var(--er-s3); }
.er-listhead .er-note,
.er-listfoot { margin: 0; }
.er-listfoot { margin-top: var(--er-s4); }

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */
.er-empty {
  background: var(--er-surface-raised);
  border: 1px dashed var(--er-border-strong);
  border-radius: var(--er-r-md);
  padding: var(--er-s6) var(--er-s4);
  text-align: center;
}

.er-empty__icon {
  margin: 0 0 var(--er-s3);
  font-size: 30px;
  line-height: 1;
  color: var(--er-text-disabled);
}

.er-empty__title {
  margin: 0 0 var(--er-s2);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.er-empty__text {
  margin: 0 auto;
  max-width: 46ch;
  font-size: 14px;
  color: var(--er-text-secondary);
}

.er-empty__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--er-s3);
  margin-top: var(--er-s4);
}

/* --------------------------------------------------------------------------
   Akun Saya - identity block
   -------------------------------------------------------------------------- */
.er-profile {
  display: flex;
  align-items: center;
  gap: var(--er-s4);
  flex-wrap: wrap;
}

/* Monogram fallback: the only identity image the data supports is the first
   letter of the user's own name. Uppercased here so the markup can stay a
   plain substring. */
.er-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--er-primary-subtle);
  color: var(--er-primary);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.er-profile__body { min-width: 0; }

.er-profile__name {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.er-profile__username {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--er-text-secondary);
  overflow-wrap: anywhere;
}

.er-profile__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--er-s2);
  margin: var(--er-s3) 0 0;
}

/* --------------------------------------------------------------------------
   PrimeFaces selectOneMenu. Uses its own class (not the .er-input the
   Aktivitas form passes) so that page keeps the rendering it already has.
   -------------------------------------------------------------------------- */
.er .er-select.ui-selectonemenu {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--er-border-strong);
  border-radius: var(--er-r-sm);
  background: var(--er-surface-raised);
  font-family: var(--er-font);
  font-size: 16px;
}

.er .er-select.ui-selectonemenu.ui-state-focus,
.er .er-select.ui-selectonemenu.ui-state-hover {
  border-color: var(--er-focus-ring);
  box-shadow: none;
}

.er .er-select.ui-selectonemenu .ui-selectonemenu-label {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--er-s2) var(--er-s3);
  font-family: var(--er-font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--er-text-primary);
  text-overflow: ellipsis;
}

.er .er-select.ui-selectonemenu .ui-selectonemenu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  min-height: 44px;
  background: transparent;
  border: 0;
}

/* ==========================================================================
   Administrasi (views/sdi/*)
   --------------------------------------------------------------------------
   The admin area reuses the components above - cards, filter grid, tables with
   the phone card transform, flags, pills, empty state, form rows, busy strip.
   Only the pieces that are genuinely admin-specific live here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Second navigation row: the administration destinations.
   Desktop only; below lg the same links live in the drawer's "Administrasi"
   group, so there is still exactly one navigation component.
   -------------------------------------------------------------------------- */
.er-navdesk__sub { display: none; }

@media (min-width: 1024px) {
  .er-navdesk__sub {
    display: block;
    border-top: 1px solid var(--er-border);
    background: var(--er-surface-alt);
  }

  .er-navdesk__sub .er-nav__list {
    display: flex;
    align-items: center;
    gap: var(--er-s1);
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 var(--er-s5);
  }

  .er-navdesk__sub .er-nav__item {
    height: 42px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-size: 14px;
  }

  .er-navdesk__sub .er-nav__item--active {
    background: transparent;
    color: var(--er-primary);
    border-bottom-color: var(--er-primary);
  }
}

/* --------------------------------------------------------------------------
   Button variants used by admin lists and forms
   -------------------------------------------------------------------------- */
.er-btn--sm {
  min-height: 40px;
  padding: 0 var(--er-s3);
  font-size: 13px;
}

.er-btn--danger {
  background: var(--er-surface-raised);
  border-color: var(--er-danger);
  color: var(--er-danger);
}

.er-btn--danger:hover {
  background: var(--er-danger-subtle);
  border-color: var(--er-danger);
  color: var(--er-danger);
}

/* Row actions inside a table cell. Plain anchors (p:link / p:commandLink), so
   the theme's link colour has to be restated with more specificity. */
.er-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--er-s2);
}

.er .er-actions .er-btn,
.er .er-actions .er-btn:link,
.er .er-actions .er-btn:visited {
  text-decoration: none;
}

.er .er-actions .er-btn--secondary,
.er .er-actions .er-btn--secondary:link,
.er .er-actions .er-btn--secondary:visited {
  color: var(--er-text-primary);
}

.er .er-actions .er-btn--danger,
.er .er-actions .er-btn--danger:link,
.er .er-actions .er-btn--danger:visited {
  color: var(--er-danger);
}

.er .er-actions .er-btn:focus-visible {
  outline: 2px solid var(--er-focus-ring);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Inline validation message (p:message redisplay="true")
   -------------------------------------------------------------------------- */
.er .er-fieldmsg.ui-message {
  display: block;
  margin: var(--er-s2) 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--er-danger);
  font-size: 13px;
  font-weight: 600;
}

.er .er-fieldmsg .ui-message-error-detail,
.er .er-fieldmsg .ui-message-error-summary,
.er .er-fieldmsg .ui-message-error-icon {
  color: var(--er-danger);
}

/* --------------------------------------------------------------------------
   Users table: five columns, so it needs its own budget rather than the
   twelve-column habit matrix budget above.
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .er-table--users th:nth-child(1) { width: 18%; }
  .er-table--users th:nth-child(2) { width: 26%; }
  .er-table--users th:nth-child(3) { width: 24%; }
  .er-table--users th:nth-child(4) { width: 12%; }
  .er-table--users th:nth-child(5) { width: 20%; }
}

/* --------------------------------------------------------------------------
   Legend dialog. Keeps widgetVar="dlg2" and stays inside the viewport: the
   legacy dialog was a fixed 350px and its content had no scroll limit.
   -------------------------------------------------------------------------- */
.ui-dialog.er-dialog { max-width: 94vw; }

.ui-dialog.er-dialog .ui-dialog-content {
  max-height: 68vh;
  overflow-y: auto;
}

.er-legend-body .er-note { margin: 0 0 var(--er-s3); }
.er-legend-body .er-legend { margin-bottom: var(--er-s3); }
.er-legend-body .er-note:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Records - card layout (default, i.e. phones and tablets)
   -------------------------------------------------------------------------- */
.er-tablewrap {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.er-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

/* Take the table boxes out of the layout so each row can be a card. */
.er-table,
.er-table thead,
.er-table tbody,
.er-table tr,
.er-table th,
.er-table td { display: block; }

/* The header row stays in the accessibility tree (not display:none) but is
   not painted; each cell below carries its own label instead. */
.er-table thead {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.er-table tbody tr {
  margin-bottom: var(--er-s3);
  background: var(--er-surface-raised);
  border: 1px solid var(--er-border);
  border-radius: var(--er-r-md);
  box-shadow: var(--er-e1);
  overflow: hidden;
}

.er-table tbody tr:last-child { margin-bottom: 0; }

.er-td {
  padding: var(--er-s3) var(--er-s4);
  border-top: 1px solid var(--er-border);
  vertical-align: top;
}

.er-td__label {
  display: block;
  margin-bottom: var(--er-s2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--er-text-secondary);
}

/* The date cell becomes the card heading. */
.er-td--date {
  border-top: 0;
  background: var(--er-surface-sunken);
}

.er-td--date .er-td__label { display: none; }

.er-date {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   One habit, as a name plus its state. A flag is always name + value, so the
   value is never carried by colour or an icon alone.
   -------------------------------------------------------------------------- */
.er-flags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--er-s1) var(--er-s3);
}

.er-flags--text { flex-direction: column; gap: var(--er-s2); }

.er-flag {
  display: inline-flex;
  align-items: baseline;
  gap: var(--er-s2);
  min-width: 0;
  font-size: 13px;
}

.er-flag__name { color: var(--er-text-secondary); }

.er-flag__text {
  color: var(--er-text-primary);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Catatan - the 9 Golden Habits reference, as an expandable section
   (UX spec 2.7: reference content should not be a fixed-width modal)
   -------------------------------------------------------------------------- */
.er-details {
  background: var(--er-surface-raised);
  border: 1px solid var(--er-border);
  border-radius: var(--er-r-md);
  box-shadow: var(--er-e1);
  overflow: hidden;
}

.er-details__summary {
  display: flex;
  align-items: center;
  gap: var(--er-s3);
  min-height: 52px;
  padding: var(--er-s3) var(--er-s4);
  cursor: pointer;
  list-style: none;
  color: var(--er-primary);
}

.er-details__summary::-webkit-details-marker { display: none; }
.er-details__summary::marker { content: ""; }
.er-details__summary:hover { background: var(--er-primary-subtle); }

.er-details__summary:focus-visible {
  outline: 2px solid var(--er-focus-ring);
  outline-offset: -2px;
}

.er-details__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--er-text-primary);
}

.er-details__body {
  padding: var(--er-s4);
  border-top: 1px solid var(--er-border);
}

.er-legend { margin: 0 0 var(--er-s4); }

.er-legend dt {
  margin-top: var(--er-s3);
  font-size: 14px;
  font-weight: 600;
}

.er-legend dd {
  margin: var(--er-s1) 0 0;
  font-size: 14px;
  color: var(--er-text-secondary);
}

/* --------------------------------------------------------------------------
   AJAX busy indicator (p:ajaxStatus). The idle facet renders an empty span,
   so nothing is shown unless a request is actually in flight.
   -------------------------------------------------------------------------- */
.er-busy {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--er-s2);
  min-height: 40px;
  padding: var(--er-s2) var(--er-s4);
  background: var(--er-primary-subtle);
  border-bottom: 1px solid var(--er-border);
  color: var(--er-primary);
  font-size: 14px;
  font-weight: 600;
}

.er-busy--idle { display: none; }

/* ==========================================================================
   lg - the records return to a real table
   ========================================================================== */
@media (min-width: 1024px) {
  .er-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .er-filter__actions { grid-column: 1 / -1; }

  /* Only scrolls if the viewport is narrower than the table's minimum. */
  .er-tablewrap {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
  }

  .er-table {
    display: table;
    table-layout: auto;
    width: 100%;
    min-width: 1400px;
    border-collapse: collapse;
  }

  .er-table tbody tr:nth-child(even) td { background: var(--er-surface-alt); }

  .er-table thead {
    display: table-header-group;
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .er-table tbody { display: table-row-group; }
  .er-table tr { display: table-row; }

  .er-table th,
  .er-table td {
    display: table-cell;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .er-table tbody tr {
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .er-table th {
    padding: var(--er-s2) var(--er-s3);
    background: var(--er-surface-sunken);
    border-top: 0;
    border-bottom: 1px solid var(--er-border-strong);
    font-size: 12px;
    font-weight: 700;
    color: var(--er-text-secondary);
    text-align: left;
    vertical-align: bottom;
    white-space: normal;
    line-height: 1.35;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .er-table td {
    padding: var(--er-s2) var(--er-s3);
    border-top: 0;
    border-bottom: 1px solid var(--er-border);
    word-break: normal;
    overflow-wrap: break-word;
  }

  /* In a narrow column a nowrap pill cannot fit, and an element that cannot
     shrink escapes its cell. Let the status text wrap instead of clipping. */
  .er-table .er-pill {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .er-table tbody tr:nth-child(even) td { background: var(--er-surface-alt); }

  /* The header row supplies the column name, so the per-cell labels go. */
  .er-td__label { display: none; }

  .er-td--date { background: transparent; }

  /* One flag per line in the narrow columns; values stay wrapped. */
  .er-flags {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 3px;
  }

  .er-flag {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 1px var(--er-s1);
    font-size: 12px;
    line-height: 1.35;
  }

  .er-flag__name { flex: 0 1 auto; }
}

/* --------------------------------------------------------------------------
   Motion preference
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .er *,
  .er *::before,
  .er *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Compact User List (SDI - Pengguna)
   -------------------------------------------------------------------------- */
.er-user-list {
  display: flex;
  flex-direction: column;
  gap: var(--er-s2, 8px);
}

.er-user-card {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--er-surface-raised, #ffffff);
  border: 1px solid var(--er-border, #e2e8f0);
  border-radius: var(--er-r-md, 8px);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

.er-user-card:hover,
.er-user-card:focus {
  border-color: var(--er-primary, #0284c7);
  background: var(--er-surface-alt, #f8fafc);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.er-user-card__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--er-surface-alt, #f1f5f9);
  color: var(--er-primary, #0284c7);
  font-size: 1.1rem;
  margin-right: 12px;
  flex-shrink: 0;
}

.er-user-card__info {
  flex: 1;
  min-width: 0;
}

.er-user-card__name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--er-text-main, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.er-user-card__sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
  font-size: 0.825rem;
  color: var(--er-text-muted, #64748b);
}

.er-user-card__unit {
  font-weight: 500;
}

.er-user-card__dot {
  color: var(--er-border, #cbd5e1);
}

.er-user-card__arrow {
  color: var(--er-text-muted, #94a3b8);
  font-size: 0.9rem;
  margin-left: 12px;
  display: flex;
  align-items: center;
  transition: transform 0.15s ease-in-out, color 0.15s ease-in-out;
}

.er-user-card:hover .er-user-card__arrow {
  color: var(--er-primary, #0284c7);
  transform: translateX(3px);
}

/* Danger action button styling in form actions */
.er :is(.er-filter__actions, .er-listfoot, .er-empty__actions, .er-formactions) .er-btn--danger.ui-button {
  background: var(--er-surface-raised, #ffffff);
  border: 1px solid var(--er-danger, #ef4444);
  color: var(--er-danger, #ef4444);
}

.er :is(.er-filter__actions, .er-listfoot, .er-empty__actions, .er-formactions) .er-btn--danger.ui-button:hover {
  background: var(--er-danger-subtle, #fef2f2);
  border-color: var(--er-danger, #ef4444);
  color: var(--er-danger, #ef4444);
}

/* --------------------------------------------------------------------------
   Compact Table Modifier (Rekap Unit & Top 10 User)
   Maintains a single-line <tr> layout per item on mobile & desktop with a
   single <thead> header and no repeated card labels or card wrapping.
   -------------------------------------------------------------------------- */
.er-table--compact {
  display: table !important;
  width: 100% !important;
  border-collapse: collapse !important;
  table-layout: auto !important;
  font-size: 13px !important;
}

.er-table--compact thead {
  display: table-header-group !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  clip: auto !important;
  overflow: visible !important;
  white-space: nowrap !important;
  border-bottom: 2px solid var(--er-border, #cbd5e1) !important;
}

.er-table--compact thead th {
  display: table-cell !important;
  padding: 8px 10px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: var(--er-text-secondary, #64748b) !important;
  background: var(--er-surface-sunken, #f8fafc) !important;
  border: 0 !important;
}

.er-table--compact tbody {
  display: table-row-group !important;
}

.er-table--compact tbody tr {
  display: table-row !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--er-border-subtle, #f1f5f9) !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.er-table--compact tbody tr:nth-child(even) td {
  background: var(--er-surface-alt, #f8fafc) !important;
}

.er-table--compact tbody tr:last-child {
  border-bottom: 0 !important;
}

.er-table--compact tbody td {
  display: table-cell !important;
  padding: 8px 10px !important;
  border: 0 !important;
  font-size: 13px !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

.er-table--compact .er-td__label {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Top 10 User Table Specifics (No Unit column, fixed layout, text truncation)
   -------------------------------------------------------------------------- */
.er-table--top10 {
  table-layout: fixed !important;
  width: 100% !important;
}

.er-table--top10 th:nth-child(1),
.er-table--top10 td:nth-child(1) {
  width: 12% !important;
  min-width: 36px !important;
  max-width: 48px !important;
  text-align: center !important;
}

.er-table--top10 th:nth-child(2),
.er-table--top10 td:nth-child(2) {
  width: 68% !important;
  overflow: hidden !important;
}

.er-table--top10 th:nth-child(3),
.er-table--top10 td:nth-child(3) {
  width: 20% !important;
  min-width: 70px !important;
  text-align: center !important;
}

.er-user-name {
  display: block !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}

/* --------------------------------------------------------------------------
   Header Profile Button & Dropdown Popover Menu
   -------------------------------------------------------------------------- */
.er-profile-btn.ui-button {
  min-height: 40px !important;
  height: 40px !important;
  width: 40px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--er-surface-sunken, #f1f5f9) !important;
  border: 1px solid var(--er-border, #cbd5e1) !important;
  color: var(--er-text-primary, #0f172a) !important;
}

.er-profile-btn.ui-button:hover,
.er-profile-btn.ui-button:focus {
  background: var(--er-surface-alt, #e2e8f0) !important;
  border-color: var(--er-border, #94a3b8) !important;
}

.er-profile-menu.ui-menu {
  padding: 6px 0 !important;
  border-radius: 8px !important;
  border: 1px solid var(--er-border, #cbd5e1) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
  background: var(--er-surface-raised, #ffffff) !important;
  min-width: 170px !important;
  z-index: 1000 !important;
}

.er-profile-menu .ui-menuitem-link {
  padding: 9px 16px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--er-text-primary, #0f172a) !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  border-radius: 0 !important;
}

.er-profile-menu .ui-menuitem-link:hover {
  background: var(--er-surface-sunken, #f8fafc) !important;
  color: var(--er-primary, #0284c7) !important;
}

.er-profile-menu .ui-menuitem-icon {
  font-size: 16px !important;
}

/* --------------------------------------------------------------------------
   Riwayat Activity Chips (Compact Label + Color Status)
   -------------------------------------------------------------------------- */
.er-chip {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 3px 9px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 2px !important;
  line-height: 1.4 !important;
  text-align: left !important;
}

.er-chip--neutral {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
}

.er-chip--success {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}

.er-chip--danger {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
}

/* --------------------------------------------------------------------------
   Hadits Hari Ini - Floating Toast Notification
   -------------------------------------------------------------------------- */
.er-toast-hadits {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 1050;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--er-surface-raised, #ffffff);
  border: 1px solid var(--er-border, #e0e4ea);
  border-left: 4px solid var(--er-primary, #14548c);
  border-radius: var(--er-r-md, 8px);
  padding: 12px 14px;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.1);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  box-sizing: border-box;
}

.er-toast-hadits--closing {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.er-toast-hadits__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--er-s2, 8px);
  margin-bottom: 6px;
}

.er-toast-hadits__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--er-primary, #14548c);
}

.er-toast-hadits__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: -4px -4px 0 0;
  background: transparent;
  border: 0;
  border-radius: var(--er-r-sm, 4px);
  color: var(--er-text-secondary, #5b6572);
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.er-toast-hadits__close:hover {
  background: var(--er-surface-sunken, #eef0f3);
  color: var(--er-text-primary, #16202b);
}

.er-toast-hadits__text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--er-text-primary, #16202b);
  margin: 0 0 4px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.er-toast-hadits__source {
  font-size: 12px;
  color: var(--er-text-secondary, #5b6572);
  margin: 0;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: break-word;
}

@media (max-width: 600px) {
  .er-toast-hadits {
    top: 64px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}



