﻿/* Shared styles for both portals. */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@200..800&display=swap');

/* Shared iMember styles. */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
}

body {
  background: #315982;
  min-height: 100vh;
}

/* Admin portal shell (flex sidebar + centred card). */
.admin-body {
  display: flex;
}
.admin-body .main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem;
  min-height: 100vh;
}

.admin-body .content-card {
  max-width: none;
  width: 100%;
  background: white;
  border-radius: 0.5rem;
  box-shadow: none;
  padding: 1.5rem;
  transition: all 0.2s;
  margin: 0 auto;
}
/* Top bar */
.admin-body .top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-body .brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.admin-body .brand i {
  font-size: 2rem;
  color: #0b2b4a;
  background: #e3ecf5;
  padding: 0.5rem;
  border-radius: 0.5rem;
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
}
.admin-body .brand h1 {
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: -0.5px;
  color: #0b2b4a;
}
.admin-body .brand span {
  font-weight: 400;
  color: #4a6f92;
  font-size: 0.9rem;
  margin-left: 4px;
}

/* Page title */
.admin-body .page-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid #e2ebf6;
  padding-bottom: 0.9rem;
}
.admin-body .page-title i {
  font-size: 1.6rem;
  color: #1f5380;
  background: #e3edf8;
  padding: 0.5rem;
  border-radius: 0.5rem;
}
.admin-body .page-title h2 {
  font-weight: 600;
  font-size: 1.6rem;
  color: #0b2b4a;
}

/* Admin welcome banner */
.admin-body .welcome-section {
  background: linear-gradient(135deg, #0b2b4a 0%, #1a4a6e 100%);
  border-radius: 0.5rem;
  padding: 2rem 2.5rem;
  color: white;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}
.admin-body .welcome-section > div:first-child {
  flex: 1 1 300px;
  min-width: 0;
}
.admin-body .welcome-section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.4;
}
.admin-body .welcome-section h2 small {
  font-size: 1rem;
  font-weight: 400;
  color: #e7eff7;
  line-height: 1.6;
  display: block;
  margin-top: 4px;
}
.admin-body .welcome-section .date-badge {
  flex: 0 0 auto;
  margin-left: auto;
  max-width: 100%;
  background: rgba(255,255,255,0.15);
  padding: 0.5rem 1.2rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  backdrop-filter: blur(4px);
}
.admin-body .welcome-section .date-badge i {
  margin-right: 6px;
}

.highlight-amount {
  font-weight: 700;
  font-size: 1.8rem;
  color: #0b2b4a;
  line-height: 1.2;
  margin: 0.3rem 0 0.3rem;
}
.highlight-amount small {
  font-size: 1rem;
  font-weight: 500;
  color: #3d6184;
  margin-left: 4px;
}

/* Profile / detail */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  margin-top: 0.3rem;
}

.info-section {
  background: #fff;
  border-radius: 0.5rem;
  padding: 1.6rem;
  border: 1px solid #e5edf5;
}
.member-page :is(.info-section, .settings-section) h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #0b2b4a;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #dce6f2;
  padding-bottom: 0.7rem;
  margin-bottom: 1.3rem;
}
.member-page :is(.info-section, .settings-section) h2 i { color: #286394; }
/* Update note pushed to the far end of the underlined title row. */
.member-page .info-section h2 .history { margin-left: auto; font-size: 14px; }
.member-page .info-section .section-note { margin: 0 0 1.25rem; color: #587690; font-size: 0.9rem; }
.member-page .info-section .settings-section:last-child { margin-bottom: 0; }

.profile-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.5rem;
}
.profile-photo-frame {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 4px solid white;
  border-radius: 0.5rem;
  background: #e3ecf5;
  box-shadow: 0 0 0 1px #d3dfed;
}
.profile-photo-frame i {
  font-size: 3rem;
  color: #7a9bbd;
}
.profile-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem 1.5rem;
}
.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.3rem 0;
  border-bottom: 1px dashed #e1ebf5;
}
.info-item .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #587690;
  font-weight: 600;
}
.info-item .value {
  font-weight: 500;
  color: #0a2640;
  font-size: 0.95rem;
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.info-item .value i {
  color: #316a9e;
  margin-right: 4px;
  width: 1rem;
}
.full-width { grid-column: 1 / -1; }

/* Allocation accordion. */
.peruntukan-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.per-accordion {
  border: 1px solid white;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: 0.15s ease;
  background: white;
}
.per-accordion:hover {
  border-color: #c4d5ea;
}
.per-accordion-heading { margin: 0; }
.per-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1rem 1.5rem;
  cursor: pointer;
  background: #fff;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  transition: 0.15s;
  user-select: none;
}
.per-accordion-header .per-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: #113453;
  display: flex;
  align-items: center;
  gap: 10px;
}
.per-accordion-header .per-title i {
  color: #2a6a9e;
}
.per-accordion-header .badge {
  background: #dce6f2;
  padding: 0.2rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: #123a5c;
}
.per-accordion-header .arrow {
  color: #3b6286;
  transition: transform 0.25s ease;
  font-size: 1rem;
}
.per-accordion-header .arrow.open {
  transform: rotate(180deg);
}

.per-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.3s ease;
  padding: 0 1.5rem;
  background: white;
}
.per-accordion-body.open {
  max-height: 800px;
  padding: 0.2rem 1.5rem 1.5rem;
}

.per-detail {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.3rem;
}
.per-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.9rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid #f0f5fc;
  flex-wrap: wrap;
}
.per-row:last-of-type { border-bottom: none; }
.per-row .label-sm {
  min-width: 120px;
  font-weight: 500;
  color: #3b6286;
  font-size: 0.8rem;
}
.per-row .value-sm {
  color: #0a253f;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.per-row .value-sm i {
  margin-right: 6px;
  color: #2e6b9a;
  width: 1rem;
}

.address-block {
  background: #f4f9ff;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  margin: 0.3rem 0;
  border-left: 3px solid #2f6b9c;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #052139;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.address-block i {
  color: #286392;
  margin-top: 2px;
}

.per-detail .highlight-amount {
  font-size: 1.25rem;
  color: #0a2d4e;
}

/* Golden jubilee accordion. */
.per-accordion.jubli {
  background: linear-gradient(135deg, #fff9f0 0%, #fff4e3 100%);
  border-color: #eddcc5;
}
.per-accordion.jubli .per-accordion-header {
  background: transparent;
}
.per-accordion.jubli .per-accordion-header:hover {
  background: rgba(255, 255, 255, 0.35);
}
.per-accordion.jubli .per-accordion-header .per-title {
  color: #6b4a1f;
  gap: 10px;
}
.per-accordion.jubli .per-accordion-header .per-title i {
  color: #b47d4b;
}
.per-accordion.jubli .per-accordion-header .badge {
  background: #f5e9d8;
  color: #6b4a1f;
}
.per-accordion.jubli .per-accordion-body {
  background: transparent;
}
.per-accordion.jubli .per-row {
  border-bottom-color: #f0e6d8;
}
.per-accordion.jubli .per-row:last-of-type {
  border-bottom: none;
}

/* Edit profile */
.edit-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  margin-top: 0.3rem;
}
.edit-layout.single-column {
  grid-template-columns: 1fr;
}

.edit-toggle {
  background: transparent;
  border: none;
  color: #3a7aa8;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.5rem;
  transition: 0.15s;
  margin-left: 4px;
}
.edit-toggle:hover { background: #dce8f5; }

.editable-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.editable-field input {
  font-size: 0.95rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid #b8cee5;
  border-radius: 0.5rem;
  background: white;
  font-family: inherit;
  width: auto;
  min-width: 120px;
  transition: 0.1s;
}
.editable-field input:focus {
  outline: 2px solid #2f6b9c;
  border-color: transparent;
}
.editable-field .save-btn {
  background: #1f6b4a;
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.1rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}
.editable-field .save-btn:hover { background: #14553a; }
.editable-field .cancel-btn {
  background: #b0c7dd;
  color: #1a3857;
  border: none;
  border-radius: 0.5rem;
  padding: 0.1rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}
.editable-field .cancel-btn:hover { background: #9bb3cc; }
.inline-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}

/* Statement page. */
.penyata-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.penyata-card {
  background: #fff;
  border-radius: 0.5rem;
  padding: 1.8rem 1.8rem 2rem;
  border: 1px solid #e3ecf6;
  transition: 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 20, 40, 0.02);
  display: flex;
  flex-direction: column;
}
.penyata-card:hover {
  border-color: #b8cee5;
  box-shadow: 0 12px 28px -12px rgba(0, 40, 70, 0.08);
  transform: translateY(-3px);
}

.penyata-card .card-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}
.penyata-card .card-header .icon-box {
  background: #e3edf8;
  width: 44px;
  height: 44px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1f5380;
  font-size: 1.3rem;
}
.penyata-card .card-header h3 {
  font-weight: 600;
  font-size: 1.1rem;
  color: #0b2b4a;
}
.penyata-card .card-header .badge-type {
  margin-left: auto;
  background: #dce6f2;
  padding: 0.15rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: #123a5c;
  letter-spacing: 0.3px;
}

.year-selector {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: #f0f5fc;
  padding: 0.2rem 0.2rem 0.2rem 1.2rem;
  border-radius: 0.5rem;
  margin-bottom: 1.2rem;
  border: 1px solid #dce6f2;
  flex-wrap: wrap;
}
.year-selector label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #3b6286;
}
.year-selector select {
  background: white;
  border: 1px solid #c7d9ec;
  border-radius: 0.5rem;
  padding: 0.3rem 1.2rem 0.3rem 1rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: #0b2b4a;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}
.year-selector select:focus {
  border-color: #2f6b9c;
  box-shadow: 0 0 0 3px rgba(47, 107, 156, 0.15);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.btn-primary {
  background: #0b2b4a;
  color: white;
  border: none;
  padding: 0.5rem 1.8rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: 0.15s;
  box-shadow: 0 4px 10px rgba(11, 43, 74, 0.15);
}
.btn-primary:hover {
  background: #1a3f63;
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(11, 43, 74, 0.2);
}
.btn-primary:active {
  background: #06203a;
  transform: scale(0.97);
  box-shadow: inset 0 3px 7px rgba(4, 22, 38, 0.55);
  transition-duration: 0.06s;
}
.btn-primary:focus-visible {
  outline: 2px solid #2f6b9c;
  outline-offset: 3px;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid #b8cee5;
  color: #1f4b74;
  padding: 0.4rem 1.6rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: 0.15s;
}
.btn-outline:hover {
  background: #eaf1fa;
  border-color: #2f6b9c;
}

.verified-stamp {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px dashed #d8e2ef;
  font-size: 0.8rem;
  color: #3a6a8f;
  flex-wrap: wrap;
}
.verified-stamp i {
  color: #1f7a4e;
  font-size: 1rem;
}
.verified-stamp .time {
  margin-left: auto;
  background: #ecf3fa;
  padding: 0.1rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #2f5a7a;
}

/* Settings */
.settings-section {
  margin-bottom: 2rem;
}
.settings-section h3 {
  font-size: 1.1rem;
  color: #0b2b4a;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-section h3 i { color: #2a6a9e; }
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid #e3ecf6;
  color: #173b5d;
}
.setting-row:last-child { border-bottom: 0; }
.setting-row strong { display: block; color: #0b2b4a; margin-bottom: .2rem; }
.setting-row small { color: #587690; }
.setting-row select {
  border: 1px solid #c7d9ec;
  border-radius: 0.5rem;
  padding: .45rem .8rem;
  color: #0b2b4a;
  background: #fff;
  font-family: inherit;
}
.setting-row .toggle {
  appearance: none;
  width: 44px;
  height: 24px;
  background: #c7d9ec;
  border-radius: 0.5rem;
  position: relative;
  cursor: pointer;
  transition: 0.2s;
}
.setting-row .toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 0.5rem;
  top: 3px;
  left: 3px;
  transition: 0.2s;
}
.setting-row .toggle:checked {
  background: #1a6e4a;
}
.setting-row .toggle:checked::after {
  left: 23px;
}
.setting-row a.action-link {
  color: #1f5380;
  font-weight: 500;
  text-decoration: none;
}
.setting-row a.action-link:hover {
  text-decoration: underline;
}

/* Password form */
.password-warning {
  padding: 0.9rem 1rem;
  border: 1px solid #dc3545;
  border-radius: 0.5rem;
  background: #fde8ea;
  color: #a51d2b;
  font-size: 0.9rem;
  line-height: 1.5;
}
.password-warning[hidden] { display: none; }
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-group label {
  font-size: 0.85rem;
  color: #587690;
  font-weight: 500;
}
.form-group input {
  padding: 0.7rem 1rem;
  border: 1px solid #c7d9ec;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: #0b2b4a;
  transition: 0.15s;
}
.form-group input:focus {
  outline: 2px solid #2f6b9c;
  border-color: transparent;
}

/* Admin footer meta */
.admin-body .footer-meta {
  margin-top: 2.2rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid #e5eef9;
  padding-top: 1.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: #4a6d91;
}
.admin-body .footer-meta i { color: #3a7baa; margin-right: 4px; }

/* Responsive */
@media (max-width: 900px) {
  .two-col,
.edit-layout { grid-template-columns: 1fr; gap: 2rem; }
}

/* Admin: the sidebar becomes an icon rail on narrow desktops. */
@media (max-width: 820px) {
  .admin-body .sidebar {
    width: 100px;
    padding: 1.5rem 0.6rem;
    align-items: center;
  }
  .admin-body .sidebar-brand h1,
.admin-body .sidebar-brand span,
.admin-body .sidebar-nav > a span,
.admin-body .sidebar-nav .nav-group > a span,
.admin-body .sidebar-footer span,
.admin-body .nav-group > a::after {
    display: none;
  }
  .admin-body .sidebar-nav a,
.admin-body .sidebar-nav .nav-group > a {
    justify-content: center;
    padding: 0.6rem;
  }
  .admin-body .sidebar-nav a i,
.admin-body .sidebar-nav .nav-group > a i {
    margin: 0;
    font-size: 1.3rem;
  }
  .admin-body .sidebar-footer {
    align-items: center;
  }
  .admin-body .nav-group .sub-nav {
    position: absolute;
    left: calc(100% + 0.6rem);
    top: 0;
    background: #0b2b4a;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.5rem;
    padding: 0.4rem;
    min-width: 180px;
    box-shadow: 4px 4px 20px rgba(0,0,0,0.2);
    z-index: 10;
    margin: 0;
  }
  .admin-body .nav-group .sub-nav::before {
    content: '';
    position: absolute;
    left: -0.6rem;
    top: 0;
    bottom: 0;
    width: 0.6rem;
  }
  .admin-body .nav-group .sub-nav a {
    border-radius: 0.5rem;
  }
  .admin-body .sidebar-brand {
    gap: 0.4rem;
    justify-content: center;
  }
  .admin-body .main-content {
    padding: 1.2rem;
  }
  .admin-body .content-card {
    padding: 1.5rem;
  }
}

@media (max-width: 700px) {
  .admin-body .welcome-section { padding: 1.5rem; }
  .admin-body .welcome-section h2 { font-size: 1.4rem; }
  .penyata-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .admin-body .top-bar { flex-direction: column; align-items: start; }
  .admin-body .page-title { flex-wrap: wrap; }
  .admin-body .footer-meta { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

@media (max-width: 600px) {
  .info-grid { grid-template-columns: 1fr; }
  .per-row { flex-wrap: wrap; }
  .per-row .label-sm { min-width: 80px; }
  .setting-row { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
  .admin-body .sidebar {
    width: 100px;
    padding: 1rem 0.5rem;
    border-radius: 0.5rem;
  }
  .admin-body .sidebar-brand {
    gap: 0.4rem;
  }
  .admin-body .sidebar-nav a {
    padding: 0.4rem;
  }
  .admin-body .content-card {
    padding: 1rem;
  }
}

/* Shared icon alignment across all pages. */
i.fas,
i.far {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  vertical-align: middle;
}
.admin-body .brand > i,
.admin-body .sidebar-brand > i,
.admin-body .page-title > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.admin-body .page-title > i {
  width: 2.8rem;
  height: 2.8rem;
}
.search-box .clear-btn i {
  position: static;
  transform: none;
}

/* Expandable forms. */
.borang-page .search-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.borang-page .search-box { position: relative; min-width: 0; width: 100%; }
.borang-page .search-box > i {
  position: absolute; z-index: 1; top: 50%; left: 14px;
  transform: translateY(-50%); color: #6f8ba5; font-size: .9rem; pointer-events: none;
}
.borang-page .search-box input {
  width: 100%; min-height: 44px; padding: 0 3rem 0 40px;
  border: 1px solid #dfe6ec; border-radius: 0.5rem; background: #fff; color: #19385e; font: inherit;
}
.borang-page .search-box input:focus { outline: 2px solid #2f6b9c; outline-offset: -1px; border-color: #b8cee5; }
.borang-page .search-box .clear-btn {
  position: absolute; top: 50%; right: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: #8aa0b4; cursor: pointer; transform: translateY(-50%);
}
.borang-page .search-box .clear-btn:hover { color: #19385e; background: #eef4fa; }
.borang-page .filter-select {
  width: 100%; min-width: 0; min-height: 44px; padding: 0 10px;
  border: 1px solid #dfe6ec; border-radius: 0.5rem; background: #fff; color: #19385e; font: inherit;
}
.borang-page .filter-select:focus { outline: 2px solid #2f6b9c; outline-offset: -1px; border-color: #b8cee5; }
.borang-page #borangContainer { display: grid; gap: 0.75rem; }
.borang-page .form-card {
  background: white;
  border: 1px solid #dfe6ec;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(11, 43, 74, 0.04);
}
.borang-page .form-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 66px;
  padding: 1.2rem;
  color: #19385e;
  font-size: 1rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.borang-page .form-card summary::-webkit-details-marker { display: none; }
.borang-page .form-card summary i { color: #18a397; font-size: 0.85rem; transition: transform 0.2s; }
.borang-page .form-card summary:hover,
.borang-page .form-card[open] summary { background: #f1f9f8; }
.borang-page .form-card[open] summary { border-bottom: 1px solid #d6e3e8; }
.borang-page .form-card[open] summary i { transform: rotate(180deg); }
.borang-page .animated-form:not(.is-expanded) summary i { transform: rotate(0); }
.borang-page .animated-form .form-actions { transition: opacity 0.3s ease; }
.borang-page .animated-form:not(.is-expanded) .form-actions { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .borang-page .animated-form .form-actions,
.borang-page .animated-form summary i { transition: none; }
}
.borang-page .form-card summary:focus-visible { outline: 2px solid #18a397; outline-offset: -4px; }
.borang-page .form-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; padding: 1.1rem; }
/* Download chips: one shape, a colour identity per file type, everything read
   from --chip-* tokens so the night palette only has to flip the tokens. */
.borang-page .form-actions .btn-download {
  --chip-bg: #f4f2f2;
  --chip-bg-hover: #e9e4e4;
  --chip-bg-active: #ddd6d6;
  --chip-ink: #23405f;
  --chip-line: #dfe6ec;
  --chip-tile: #ffffff;
  --chip-icon: #5b7893;
  --chip-shadow: 0 1px 2px rgba(11, 43, 74, .07);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0.45rem 0.95rem 0.45rem 0.45rem;
  box-sizing: border-box;
  border: 2px solid var(--chip-line);
  border-radius: 13px;
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.25;
  text-decoration: none;
  box-shadow: var(--chip-shadow);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.borang-page .form-actions .btn-download i {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--chip-tile);
  color: var(--chip-icon);
  font-size: 1rem;
  box-shadow: inset 0 0 0 1px rgba(11, 43, 74, .08);
}
.borang-page .form-actions .online {
  --chip-bg: #eaf6ef; --chip-bg-hover: #d8ecdf; --chip-bg-active: #c6e2d1;
  --chip-ink: #14603f; --chip-line: #b6d9c4; --chip-icon: #1a8a58;
}
.borang-page .form-actions .pdf {
  --chip-bg: #fdeef0; --chip-bg-hover: #fadfe3; --chip-bg-active: #f6ccd3;
  --chip-ink: #9e2233; --chip-line: #f1c3ca; --chip-icon: #d0384e;
}
.borang-page .form-actions .word {
  --chip-bg: #eaf1fa; --chip-bg-hover: #dbe8f6; --chip-bg-active: #c9dcf0;
  --chip-ink: #174d84; --chip-line: #bcd6ef; --chip-icon: #2a72b4;
}
.borang-page .form-actions a.btn-download:hover {
  background: var(--chip-bg-hover);
  border-color: var(--chip-icon);
  transform: translateY(-2px);
  box-shadow: 0 7px 16px rgba(11, 43, 74, .16);
}
.borang-page .form-actions a.btn-download:active {
  background: var(--chip-bg-active);
  transform: translateY(1px);
  box-shadow: inset 0 2px 5px rgba(11, 43, 74, .16);
}
.borang-page .form-actions .btn-download[aria-disabled="true"] { opacity: .62; cursor: not-allowed; box-shadow: none; }
.borang-page .no-results:not([hidden]) { display: block; }
.borang-page [hidden] { display: none !important; }
@media (max-width: 600px) {
  .borang-page .search-container { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .borang-page .form-card summary { padding: 1rem; font-size: 0.95rem; }
  .borang-page .form-actions { padding: 1rem; gap: 0.5rem; }
}
/* Hide the icons that used to sit beside admin page headings. */
.admin-body .top-bar .brand > i,
.admin-body .page-title > i {
  display: none;
}

/* Page entrance animation. */
@keyframes page-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.admin-body .main-content > .content-card {
  animation: page-enter 0.35s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .admin-body .main-content > .content-card { animation: none; }
}

/* Admin sidebar slide-away collapse. */
.admin-body .sidebar {
  margin-left: 0;
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  transition: margin-left 0.5s ease-in-out, transform 0.5s ease-in-out,
    opacity 0.5s ease-in-out, visibility 0s;
}
.admin-body .sidebar.sidebar-hidden {
  margin-left: calc(-1 * var(--sidebar-width, 240px));
  transform: translateX(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: margin-left 0.5s ease-in-out, transform 0.5s ease-in-out,
    opacity 0.5s ease-in-out, visibility 0s 0.5s;
}
@media (prefers-reduced-motion: reduce) {
  .admin-body .sidebar,
.admin-body .sidebar.sidebar-hidden { transition: none; }
}
.admin-body .header-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border: none;
  border-radius: 18px;
  background: #e3ecf5;
  color: #0b2b4a;
  cursor: pointer;
}
.admin-body .brand .header-sidebar-toggle i {
  width: auto;
  height: auto;
  padding: 0;
  background: transparent;
  font-size: 1.5rem;
  color: inherit;
}
.admin-body .header-sidebar-toggle:hover { background: #d3e3f1; }
.admin-body .header-sidebar-toggle:focus-visible {
  outline: 2px solid #2f6b9c;
  outline-offset: 3px;
}
.admin-body .sidebar-brand .sidebar-logo {
  display: block;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 8px solid #1b3b59;
  border-radius: 0.5rem;
  background: #fff;
  background-clip: padding-box;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
}
/* Admin phone layout. The member shell drawer is defined in the canonical shell section. */
.admin-body .main-content,
.admin-body .content-card,
.two-col > *,
.edit-layout > * { min-width: 0; }
@media (max-width: 700px) {
  .admin-body { display: block; }
  body.mobile-menu-open { overflow: hidden; }
  .admin-body .sidebar,
.admin-body .sidebar.sidebar-hidden {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1001;
    display: flex;
    align-items: stretch;
    width: min(300px, 86vw);
    height: 100vh;
    height: 100dvh;
    padding: 1rem;
    margin-left: 0;
    border-radius: 0.5rem;
    overflow-y: auto;
    transform: translateX(-100%);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
  .admin-body .sidebar.mobile-open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
  .admin-body .sidebar-brand { justify-content: flex-start; }
  .admin-body .sidebar .sidebar-brand h1,
.admin-body .sidebar .sidebar-brand span,
.admin-body .sidebar .sidebar-nav a span,
.admin-body .sidebar .sidebar-footer span { display: block; }
  .admin-body .sidebar .sidebar-nav a { justify-content: flex-start; min-height: 44px; padding: 0.7rem; }
  .admin-body .sidebar .nav-group .sub-nav {
    display: flex;
    position: static;
    min-width: 0;
    margin: 0.2rem 0 0 1rem;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }
  .admin-body .sidebar .nav-group .sub-nav::before { display: none; }
  .admin-body .sidebar .sidebar-footer { align-items: flex-start; }
  .admin-body .mobile-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    width: 44px;
    min-height: 44px;
    border: 1px solid #587690;
    border-radius: 0.5rem;
    background: transparent;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(5, 23, 42, 0.45);
  }
  .sidebar-backdrop:not([hidden]) { display: block; }
  .admin-body .main-content { width: 100%; padding: 0.75rem; }
  .admin-body .content-card { padding: 1rem; border-radius: 0.5rem; }
  .admin-body .top-bar { gap: 1rem; margin-bottom: 1.5rem; width: 100%; }
  .admin-body .brand { width: 100%; min-width: 0; }
  .admin-body .brand h1 { font-size: 1.5rem; }
  .admin-body .brand h1 span { display: block; margin: 0.2rem 0 0; font-size: 0.85rem; }
  .admin-body .header-sidebar-toggle { width: 44px; height: 44px; border-radius: 14px; }
  .two-col,
.edit-layout,
.penyata-grid,
.info-grid {
    grid-template-columns: minmax(0, 1fr); gap: 1rem;
  }
  .info-section,
.penyata-card,
.settings-section { padding: 1rem; border-radius: 0.5rem; min-width: 0; }
  .info-item .value,
.per-row,
.footer-meta,
.address-block { overflow-wrap: anywhere; }
  .info-section h2,
.per-accordion-header .per-title { flex-wrap: wrap; }
  .admin-body .page-title h2 { font-size: 1.3rem; }
  .search-container,
.borang-page .search-container { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .search-box,
.filter-select { width: 100%; min-width: 0; }
.form-group,
.editable-field { width: 100%; min-width: 0; }
  .form-group input,
.editable-field input,
.filter-select,
.search-box input,
.year-selector select {
    max-width: 100%; min-height: 44px; font-size: 16px;
  }
  .editable-field input { width: 100%; min-width: 0; }
  .btn-primary,
.btn-outline,
.action-link,
.edit-toggle,
.save-btn,
.cancel-btn { min-height: 44px; }
  .action-row > a,
.action-row > button { flex: 1 1 130px; justify-content: center; }
  .per-row { flex-wrap: wrap; gap: 0.4rem; }
  .per-row .value-sm { min-width: 0; }
  .setting-row { flex-direction: column; align-items: flex-start; gap: 0.75rem; }

  .profile-photo-frame { width: 100px; height: 100px; }
}

/* Admin: keep the profile submenu inside the icon rail. */
@media (min-width: 701px) and (max-width: 820px) {
  .admin-body .sidebar .nav-group .sub-nav {
    display: flex;
    position: static;
    min-width: 0;
    margin: 0.4rem 0 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
  }
  .admin-body .sidebar .nav-group .sub-nav::before { display: none; }
  .admin-body .sidebar .nav-group .sub-nav a {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 0.9rem;
    padding: 0.6rem;
    text-align: center;
  }
  .admin-body .sidebar .nav-group .sub-nav a span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Login page: a dark brand panel beside the sign-in form, edge to edge. */
body.login-page, body.login-page * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Plus Jakarta Sans", sans-serif;
}
body.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  color: #0d1c2b;
}
body.login-page .login-card {
  display: grid;
  grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Brand panel. */
body.login-page .login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  min-width: 0;
  padding: clamp(2rem, 4vw, 3.25rem) clamp(1.75rem, 3.5vw, 3.5rem);
  background:
    radial-gradient(120% 90% at 88% 4%, rgba(23, 92, 148, .38) 0%, rgba(4, 7, 12, 0) 58%),
    linear-gradient(165deg, #0a141d 0%, #04070c 68%);
  color: #e8f3fb;
  overflow: hidden;
}
/* The two sweeps behind the copy are the panel's only decoration. */
body.login-page .login-hero::before,
body.login-page .login-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
body.login-page .login-hero::before { top: -540px; left: -320px; width: 1100px; height: 1100px; border: 1px solid rgba(63, 169, 224, .14); }
body.login-page .login-hero::after { right: -380px; bottom: -560px; width: 900px; height: 900px; border: 1px solid rgba(63, 169, 224, .10); }
body.login-page .login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }
body.login-page .brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 16px;
  background: #0a1622;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 10px 24px rgba(0, 0, 0, .45);
}
body.login-page .brand-mark img { display: block; width: 40px; height: 40px; }
body.login-page .brand-text { display: grid; line-height: 1.25; min-width: 0; }
body.login-page .brand-text b { font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em; color: #fff; }
body.login-page .brand-text small { font-size: .85rem; font-weight: 500; color: #7f97ab; }
body.login-page .hero-copy { position: relative; z-index: 1; max-width: 34rem; }
body.login-page .hero-eyebrow { margin-bottom: 1.1rem; font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #37b6f0; }
body.login-page .hero-copy h2 { font-size: clamp(2.1rem, 3.6vw, 3.35rem); line-height: 1.06; font-weight: 800; letter-spacing: -.02em; color: #fff; }
body.login-page .hero-copy h2 em { display: block; font-style: normal; color: #37b6f0; }
body.login-page .hero-lede { margin-top: 1.4rem; max-width: 30rem; font-size: 1.02rem; line-height: 1.65; color: #93aabd; }
body.login-page .hero-status { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; font-size: .85rem; color: #7f97ab; }
body.login-page .hero-status .rule { width: 56px; height: 1px; background: rgba(255, 255, 255, .16); }
body.login-page .status-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .16); }

/* Form panel. */
body.login-page .login-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 4vw, 3.5rem) 4.5rem;
  background: #f2f5f8;
}
body.login-page .panel-inner { width: 100%; max-width: 26rem; }
body.login-page .panel-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #dcf0fb;
  color: #0a7fc0;
  box-shadow: inset 0 0 0 1px rgba(10, 127, 192, .14);
}
body.login-page .panel-icon svg { width: 22px; height: 22px; }
body.login-page .panel-eyebrow { margin-top: 1.7rem; font-size: .76rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #0a7fc0; }
body.login-page .login-panel h1 { margin-top: .5rem; font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: #0d1c2b; }
body.login-page .panel-sub { margin-top: .6rem; font-size: .98rem; line-height: 1.6; color: #5d7288; }
body.login-page #loginForm { margin-top: 1.9rem; }
body.login-page .input-group + .input-group { margin-top: 1.05rem; }
body.login-page .input-group label { display: block; margin-bottom: .4rem; font-size: .9rem; font-weight: 600; color: #28405a; }
body.login-page .input-group input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 1rem;
  border: 1px solid #d9e3ee;
  border-radius: 12px;
  background: #fff;
  color: #12293f;
  font-size: .95rem;
  outline: none;
  box-shadow: 0 1px 2px rgba(16, 42, 67, .05);
}
body.login-page .input-group input::placeholder { color: #8ba1b6; opacity: 1; }
body.login-page .input-group input:focus-visible { border-color: #37b6f0; box-shadow: 0 0 0 4px rgba(55, 182, 240, .22); }
body.login-page .password-input-wrap { position: relative; }
body.login-page .password-input-wrap input { padding-right: 3.25rem; }
body.login-page .password-toggle { position: absolute; right: 4px; top: 4px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: #6c8095; cursor: pointer; }
body.login-page .password-toggle:hover { background: #eaf2fa; color: #0a7fc0; }
body.login-page .password-toggle:focus-visible { outline: 2px solid #0a7fc0; outline-offset: 2px; }
body.login-page .password-toggle svg { width: 21px; height: 21px; }
body.login-page .password-toggle .eye-closed { display: none; }
body.login-page .password-toggle[aria-pressed="true"] .eye-open { display: none; }
body.login-page .password-toggle[aria-pressed="true"] .eye-closed { display: block; }
body.login-page .btn-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 52px;
  margin-top: 1.6rem;
  padding: .95rem 1.15rem;
  border: 0;
  border-radius: 12px;
  background: #0d9ee6;
  color: #04222f;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(13, 158, 230, .26);
}
body.login-page .btn-login:hover { background: #2ab2f3; }
body.login-page .btn-login:focus-visible { outline: 3px solid #0a7fc0; outline-offset: 3px; }
body.login-page .btn-login svg { width: 20px; height: 20px; flex: none; }
body.login-page .password-warning { margin-top: 1.1rem; padding: .85rem 1rem; border: 1px solid #f3b6bd; border-radius: 12px; background: #fdecee; color: #a51d2b; font-size: .88rem; font-weight: 600; line-height: 1.5; }
body.login-page .password-warning[hidden] { display: none; }
body.login-page .panel-note { display: flex; align-items: center; gap: 10px; margin-top: 1.9rem; font-size: .85rem; color: #6c8095; }
body.login-page .version-tag { position: absolute; bottom: 1.6rem; left: 0; right: 0; text-align: center; font-size: .78rem; color: #8ba1b6; }
@media (max-width: 900px) {
  body.login-page .login-card { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  body.login-page .login-hero { gap: 2.25rem; padding: 2rem 1.5rem 2.5rem; }
  body.login-page .hero-copy h2 { font-size: 2rem; }
  body.login-page .hero-lede { max-width: none; }
  body.login-page .login-panel { padding: 2.5rem 1.5rem 4.5rem; }
}
/* Compact settings layout. */
.admin-body.settings-page .main-content { padding: 0.75rem; }
.admin-body.settings-page .content-card { max-width: none; padding: 1.25rem; }
.settings-page .settings-section { margin-bottom: 1.5rem; }
.settings-page .settings-section h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.settings-page .setting-row { padding: 1.15rem 0; gap: 1.25rem; }
.settings-page .setting-row > div { min-width: 0; }
.settings-page .setting-row strong { font-size: 1.1rem; line-height: 1.5; }
.settings-page .setting-row small { display: block; font-size: 0.95rem; line-height: 1.6; }
.settings-page .setting-row select,
.settings-page .setting-row :is(.action-link, .btn-primary) { font-size: 1rem; }
.settings-page .setting-row select { min-height: 44px; padding: 0.6rem 1rem; }
.settings-page .setting-row :is(.action-link, .btn-primary) { display: inline-flex; align-items: center; min-height: 44px; }
.settings-page .setting-row .toggle { flex-shrink: 0; }
@media (max-width: 700px) {
  .admin-body.settings-page .main-content { padding: 0.5rem; }
  .admin-body.settings-page .content-card { padding: 1rem; }
  .settings-page .settings-section { padding: 0; }
  .settings-page .setting-row { gap: 0.75rem; }
}
/* Responsive page content. */
.admin-body.settings-page .content-card > :is(.page-title, .settings-section, .footer-meta) {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin-inline: auto;
}
.borang-page .form-card,
.borang-page .form-actions,
.settings-page .setting-row { min-width: 0; }
.borang-page .form-card summary,
.settings-page .setting-row { overflow-wrap: anywhere; }
.borang-page .form-card summary { gap: 1rem; }
.borang-page .form-card summary i { flex-shrink: 0; }
.borang-page .form-actions .btn-download { flex: 0 1 auto; justify-content: center; }
.settings-page .setting-row select { max-width: 100%; min-width: 0; }
.settings-page .setting-row :is(.action-link, .btn-primary) { flex-shrink: 0; }
@media (max-width: 1000px) {
  .borang-page .search-container { grid-template-columns: minmax(0, 1fr); }
  .settings-page .setting-row { flex-wrap: wrap; }
  .settings-page .setting-row > div { flex: 1 1 18rem; }
}
@media (max-width: 700px) {
  .settings-page .setting-row > div { flex: none; width: 100%; }
  .settings-page .setting-row select { width: 100%; }
  .borang-page .search-box input,
  .borang-page .filter-select { font-size: 1rem; min-height: 44px; }
  .borang-page .form-actions .btn-download { flex: 1 1 7rem; }
}
@media (max-width: 400px) {
  .borang-page .form-card summary { padding: 0.875rem; }
  .borang-page .form-actions { padding: 0.75rem; }
}

/* Add spacing around admin page content. */
.admin-body:not(.admin-login) .content-card > :is(.page-title, .page-body, .footer-meta) {
  width: calc(100% - 2 * clamp(0rem, 4.5vw - 1rem, 4.5rem));
  max-width: none;
  min-width: 0;
  margin-inline: auto;
}

/* Align profile icons, labels, and values. */
.profile-page .info-section { container-type: inline-size; padding: clamp(1rem, 2vw, 2rem); border-radius: 0.5rem; }
.profile-page .info-section h2 { font-size: 1.4rem; line-height: 1.4; }
.profile-page .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.profile-page .info-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 0.625rem;
  row-gap: 0.3rem;
  padding: 1rem 0;
  min-width: 0;
  align-content: start;
  border-bottom: 1px solid #e1eaf3;
}
.profile-page .info-item .info-icon {
  grid-column: 1; grid-row: 1 / 3;
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 0.5rem;
  background: #e7f0fa; color: #286394; font-size: 0.9rem;
}
.profile-page .info-item .label { grid-column: 2; font-size: 0.8rem; line-height: 1.5; letter-spacing: 0.02em; }
.profile-page .info-item .value { grid-column: 2; display: block; min-width: 0; font-size: 1rem; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.profile-page .info-item .bank-details { display: flex; gap: 0.5rem 1rem; align-items: baseline; flex-wrap: wrap; }
.profile-page .bank-name { color: #286394; }
.profile-page .bank-account { font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  .profile-page .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 0.75rem; }
  .profile-page .info-item { grid-template-columns: minmax(0, 1fr); padding-block: 0.875rem; }
}
@media (max-width: 600px) {
  .profile-page .info-item .info-icon { grid-column: 1; grid-row: auto; width: 26px; height: 26px; font-size: 0.8rem; }
  .profile-page .info-item .label,
  .profile-page .info-item .value { grid-column: 1; }
}
/* Two-column edit profile layout. */
.edit-profile-page .editable-field { display: flex; width: 100%; min-width: 0; align-items: flex-start; gap: 0.5rem; flex-wrap: nowrap; }
.edit-profile-page .display-value { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.edit-profile-page .edit-toggle { flex-shrink: 0; min-width: 36px; min-height: 36px; margin: 0; padding: 0.4rem; }
.edit-profile-page .editable-field.is-editing { flex-direction: column; align-items: stretch; }
.edit-profile-page .editable-field .edit-input {
  width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
  padding: 0.75rem; border: 1px solid #b8cee5; border-radius: 0.5rem;
  background: #fff; color: #0a2640; font: inherit; font-size: 1rem; line-height: 1.6;
}
.edit-profile-page textarea.edit-input { min-height: 5rem; resize: vertical; overflow-y: hidden; }
.edit-profile-page .full-width textarea.edit-input { min-height: 7rem; }
.edit-profile-page .edit-input:focus { outline: 2px solid #2f6b9c; outline-offset: 1px; }
.edit-profile-page .inline-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0; }
.edit-profile-page .inline-actions button { min-height: 40px; padding: 0.5rem 1rem; font-size: 0.9rem; }
/* Give member details more space. */
@media (min-width: 901px) {
  .profile-page .two-col { grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr); gap: 1.5rem; }
}
.profile-page .two-col .per-accordion-header { gap: 0.75rem; flex-wrap: wrap; }
.profile-page .two-col .per-accordion-header .per-title { min-width: 0; overflow-wrap: anywhere; }
.profile-page .two-col .per-row { flex-wrap: wrap; }
.profile-page .two-col .per-row .value-sm { min-width: 0; overflow-wrap: anywhere; }
.profile-page .two-col .info-grid { column-gap: 2rem; }
.profile-page .two-col .column-divider { position: relative; }
.profile-page .two-col .column-divider::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 0.875rem;
  bottom: 0.875rem;
  width: 1px; background: #c3d3e3;
}
@media (max-width: 600px) {
  .profile-page .two-col .info-grid { column-gap: 1.25rem; }
  .profile-page .two-col .column-divider::before { left: -0.625rem; }
}
.edit-profile-page .field-bank { grid-column: 1; }
.edit-profile-page .field-email { grid-column: 2; position: relative; }
.edit-profile-page .column-divider::before {
  content: ''; position: absolute; left: -0.5rem;
  top: 0.875rem; bottom: 0.875rem; width: 1px; background: #c3d3e3;
}
@media (max-width: 600px) {
  .edit-profile-page .column-divider::before { left: -0.375rem; }
}
.edit-profile-page .column-divider { position: relative; }

/* Boxed member fields. */
.profile-page .info-grid,
.profile-page .two-col .info-grid { gap: 0.875rem; }
.profile-page .info-item {
  padding: 1rem;
  border: 1px solid #d5e2ee;
  border-radius: 0.5rem;
  background: #fff;
}
.profile-page .column-divider::before { display: none; }
@media (max-width: 600px) {
  .profile-page .info-grid,
  .profile-page .two-col .info-grid { grid-template-columns: minmax(0, 1fr); gap: 0.625rem; }
  .profile-page .info-item { padding: 0.75rem; }
  .edit-profile-page .field-email { grid-column: 1; }
}

/* Form styles for body.forms-system. */
/* Shared form and page styles. */


body:where(.forms-system) {
    --primary: #1c2560;
    --primary-dark: #10163e;
    --primary-light: #e8e9f5;
    --accent: #ef7d4f;
    --accent-dark: #d8632e;
    --accent-light: #fdece2;
    --danger: #c0392b;
    --danger-dark: #a12f22;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #eef0f6;
    --card-shadow: 0 20px 50px -12px rgba(16,22,62,0.22), 0 4px 14px rgba(16,22,62,0.06);
}

:where(body.forms-system) * {
    box-sizing:border-box;
}

html:where(:has(body.forms-system)) {
    scroll-behavior:smooth;
}

/* Every e-borang page mounts the member shell, so the body keeps its edges free for the
   brand panel, sidebar and top navigation; the paper canvas is .app > main. */
body:where(.forms-system) {
    font-family: "Plus Jakarta Sans", sans-serif;
    color:var(--text);
    margin:0;
    min-height:100vh;
    background:
    radial-gradient(circle at 12% 8%, rgba(28,37,96,0.14), transparent 42%),
    radial-gradient(circle at 88% 6%, rgba(239,125,79,0.16), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(28,37,96,0.08), transparent 45%),
    var(--bg);
    background-attachment:fixed;
}

:where(body.forms-system) .page-wrap {
    max-width:820px;
    margin:0 auto;
}

:where(body.forms-system) .card {
    background:#fff;
    border-radius: 0.5rem;
    box-shadow:var(--card-shadow);
    overflow:hidden;
    border:1px solid rgba(255,255,255,0.6);
    animation:forms-masuk .45s cubic-bezier(.2,.8,.2,1);
}

@keyframes forms-masuk {
    from{ opacity:0; transform:translateY(18px); }
    to{ opacity:1; transform:translateY(0); }
}

:where(body.forms-system) .header-band {
    position:relative;
    background:linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color:#fff;
    padding:38px 36px 32px 36px;
    text-align:center;
    overflow:hidden;
}

:where(body.forms-system) .header-band::before {
    content:"";
    position:absolute;
    inset:0;
    background-image:radial-gradient(rgba(255,255,255,0.10) 1.5px, transparent 1.5px);
    background-size:16px 16px;
    opacity:0.5;
}

:where(body.forms-system) .header-band::after {
    content:"";
    position:absolute;
    right:-60px;
    top:-60px;
    width:180px;
    height:180px;
    border-radius: 0.5rem;
    background:radial-gradient(circle, rgba(239,125,79,0.35), transparent 70%);
}

:where(body.forms-system) .header-band h3 {
    position:relative;
    margin:0;
    font-size:23px;
    letter-spacing:1.5px;
    font-weight:700;
}

:where(body.forms-system) .header-band span {
    position:relative;
    display:block;
    margin-top:6px;
    font-size:13px;
    opacity:0.82;
    font-weight:400;
    letter-spacing:0.2px;
}

:where(body.forms-system) .card-body {
    padding:34px 38px 38px 38px;
}

:where(body.forms-system) .badge-info {
    background:linear-gradient(0deg, #fffaf0, #fff8ea);
    border:1px solid #fde3ae;
    color:#92400e;
    padding:12px 16px;
    border-radius: 0.5rem;
    font-size:13.5px;
    margin-bottom:26px;
    display:flex;
    align-items:center;
    gap:10px;
    box-shadow:0 4px 10px rgba(217,155,20,0.08);
}

:where(body.forms-system) .form-grid {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
}

:where(body.forms-system) .form-grid.full {
    grid-template-columns:1fr;
}

:where(body.forms-system) .field {
    display:flex;
    flex-direction:column;
    gap:7px;
}

:where(body.forms-system) .field label {
    font-size:11.5px;
    font-weight:700;
    color:var(--primary);
    text-transform:uppercase;
    letter-spacing:0.6px;
    display:flex;
    align-items:center;
    gap:6px;
}

:where(body.forms-system) .field label::before {
    content:"";
    width:5px;
    height:5px;
    border-radius: 0.5rem;
    background:var(--accent);
    flex-shrink:0;
}

:where(body.forms-system) .field .value {
    font-size:14.5px;
    color:var(--text);
    padding:11px 14px;
    background:#f8f9fc;
    border-radius: 0.5rem;
    border:1px solid var(--border);
    min-height:20px;
}

:where(body.forms-system) input[type="text"],
:where(body.forms-system) input[type="date"],
:where(body.forms-system) select.gender-select,
:where(body.forms-system) select.month-select,
:where(body.forms-system) select.bank-select,
:where(body.forms-system) textarea {
    width:100%;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size:14.5px;
    padding:11px 14px;
    border:1.5px solid var(--border);
    border-radius: 0.5rem;
    outline:none;
    background:#fbfbfd;
    color:var(--text);
    transition:border-color .15s, box-shadow .15s, background .15s;
}

:where(body.forms-system) input[type="text"]:hover,
:where(body.forms-system) input[type="date"]:hover,
:where(body.forms-system) select.gender-select:hover,
:where(body.forms-system) select.month-select:hover,
:where(body.forms-system) select.bank-select:hover,
:where(body.forms-system) textarea:hover {
    border-color:#c7cbe0;
}

:where(body.forms-system) input[type="text"]:focus,
:where(body.forms-system) input[type="date"]:focus,
:where(body.forms-system) select.gender-select:focus,
:where(body.forms-system) select.month-select:focus,
:where(body.forms-system) select.bank-select:focus,
:where(body.forms-system) textarea:focus {
    border-color:var(--accent);
    background:#fff;
    box-shadow:0 0 0 4px var(--accent-light);
}

/* User input hints share a muted tone; entered values keep their normal colour. */
body:not(.admin-body) input::placeholder,
body:not(.admin-body) textarea::placeholder { color: #757575; opacity: 1; }
body:not(.admin-body) select:has(option[value=""]:checked) { color: #757575; }
body:not(.admin-body) select option { color: var(--text, #18364f); }
body:not(.admin-body) select option[value=""] { color: #757575; }

/* Keep file controls aligned with other fields. */
:where(body.forms-system) input[type="file"] {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 7px 0;
    color: var(--text);
    font: inherit;
}
:where(body.forms-system) input[type="file"]::file-selector-button {
    margin-right: 8px;
    padding: 5px 9px;
    border: 1px solid #c4ccd8;
    border-radius: 0.5rem;
    background: #f5f7fa;
    color: #36536d;
    font: inherit;
}

:where(body.forms-system) textarea {
    height:70px;
    resize:none;
}

:where(body.forms-system) .divider {
    height:1px;
    background:linear-gradient(90deg, transparent, var(--border) 15%, var(--border) 85%, transparent);
    margin:30px 0;
}

:where(body.forms-system) .letter {
    font-size:14.5px;
    line-height:1.75;
    color:var(--text);
    background:#fbfbfd;
    border:1px solid var(--border);
    border-left:3px solid var(--accent);
    border-radius: 0.5rem;
    padding:24px 26px;
}

:where(body.forms-system) .letter p {
    margin:0 0 14px 0;
}

:where(body.forms-system) .letter p:last-child {
    margin-bottom:0;
}

:where(body.forms-system) .letter .subjek {
    font-weight:700;
    color:var(--primary);
}

:where(body.forms-system) .line-input {
    width:100%;
    border:none;
    border-bottom:1.5px solid var(--border);
    padding:8px 2px;
    margin-bottom:6px;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size:14.5px;
    outline:none;
    background:transparent;
    transition:border-color .15s;
}

:where(body.forms-system) .line-input:focus {
    border-bottom-color:var(--accent);
}
.form-view-file-name { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; box-sizing: border-box; margin: 0; padding: 8px 0; color: #36536d; font: 14.5px/1.4 "Plus Jakarta Sans", sans-serif; overflow-wrap: anywhere; }
a.form-view-file-name { text-decoration: none; border-radius: 4px; transition: color 160ms ease, transform 160ms ease; }
a.form-view-file-name:hover,
a.form-view-file-name:focus-visible { color: #174b85; transform: translateY(-1px); }
a.form-view-file-name:hover > span,
a.form-view-file-name:focus-visible > span { text-decoration-thickness: 2px; }
a.form-view-file-name:focus-visible { outline: 2px solid #7aa8d2; outline-offset: 4px; }
a.form-view-file-name:active { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    a.form-view-file-name { transition: none; }
    a.form-view-file-name:hover,
    a.form-view-file-name:focus-visible { transform: none; }
}
a.form-view-file-name > span { min-width: 0; text-decoration: underline; text-underline-offset: 3px; }
.form-view-file-name i { flex-shrink: 0; font-size: 20px; color: inherit; }
body.forms-system .file-upload-row:has(.form-view-file-name) {
    display: grid;
    grid-template-columns: minmax(250px, 42%) minmax(0, 1fr);
    align-items: center;
    column-gap: 22px;
}
body.forms-system .file-upload-row:has(.form-view-file-name) .form-view-file-name { width: fit-content; max-width: 100%; justify-self: start; }

:where(body.forms-system) .draf-line {
    border-bottom:1.5px solid var(--border);
    min-height:22px;
    padding:8px 2px;
    margin-bottom:6px;
    font-size:14.5px;
}

:where(body.forms-system) .btn-row {
    display:flex;
    justify-content:center;
    gap:14px;
    margin-top:34px;
}

:where(body.forms-system) .forms-content button,
:where(body.forms-system) .forms-content .btn {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size:14.5px;
    font-weight:600;
    padding:13px 34px;
    border-radius: 0.5rem;
    border:none;
    cursor:pointer;
    transition:transform .12s ease, box-shadow .18s ease, background .18s ease;
    text-decoration:none;
    display:inline-block;
    letter-spacing:0.2px;
}

:where(body.forms-system) .forms-content button:active,
:where(body.forms-system) .forms-content .btn:active {
    transform:scale(0.96);
}

:where(body.forms-system) .btn-primary {
    background:linear-gradient(135deg, var(--accent), var(--accent-dark));
    color:#fff;
    box-shadow:0 10px 22px -6px rgba(239,125,79,0.55);
}

:where(body.forms-system) .btn-primary:hover {
    box-shadow:0 12px 26px -6px rgba(239,125,79,0.65);
    transform:translateY(-1px);
}

:where(body.forms-system) .btn-outline {
    background:#fff;
    color:var(--primary);
    border:1.5px solid var(--border);
}

:where(body.forms-system) .btn-outline:hover {
    background:var(--primary-light);
    border-color:var(--primary);
}

:where(body.forms-system) .btn-danger {
    background:linear-gradient(135deg, var(--danger), var(--danger-dark));
    color:#fff;
    box-shadow:0 10px 22px -6px rgba(192,57,43,0.5);
}

:where(body.forms-system) .btn-danger:hover {
    transform:translateY(-1px);
    box-shadow:0 12px 26px -6px rgba(192,57,43,0.6);
}

:where(body.forms-system) .overlay {
    display:none;
    position:fixed;
    inset:0;
    background:rgba(12,15,40,0.6);
    backdrop-filter:blur(3px);
    align-items:center;
    justify-content:center;
    z-index:100;
    padding:16px;
}

:where(body.forms-system) .modal-box {
    background:#fff;
    width:100%;
    max-width:380px;
    padding:34px 30px;
    border-radius: 0.5rem;
    text-align:center;
    box-shadow:0 25px 60px rgba(0,0,0,0.3);
    animation:forms-pop .2s cubic-bezier(.2,.8,.2,1);
}

@keyframes forms-pop {
    from{ transform:scale(0.9); opacity:0; }
    to{ transform:scale(1); opacity:1; }
}

:where(body.forms-system) .modal-icon {
    width:56px;
    height:56px;
    border-radius: 0.5rem;
    background:var(--accent-light);
    color:var(--accent-dark);
    display:flex;
    align-items:center;
    justify-content:center;
    margin:0 auto 18px auto;
    font-size:26px;
    font-weight:700;
    border:3px solid #fff;
    box-shadow:0 0 0 4px var(--accent-light);
}

:where(body.forms-system) .modal-box p {
    font-size:15px;
    margin:0 0 26px 0;
    color:var(--text);
    line-height:1.5;
}

:where(body.forms-system) .modal-btn-row {
    display:flex;
    justify-content:center;
    gap:12px;
}

:where(body.forms-system) .status-box {
    text-align:center;
    padding:50px 36px;
}

:where(body.forms-system) .status-icon {
    width:76px;
    height:76px;
    border-radius: 0.5rem;
    display:flex;
    align-items:center;
    justify-content:center;
    margin:0 auto 22px auto;
    font-size:36px;
    color:#fff;
    box-shadow:0 12px 26px -6px rgba(16,22,62,0.3);
}

:where(body.forms-system) .status-icon.ok {
    background:linear-gradient(135deg, var(--accent), var(--accent-dark));
}

:where(body.forms-system) .status-icon.gagal {
    background:linear-gradient(135deg, var(--danger), var(--danger-dark));
}

:where(body.forms-system) .status-box h3 {
    margin:0 0 8px 0;
    font-size:21px;
    color:var(--primary);
}

:where(body.forms-system) .status-box p {
    color:var(--muted);
    margin:0 0 30px 0;
    font-size:14.5px;
}

@media (max-width:600px) {
    :where(body.forms-system) .form-grid {
    grid-template-columns:1fr;
    }
    
    :where(body.forms-system) .card-body {
    padding:26px 22px 30px 22px;
    }
    
    :where(body.forms-system) .header-band {
    padding:28px 22px 26px 22px;
    }
    
    :where(body.forms-system) .letter {
    padding:18px 18px;
    }
}

body:where(.forms-system):is(
    .borang-bencana-entry,
    .borang-dermasiswa-entry,
    .borang-khairat-entry,
    :is(.borang-pindahmilik-strata-entry, .borang-pindahmilik-bertanah-entry),
    .borang-pinjaman-entry,
    .borang-tukar-bank-entry,
    .borang-tukar-meninggal-entry,
    .borang-tukar-sukarela-entry
) .radio-group {
    display: flex; gap: 15px; align-items: center; flex-wrap: wrap; margin-top: 10px;
}

body:where(.forms-system):is(
    .borang-bencana-entry,
    .borang-dermasiswa-entry,
    .borang-khairat-entry,
    :is(.borang-pindahmilik-strata-entry, .borang-pindahmilik-bertanah-entry),
    .borang-pinjaman-entry,
    .borang-tukar-bank-entry,
    .borang-tukar-meninggal-entry,
    .borang-tukar-sukarela-entry
) .radio-group label {
    display: flex; align-items: center; gap: 5px; font-size: 14.5px; font-weight: normal; color: var(--text); text-transform: none;
}

body:where(.forms-system):is(
    .borang-bencana-entry,
    .borang-dermasiswa-entry,
    .borang-khairat-entry,
    :is(.borang-pindahmilik-strata-entry, .borang-pindahmilik-bertanah-entry),
    .borang-pinjaman-entry,
    .borang-tukar-bank-entry,
    .borang-tukar-meninggal-entry,
    .borang-tukar-sukarela-entry
) .radio-group input[type="radio"] {
    margin: 0;
}

body:where(.forms-system):is(
    .borang-bencana-entry,
    .borang-dermasiswa-entry,
    .borang-khairat-entry,
    .borang-penama-bukan-muslim-entry,
    .borang-penama-muslim-entry,
    :is(.borang-pindahmilik-strata-entry, .borang-pindahmilik-bertanah-entry),
    .borang-pinjaman-entry,
    .borang-tukar-bank-entry,
    .borang-tukar-meninggal-entry,
    .borang-tukar-sukarela-entry
) .file-upload-row {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; font-size: 14.5px;
}

body:where(.forms-system):is(
    .borang-bencana-entry,
    .borang-dermasiswa-entry,
    .borang-khairat-entry,
    .borang-penama-bukan-muslim-entry,
    .borang-penama-muslim-entry,
    :is(.borang-pindahmilik-strata-entry, .borang-pindahmilik-bertanah-entry),
    .borang-pinjaman-entry,
    .borang-tukar-bank-entry,
    .borang-tukar-meninggal-entry,
    .borang-tukar-sukarela-entry
) .file-upload-row input[type="file"] {
    max-width: 250px; font-size: 13px;
}

body:where(.forms-system):is(
    .borang-bencana-entry,
    .borang-bencana-draft,
    .borang-dermasiswa-draft,
    .borang-khairat-draft,
    .borang-penama-bukan-muslim-draft,
    .borang-penama-muslim-draft,
    .borang-pengeluaran-syer-draft,
    :is(.borang-pindahmilik-strata-draft, .borang-pindahmilik-bertanah-draft),
    .borang-pinjaman-draft,
    .borang-tukar-alamat-draft,
    .borang-tukar-bank-draft,
    .borang-tukar-meninggal-draft,
    .borang-tukar-sukarela-draft
) .section-title {
    font-size: 16px; font-weight: 700; color: var(--primary); margin-top: 30px; margin-bottom: 15px; border-bottom: 2px solid var(--border); padding-bottom: 8px;
}

body:where(.forms-system):is(
    .borang-bencana-draft,
    .borang-dermasiswa-draft,
    .borang-khairat-draft,
    .borang-penama-bukan-muslim-draft,
    .borang-penama-muslim-draft,
    .borang-pengeluaran-syer-draft,
    :is(.borang-pindahmilik-strata-draft, .borang-pindahmilik-bertanah-draft),
    .borang-pinjaman-draft,
    .borang-tukar-alamat-draft,
    .borang-tukar-bank-draft,
    .borang-tukar-meninggal-draft,
    .borang-tukar-sukarela-draft
) .value {
    word-wrap: break-word;
}

body:where(.forms-system):is(
    .borang-dermasiswa-entry,
    .borang-khairat-entry,
    .borang-penama-bukan-muslim-entry,
    .borang-penama-muslim-entry,
    :is(.borang-pindahmilik-strata-entry, .borang-pindahmilik-bertanah-entry),
    .borang-pinjaman-entry,
    .borang-tukar-bank-entry,
    .borang-tukar-meninggal-entry,
    .borang-tukar-sukarela-entry
) .section-title {
    font-size: 16px; font-weight: 700; color: var(--primary); margin-top: 30px; margin-bottom: 15px; border-bottom: 2px solid var(--border); padding-bottom: 8px; text-transform: uppercase;
}

body:where(.forms-system).borang-dermasiswa-entry .photo-upload-area {
    text-align: center; margin: 0 auto 20px auto;
}

body:where(.forms-system).borang-dermasiswa-entry .photo-thumb {
    width: 120px; height: 140px; border: 2px dashed var(--primary); border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; text-align: center; position: relative; overflow: hidden; background: #f8f9fc; margin: 0 auto; cursor: pointer; transition: all 0.3s ease;
}

body:where(.forms-system).borang-dermasiswa-entry .photo-thumb:hover {
    background: #eef0f6; border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

body:where(.forms-system).borang-dermasiswa-entry .photo-thumb.has-photo {
    border-style: solid; border-color: var(--primary);
}

body:where(.forms-system).borang-dermasiswa-entry .photo-thumb.has-photo:hover {
    border-color: var(--accent);
}

body:where(.forms-system).borang-dermasiswa-entry .photo-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: none;
}

body:where(.forms-system).borang-dermasiswa-entry .photo-thumb .upload-label {
    display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: 11px;
}

body:where(.forms-system).borang-dermasiswa-entry .photo-thumb .upload-label svg {
    opacity: 0.5;
}

body:where(.forms-system).borang-dermasiswa-entry .photo-thumb .edit-badge {
    position: absolute; bottom: 6px; right: 6px; background: rgba(26,35,126,0.85); color: #fff; border-radius: 0.5rem; width: 26px; height: 26px; display: none; align-items: center; justify-content: center; font-size: 12px; backdrop-filter: blur(4px);
}

body:where(.forms-system).borang-dermasiswa-entry .photo-thumb.has-photo .edit-badge {
    display: flex;
}

body:where(.forms-system).borang-dermasiswa-entry .photo-thumb.has-photo .upload-label {
    display: none;
}

body:where(.forms-system).borang-dermasiswa-entry .photo-thumb input[type="file"] {
    display: none;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 9999; align-items: center; justify-content: center; backdrop-filter: blur(4px); animation: forms-fadeIn 0.2s ease;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-overlay.active {
    display: flex;
}

@keyframes forms-fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}

@keyframes forms-slideUp {
    from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); }
}

body:where(.forms-system).borang-dermasiswa-entry .crop-modal {
    background: #fff; border-radius: 0.5rem; width: 90%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); animation: forms-slideUp 0.3s ease; overflow: hidden;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-modal-header {
    padding: 18px 24px; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: space-between;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-modal-header h4 {
    margin: 0; font-size: 16px; color: #1a237e; font-weight: 600;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-modal-close {
    background: none; border: none; font-size: 22px; color: #999; cursor: pointer; padding: 4px 8px; border-radius: 0.5rem; transition: all 0.2s;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-modal-close:hover {
    background: #f5f5f5; color: #333;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-canvas-wrap {
    position: relative; width: 100%; height: 320px; background: #1a1a2e; overflow: hidden; cursor: grab; user-select: none; touch-action: none;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-canvas-wrap:active {
    cursor: grabbing;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-canvas-wrap img {
    position: absolute; transform-origin: 0 0; pointer-events: none; will-change: transform;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-guide {
    position: absolute; border: 2px solid rgba(255,255,255,0.9); border-radius: 0.5rem; pointer-events: none; z-index: 2; box-shadow: 0 0 0 9999px rgba(0,0,0,0.5); transition: box-shadow 0.2s;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-guide .grid-h,
body:where(.forms-system).borang-dermasiswa-entry .crop-guide .grid-v {
    position: absolute; background: rgba(255,255,255,0.15);
}

body:where(.forms-system).borang-dermasiswa-entry .crop-guide .grid-h {
    left: 0; right: 0; height: 1px;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-guide .grid-h:first-child {
    top: 33.33%;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-guide .grid-h:nth-child(2) {
    top: 66.66%;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-guide .grid-v {
    top: 0; bottom: 0; width: 1px;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-guide .grid-v:first-of-type {
    left: 33.33%;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-guide .grid-v:nth-of-type(2) {
    left: 66.66%;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle {
    position: absolute; width: 20px; height: 20px; z-index: 5; pointer-events: all;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle::after {
    content: ''; position: absolute; background: #fff; border-radius: 0.5rem; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle.tl {
    top: -6px; left: -6px; cursor: nw-resize;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle.tl::after {
    top: 0; left: 0; width: 16px; height: 3px; box-shadow: 0 1px 4px rgba(0,0,0,0.4), -5px 13px 0 0 #fff;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle.tl::before {
    content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 16px; background: #fff; border-radius: 0.5rem;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle.tr {
    top: -6px; right: -6px; cursor: ne-resize;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle.tr::after {
    top: 0; right: 0; width: 16px; height: 3px; box-shadow: 0 1px 4px rgba(0,0,0,0.4), 5px 13px 0 0 #fff;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle.tr::before {
    content: ''; position: absolute; top: 0; right: 0; width: 3px; height: 16px; background: #fff; border-radius: 0.5rem;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle.bl {
    bottom: -6px; left: -6px; cursor: sw-resize;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle.bl::after {
    bottom: 0; left: 0; width: 16px; height: 3px; box-shadow: 0 -1px 4px rgba(0,0,0,0.4), -5px -13px 0 0 #fff;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle.bl::before {
    content: ''; position: absolute; bottom: 0; left: 0; width: 3px; height: 16px; background: #fff; border-radius: 0.5rem;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle.br {
    bottom: -6px; right: -6px; cursor: se-resize;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle.br::after {
    bottom: 0; right: 0; width: 16px; height: 3px; box-shadow: 0 -1px 4px rgba(0,0,0,0.4), 5px -13px 0 0 #fff;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-handle.br::before {
    content: ''; position: absolute; bottom: 0; right: 0; width: 3px; height: 16px; background: #fff; border-radius: 0.5rem;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-size-label {
    position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); font-size: 11px; color: rgba(255,255,255,0.7); white-space: nowrap; pointer-events: none; font-family: "Plus Jakarta Sans", sans-serif;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-controls {
    padding: 16px 24px; background: #fafbfe; border-top: 1px solid #eee;
}

body:where(.forms-system).borang-dermasiswa-entry .zoom-row {
    display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}

body:where(.forms-system).borang-dermasiswa-entry .zoom-row svg {
    flex-shrink: 0; color: #888;
}

body:where(.forms-system).borang-dermasiswa-entry .zoom-row input[type="range"] {
    flex: 1; height: 6px; -webkit-appearance: none; appearance: none; background: #e0e0e0; border-radius: 0.5rem; outline: none; cursor: pointer;
}

body:where(.forms-system).borang-dermasiswa-entry .zoom-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px; border-radius: 0.5rem; background: #1a237e; cursor: pointer; box-shadow: 0 2px 6px rgba(26,35,126,0.3);
}

body:where(.forms-system).borang-dermasiswa-entry .zoom-row input[type="range"]::-moz-range-thumb {
    width: 20px; height: 20px; border-radius: 0.5rem; background: #1a237e; cursor: pointer; border: none;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-btn-row {
    display: flex; gap: 10px;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-btn-row button {
    flex: 1; padding: 12px; border-radius: 0.5rem; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; border: none;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-btn-cancel {
    background: #f0f0f0; color: #555;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-btn-cancel:hover {
    background: #e0e0e0;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-btn-save {
    background: #1a237e; color: #fff;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-btn-save:hover {
    background: #0d1757;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-btn-change {
    background: none; border: 1px solid #ddd !important; color: #666; font-size: 12px !important; font-weight: 500 !important; padding: 8px !important;
}

body:where(.forms-system).borang-dermasiswa-entry .crop-btn-change:hover {
    background: #f5f5f5; border-color: #bbb !important;
}

body:where(.forms-system):is(
    .borang-dermasiswa-draft,
    .borang-pinjaman-draft
) .photo-preview {
    width: 100px; height: 120px; border: 1px solid var(--border); border-radius: 0.5rem; object-fit: cover; margin-bottom: 15px; display: block; background: #eee;
}

body:where(.forms-system):is(
    :is(.borang-pindahmilik-strata-entry, .borang-pindahmilik-bertanah-entry),
    :is(.borang-pindahmilik-strata-draft, .borang-pindahmilik-bertanah-draft)
) .table-penerima {
    width: 100%; border-collapse: collapse; margin-top:15px; font-size: 14px;
}

body:where(.forms-system):is(.borang-pindahmilik-strata-entry, .borang-pindahmilik-bertanah-entry) .table-penerima th,
body:where(.forms-system):is(.borang-pindahmilik-strata-entry, .borang-pindahmilik-bertanah-entry) .table-penerima td {
    border: 1px solid var(--border); padding: 10px; text-align: left;
}

body:where(.forms-system):is(
    :is(.borang-pindahmilik-strata-entry, .borang-pindahmilik-bertanah-entry),
    :is(.borang-pindahmilik-strata-draft, .borang-pindahmilik-bertanah-draft)
) .table-penerima th {
    background: #f8f9fc;
}

body:where(.forms-system):is(.borang-pindahmilik-strata-entry, .borang-pindahmilik-bertanah-entry) .table-penerima input[type="text"],
body:where(.forms-system):is(.borang-pindahmilik-strata-entry, .borang-pindahmilik-bertanah-entry) .table-penerima textarea {
    width: 100%; border: none; outline: none; background: transparent; resize: vertical;
}

body:where(.forms-system):is(.borang-pindahmilik-strata-draft, .borang-pindahmilik-bertanah-draft) .table-penerima th,
body:where(.forms-system):is(.borang-pindahmilik-strata-draft, .borang-pindahmilik-bertanah-draft) .table-penerima td {
    border: 1px solid var(--border); padding: 10px; text-align: left;
}

body:where(.forms-system).borang-pinjaman-entry .photo-box {
    width: 120px; height: 140px; border: 2px dashed var(--primary); border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; text-align: center; position: relative; overflow: hidden; background: #f8f9fc; margin: 0 auto 20px auto; cursor: pointer; transition: all 0.2s;
}

body:where(.forms-system).borang-pinjaman-entry .photo-box:hover {
    background: #eef0f6; border-color: var(--accent);
}

body:where(.forms-system).borang-pinjaman-entry .photo-box img {
    width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; display: none;
}

body:where(.forms-system).borang-pinjaman-entry .photo-box input {
    position: absolute; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10;
}

body:where(.forms-system).borang-pinjaman-entry .photo-box span {
    font-size: 12px; color: var(--muted); padding: 10px;
}

body:where(.forms-system):is(
    .borang-tukar-meninggal-entry,
    .borang-tukar-sukarela-entry
) .waris-row {
    display: grid; grid-template-columns: 2fr 2fr 1fr 2fr; gap: 10px; margin-bottom: 10px;
}

body:where(.forms-system):is(
    .borang-tukar-meninggal-entry,
    .borang-tukar-sukarela-entry
) .waris-row input {
    padding: 8px; border: 1px solid var(--border); border-radius: 0.5rem; font-size: 13px; width: 100%; box-sizing: border-box;
}

body:where(.forms-system):is(
    .borang-tukar-meninggal-draft,
    .borang-tukar-sukarela-draft
) .waris-table {
    width:100%; border-collapse: collapse; font-size: 13.5px;
}

body:where(.forms-system).borang-tukar-meninggal-draft .waris-table th,
body:where(.forms-system).borang-tukar-meninggal-draft .waris-table td {
    border: 1px solid var(--border); padding: 8px; text-align: left;
}

body:where(.forms-system):is(
    .borang-tukar-meninggal-draft,
    .borang-tukar-sukarela-draft
) .waris-table th {
    background: #f8f9fc; color: var(--muted);
}

body:where(.forms-system).borang-tukar-sukarela-draft .waris-table th,
body:where(.forms-system).borang-tukar-sukarela-draft .waris-table td {
    border: 1px solid var(--border); padding: 8px; text-align: left;
}

:where(body.forms-system) .form-style-002.form-style-002.form-style-002 {
    text-align:center; margin-bottom: 30px; padding: 0 10px;
}

:where(body.forms-system) .form-style-003.form-style-003.form-style-003 {
    color: var(--primary); font-size: 17px; line-height: 1.5; margin: 0; font-weight: 700; text-transform: uppercase;
}

:where(body.forms-system) .form-style-004.form-style-004.form-style-004 {
    margin-top:18px;
}

:where(body.forms-system) .form-style-005.form-style-005.form-style-005 {
    margin-top:6px;
}

:where(body.forms-system) .form-style-006.form-style-006.form-style-006 {
    border:1px solid var(--border); border-radius: 0.5rem; padding:12px; height:130px; resize:vertical;
}

:where(body.forms-system) .form-style-007.form-style-007.form-style-007 {
    margin-top:34px; background:#f8f9fc; border:1px solid var(--border); border-radius: 0.5rem; padding:20px; text-align:center;
}

:where(body.forms-system) .form-style-008.form-style-008.form-style-008 {
    margin:0 0 16px 0; font-size:13.5px; color:var(--muted); font-style:italic;
}

:where(body.forms-system) .form-style-009.form-style-009.form-style-009 {
    width:100%; max-width:320px;
}

:where(body.forms-system) .form-style-010.form-style-010.form-style-010 {
    white-space:pre-line;
}

:where(body.forms-system) .form-style-011.form-style-011.form-style-011 {
    white-space:pre-line; min-height:60px;
}

:where(body.forms-system) .form-style-012.form-style-012.form-style-012 {
    margin:0 0 20px 0; font-size:13.5px; color:var(--muted); font-style:italic;
}

:where(body.forms-system) .form-style-013.form-style-013.form-style-013 {
    display:flex; justify-content:center; gap:14px;
}

:where(body.forms-system) .form-style-014.form-style-014.form-style-014,
:where(body.forms-system) .form-style-052.form-style-052.form-style-052 {
    display:none;
}

:where(body.forms-system) .form-style-015.form-style-015.form-style-015 {
    max-width:520px;
}

:where(body.forms-system) .form-style-016.form-style-016.form-style-016 {
    margin-bottom: 30px;
}

:where(body.forms-system) .form-style-017.form-style-017.form-style-017 {
    margin-top:0;
}

:where(body.forms-system) .form-style-018.form-style-018.form-style-018 {
    margin-top:20px;
}

:where(body.forms-system) .form-style-019.form-style-019.form-style-019 {
    margin-top:20px; max-width: 250px;
}

:where(body.forms-system) .form-style-020.form-style-020.form-style-020 {
    margin-top:30px; font-size:14.5px;
}

:where(body.forms-system) .form-style-021.form-style-021.form-style-021 {
    font-weight:700; color:var(--primary); margin-bottom:10px;
}

:where(body.forms-system) .form-style-022.form-style-022.form-style-022 {
    margin-top:40px;
}

:where(body.forms-system) .form-style-023.form-style-023.form-style-023 {
    margin-top:30px;
}

:where(body.forms-system) .form-style-024.form-style-024.form-style-024 {
    margin-top:15px;
}

:where(body.forms-system) .form-style-025.form-style-025.form-style-025 {
    max-width: 900px;
}

:where(body.forms-system) .form-style-026.form-style-026.form-style-026 {
    color: var(--primary); font-size: 17px; line-height: 1.5; margin: 0; font-weight: 700;
}

:where(body.forms-system) .form-style-027.form-style-027.form-style-027 {
    display:flex; justify-content:center; align-items:center; flex-direction:column;
}

:where(body.forms-system) .form-style-028.form-style-028.form-style-028 {
    margin-bottom:20px; width: 150px; text-align:center;
}

:where(body.forms-system) .form-style-029.form-style-029.form-style-029 {
    text-align:center;
}

:where(body.forms-system) .form-style-030.form-style-030.form-style-030 {
    text-align:center; font-weight:bold; margin-bottom: 30px; color: var(--primary);
}

:where(body.forms-system) .form-style-031.form-style-031.form-style-031 {
    margin-top:18px; grid-template-columns: 1fr 1fr 1fr;
}

:where(body.forms-system) .form-style-032.form-style-032.form-style-032 {
    border:1.5px solid var(--border); border-radius: 0.5rem; padding:11px; width:100%; outline:none;
}

:where(body.forms-system) .form-style-033.form-style-033.form-style-033 {
    font-size:14.5px;
}

:where(body.forms-system) .form-style-034.form-style-034.form-style-034 {
    font-size:12.5px; color:var(--muted); margin-top:15px; font-style:italic; line-height:1.6;
}

:where(body.forms-system) .form-style-035.form-style-035.form-style-035 {
    margin:0 0 16px 0; font-size:13.5px; color:var(--text); font-style:italic;
}

:where(body.forms-system) .form-style-036.form-style-036.form-style-036 {
    margin:0 0 20px 0; font-size:13.5px; color:var(--text); font-style:italic;
}

:where(body.forms-system) .form-style-037.form-style-037.form-style-037 {
    text-align:center; font-weight:bold; color:var(--primary); font-size:16px;
}

:where(body.forms-system) .form-style-038.form-style-038.form-style-038 {
    max-width: 800px;
}

:where(body.forms-system) .form-style-039.form-style-039.form-style-039 {
    flex-direction:column; align-items:flex-start; gap:8px;
}

:where(body.forms-system) .form-style-040.form-style-040.form-style-040 {
    margin-top:0; font-size:13.5px; color:var(--muted); line-height:1.6;
}

:where(body.forms-system) .form-style-041.form-style-041.form-style-041 {
    font-weight:bold;
}

:where(body.forms-system) .form-style-042.form-style-042.form-style-042 {
    text-align:center; margin-bottom: 30px;
}

:where(body.forms-system) .form-style-043.form-style-043.form-style-043 {
    font-size: 15px; color: var(--text);
}

:where(body.forms-system) .form-style-044.form-style-044.form-style-044 {
    text-align:center; margin: 30px 0;
}

:where(body.forms-system) .form-style-045.form-style-045.form-style-045 {
    font-weight:bold; color: var(--primary);
}

:where(body.forms-system) .form-style-046.form-style-046.form-style-046 {
    border-top:2px solid var(--border); margin:30px 0;
}

:where(body.forms-system) .form-style-047.form-style-047.form-style-047 {
    font-weight:bold; margin-bottom:15px;
}

:where(body.forms-system) .form-style-048.form-style-048.form-style-048 {
    border:1.5px solid var(--border); border-radius: 0.5rem; padding:11px; width:100%;
}

:where(body.forms-system) .form-style-049.form-style-049.form-style-049 {
    font-size:18px; font-weight:bold;
}

:where(body.forms-system) .form-style-050.form-style-050.form-style-050 {
    margin-top:0; line-height: 1.7;
}

:where(body.forms-system) .form-style-051.form-style-051.form-style-051 {
    margin-top:10px;
}

:where(body.forms-system) .form-style-053.form-style-053.form-style-053 {
    background:#f8f9fc; padding:20px; border-radius: 0.5rem; margin-bottom:20px;
}

:where(body.forms-system) .form-style-054.form-style-054.form-style-054 {
    font-weight:bold; color:var(--primary); margin-bottom:15px;
}

:where(body.forms-system) .form-style-055.form-style-055.form-style-055 {
    background:#f8f9fc; padding:20px; border-radius: 0.5rem;
}

:where(body.forms-system) .form-style-056.form-style-056.form-style-056 {
    background:#f8f9fc; padding:15px; border-radius: 0.5rem; margin-bottom:15px;
}

:where(body.forms-system) .form-style-057.form-style-057.form-style-057 {
    font-weight:bold; margin-bottom:10px;
}

:where(body.forms-system) .form-style-058.form-style-058.form-style-058 {
    background:#f8f9fc; padding:15px; border-radius: 0.5rem;
}

:where(body.forms-system) .form-style-059.form-style-059.form-style-059 {
    height:100px; resize:vertical; border:1px solid var(--border); border-radius: 0.5rem; padding:12px;
}

:where(body.forms-system) .form-style-060.form-style-060.form-style-060 {
    text-transform: uppercase;
}

:where(body.forms-system) .form-style-061.form-style-061.form-style-061 {
    background:#f8f9fc; padding:15px; border-radius: 0.5rem; border:1px solid var(--border);
}

:where(body.forms-system) .form-style-062.form-style-062.form-style-062 {
    background:white;
}

:where(body.forms-system) .form-style-063.form-style-063.form-style-063 {
    background:#e8f4ff; padding:15px; border-radius: 0.5rem; border:1px solid #b8daff; margin-top:15px;
}

:where(body.forms-system) .form-style-064.form-style-064.form-style-064 {
    width:100%; padding:11px; border-radius: 0.5rem; border:1.5px solid var(--border); outline:none;
}

:where(body.forms-system) .form-style-065.form-style-065.form-style-065 {
    margin-top:0; font-size:13px; color:var(--muted);
}

:where(body.forms-system) .form-style-066.form-style-066.form-style-066 {
    font-size:12px; font-weight:bold; color:var(--muted); display:grid; grid-template-columns: 2fr 2fr 1fr 2fr; gap:10px; margin-bottom:5px;
}

:where(body.forms-system) .form-style-067.form-style-067.form-style-067 {
    font-weight:bold; font-size:16px;
}


/* Navigation around the e-borang pages. */
:where(body.forms-system) .forms-main { min-width: 0; }
:where(body.forms-system) .forms-back-nav {
    display: flex;
    margin: 0 0 12px;
    padding-top: 12px;
    border-top: 1px solid #dbe7f1;
}
:where(body.forms-system) .forms-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid #dbe7f1;
    border-radius: 0.5rem;
    background: #f3f7fb;
    color: #164b7b;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: background-color .15s, border-color .15s;
}
:where(body.forms-system) .forms-back-link svg { flex-shrink: 0; }
:where(body.forms-system) .forms-back-link:hover { background: #e5eef7; border-color: #bfd2e4; }
:where(body.forms-system) .forms-back-link:focus-visible { outline: 3px solid #7aa8d2; outline-offset: 3px; }
:where(body.forms-system) .forms-back-link:active { background: #dbe8f4; }
:where(body.forms-system) .forms-content { min-width: 0; font-family: "Plus Jakarta Sans", sans-serif; }
/* Keep icon fonts intact when applying the form text font. */
:where(body.forms-system) .forms-content :not(:where(.fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands)) { font-family: inherit; }
/* Full-width forms. */
:where(body.forms-system).forms-system .forms-main .forms-content .page-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
}
:where(body.forms-system) .forms-content .page-wrap > .card {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    animation: none;
}
:where(body.forms-system) .forms-content .card-body { padding: 12px 0 0; }
:where(body.forms-system) .forms-content .header-band {
    background: transparent;
    color: var(--primary);
    padding: 0 0 8px;
    border-bottom: 1px solid var(--border);
}
:where(body.forms-system) .forms-content .header-band::before,
:where(body.forms-system) .forms-content .header-band::after { display: none; }

/* Admin tables and forms. */
body.admin-body { display:flex; background:#eef3f9; color:#18364f; margin:0; padding:0; }
.admin-body .admin-eyebrow { font-size:10px; letter-spacing:1.7px; font-weight:700; color:#54778e; margin-bottom:8px; }
.admin-body .page-body { min-width:0; }
.admin-body .page-body h2 { font-size:20px; margin:0 0 14px; color:#0b2b4a; }
.admin-body .page-body p { margin:12px 0; }
.admin-body .page-body a { color:#21618c; text-decoration:none; font-weight:600; }
.admin-body .page-body a:hover { color:#174b78; text-decoration:none; }
.admin-body .page-body form { margin:16px 0; }
.admin-body .page-body form[method="get"] { display:flex; flex-wrap:wrap; align-items:end; gap:12px; padding:16px; background:#f6f9fc; border:1px solid #e1e9f0; border-radius: 0.5rem; }
.admin-body .page-body label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:600; }
.admin-body:not(.settings-page) .page-body input:not([type="hidden"]), .admin-body:not(.settings-page) .page-body select { min-height:44px; border:1px solid #c9d8e4; border-radius: 0.5rem; padding:10px 13px; background:white; color:#18364f; font:inherit; max-width:100%; }
.admin-body:not(.settings-page) .page-body input:not([type="hidden"]) { width:min(100%,480px); }
.admin-body .page-body form[method="get"] > input { flex:1 1 220px; }
.admin-body .page-body button { border:1px solid #1e577f; background:#1e577f; color:white; padding:10px 18px; border-radius: 0.5rem; min-height:44px; font:inherit; font-weight:600; cursor:pointer; }
.admin-body .page-body button:hover { background:#123e60; }
.admin-body :is(a,button,input,select):focus-visible { outline:3px solid #36a3bd; outline-offset:3px; }
.admin-body .admin-table-wrap { width:100%; overflow-x:auto; border:1px solid #dfe8f0; border-radius: 0.5rem; margin:16px 0; }
.admin-body table { width:100%; border-collapse:collapse; border:0; font-size:13px; }
.admin-body th { padding:4px 6px; background:#f0f5fa; color:#375b75; text-align:left; border:0; border-bottom:1px solid #dfe8f0; white-space:nowrap; font-weight:600; }
.admin-body td { padding:4px 6px; border:0; border-bottom:1px solid #eaf0f5; vertical-align:top; }
.admin-body tr:last-child td { border-bottom:0; }
.admin-body tr:hover td { background:#f7fbfd; }
.admin-body td form { display:inline-block; margin:0 0 0 10px!important; }
.admin-body td button:not(.admin-action) { font-size:12px!important; min-height:34px!important; padding:6px 10px!important; }
.admin-body .admin-details th { width:30%; white-space:normal; }
.admin-body .admin-details td { overflow-wrap:anywhere; }
.admin-body .page-body > a { display:inline-block; padding:7px 12px; background:#edf4fa; border-radius: 0.5rem; margin:4px 4px 4px 0; }
.admin-body [role="alert"] { padding:12px 16px; background:#fff0f0; border-left:3px solid #b54141; border-radius: 0.5rem; color:#8e2929; }
.skip-link { position:fixed; top:-80px; left:12px; z-index:100; background:white; padding:12px; color:#0b2b4a; }
.skip-link:focus { top:12px; }
body.admin-login { min-height:100dvh; align-items:center; justify-content:center; padding:32px; background:linear-gradient(125deg,#e5eff8,#f6f9fc); }
.admin-login-layout { width:100%; max-width:1000px; display:grid; grid-template-columns:1fr 1fr; gap:60px; align-items:center; }
.admin-login-brand img { width:86px; height:86px; object-fit:contain; margin-bottom:24px; }
.admin-login-brand h1 { font-size:54px; letter-spacing:-2px; line-height:1.15; color:#0b2b4a; margin:14px 0 20px; }
.admin-login-brand h1 span { display:block; font-size:24px; letter-spacing:0; font-weight:400; margin-top:12px; }
.admin-login-brand > p:last-child { color:#54718a; max-width:330px; font-size:16px; }
.admin-body .admin-login-card { padding:36px; box-shadow:0 16px 60px #0b2b4a0b; }
.admin-login-card h2 { font-size:26px; color:#0b2b4a; margin-bottom:24px; }
.admin-login-card .page-body button { width:100%; }
.admin-login-card .page-body input { width:100%!important; }
@media(max-width:900px) {
 .admin-login-layout { gap:30px; }
}
@media(max-width:700px) {
 .admin-body th,.admin-body td { padding:4px 6px; }
 .admin-body .admin-details th { width:38%; }
 body.admin-login { padding:20px; }
 .admin-login-layout { display:block; max-width:460px; }
 .admin-login-brand { text-align:center; margin:12px 0 24px; }
 .admin-login-brand img { width:62px; height:62px; margin-bottom:8px; }
 .admin-login-brand h1 { font-size:32px; margin:6px 0; }
 .admin-login-brand h1 span { font-size:18px; margin-top:6px; }
 .admin-login-brand > p:last-child { display:none; }
 .admin-body .admin-login-card { padding:24px; }
}

/* Admin account settings. */
.admin-body .admin-settings { max-width: 960px; }
.admin-body .admin-settings .settings-section { margin: 22px 0; padding: 22px; border: 1px solid #dfe8f0; border-radius: 0.5rem; background: #fff; }
.admin-body .admin-settings .setting-row { gap: 24px; }
.admin-body .admin-settings small { display: block; color: #587690; margin-top: 5px; }
.admin-body .admin-settings .settings-success { padding: 12px 16px; border-left: 3px solid #34805a; border-radius: 0.5rem; color: #246547; background: #e9f5ef; }
.admin-body .admin-settings summary { cursor: pointer; padding: 14px 0; color: #21618c; font-weight: 600; }
.admin-body .admin-settings summary:focus-visible { outline: 3px solid #36a3bd; outline-offset: 3px; }
@media (max-width: 700px) {
    .admin-body .admin-settings .settings-section { padding: 16px; }
    .admin-body .admin-settings .setting-row { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* Sign-in language choice. */
.admin-body .login-language { position: absolute; top: 18px; right: 24px; font-size: 13px; color: #587690; }
.admin-body .login-language a { color: #21618c; text-decoration: none; padding: 8px 4px; display: inline-block; }
.admin-body .login-language a[aria-current] { font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

/* Shared presentation utilities. */
.profile-row-label { display:flex; align-items:center; gap:12px; }
/* One amber for "recorded, not yet approved", read the same way on both member screens. */
.status-tunggu { color: #8a6414; }
.statement-heading { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.statement-title { font-weight: 700; font-size: 1.1rem; color: #0b2b4a; }
.statement-verified { color: #1f7a4e; }
.password-warning.password-success { color: #166534; background-color: #dcfce7; border-color: #86efac; }
/* Keep admin controls aligned with the shared layout. */
.admin-body .sidebar-footer small { color: #b1c8dc; }
.admin-body .page-body { padding: 0; }
.admin-body .page-title { flex-wrap: wrap; }


/* Admin record actions. */
.admin-body .admin-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 18px 0;
}
.admin-body .page-body .admin-pagination :is(a, .pagination-current) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 4px 10px;
    box-sizing: border-box;
    border: 1px solid #cbd8e4;
    border-radius: 0.5rem;
    background: #f5f8fc;
    color: #18364f;
    font-size: 13px;
    font-weight: 600;
}
.admin-body .page-body .admin-pagination a:hover { background: #e5effa; }
.admin-body .page-body .admin-pagination .pagination-current {
    background: #dceaf6;
    border-color: #8baec9;
}
.admin-body .admin-pagination .pagination-gap { padding: 0 3px; color: #54718a; }
.admin-body .page-body .admin-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    margin: 4px 0;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}
.admin-body .page-body .admin-action-view { background: #e5effa; color: #174b78; border-color: #bdd2e8; }
.admin-body .page-body .admin-action-view:hover { background: #cfe2f5; }
.admin-body .page-body .admin-action-edit { background: #e4f3eb; color: #226344; border-color: #b5d9c4; }
.admin-body .page-body .admin-action-edit:hover { background: #cce8d8; }
.admin-body .admin-no-record { color: #64748b; font-style: italic; }


/* Align the catalogue title and add action. */
.admin-body .admin-list-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.admin-body .admin-list-heading h2 { margin: 0; }
.admin-body .page-body .admin-action-add { background: #1e577f; color: #fff; gap: 8px; border-color: #1e577f; }
.admin-body .page-body .admin-action-add:hover { background: #123e60; }

/* Use the member settings layout for admin settings. */
.admin-body.settings-page .page-body { padding: 0; }
.admin-body.settings-page .settings-content { width: 100%; min-width: 0; }
.admin-body.settings-page .settings-language-form { margin: 0; }
.admin-body.settings-page .setting-row .action-link { color: #1f5380; }
.admin-body.settings-page .settings-success { padding: 12px 16px; color: #246547; background: #e9f5ef; border-radius: 0.5rem; }

/* Match the shared mobile container. */
@media (max-width: 700px) {
  body.admin-body:not(.admin-login) { display: block; }
}

/* Soft admin action colours coordinated with the existing pastel buttons. */
.admin-body .page-body .admin-action {
    --action-bg: #e5effa;
    --action-hover: #cfe2f5;
    --action-text: #174b78;
    --action-border: #bdd2e8;
    min-height: 44px;
    min-width: 44px;
    gap: 8px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    vertical-align: middle;
    background: var(--action-bg);
    border-color: var(--action-border);
    color: var(--action-text);
}
.admin-body .page-body :is(.admin-action-add, .admin-action-save) {
    --action-bg: #e4f3eb;
    --action-text: #226344;
    --action-border: #b5d9c4;
    --action-hover: #cce8d8;
}
.admin-body .page-body .admin-action-edit {
    --action-bg: #e5effa;
    --action-text: #174b78;
    --action-border: #bdd2e8;
    --action-hover: #cfe2f5;
}
.admin-body .page-body .admin-action-download {
    --action-bg: #e4f1ef;
    --action-text: #285e59;
    --action-border: #b9d7d2;
    --action-hover: #d2e7e3;
}
.admin-body .page-body .admin-action-back {
    --action-bg: #eef1f5;
    --action-text: #475569;
    --action-border: #cbd5e1;
    --action-hover: #e0e6ed;
}
.admin-body .page-body .admin-action:hover {
    background: var(--action-hover);
    border-color: var(--action-border);
    color: var(--action-text);
    text-decoration: none;
}
.admin-body .page-body .admin-action:focus-visible {
    outline: 3px solid #0f172a;
    outline-offset: 3px;
    box-shadow: 0 0 0 3px #ffffff;
}
.admin-body .page-body .admin-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    text-decoration: none;
}

/* Keep list actions on one line and centre them beneath the column heading. */
.admin-body .page-body .admin-action-view,
.admin-body .page-body .admin-action-edit {
    min-width: 76px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}
.admin-body table:not(.admin-details) th:last-child,
.admin-body table:not(.admin-details) td:last-child {
    width: 1%;
    min-width: 124px;
    text-align: center;
    white-space: nowrap;
    padding-left: 6px;
    padding-right: 6px;
    vertical-align: middle;
}
/* Attachment filenames can wrap without affecting list buttons. */
.admin-body .admin-details .admin-action-view {
    white-space: normal;
    overflow-wrap: anywhere;
}
/* Catalogue columns share available space without pushing actions outside. */
.admin-body .admin-catalogue-table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}
.admin-catalogue-table .catalogue-name { width: 27%; }
.admin-catalogue-table .catalogue-status { width: 100px; }
.admin-catalogue-table .catalogue-actions { width: 112px; }
.admin-body .admin-catalogue-table :is(th, td) {
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: middle;
}
.admin-body table.admin-catalogue-table :is(th, td):last-child {
    width: auto;
    min-width: 0;
    padding: 4px 6px;
    white-space: normal;
}
.admin-body .admin-catalogue-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
}
.admin-body .admin-catalogue-actions form {
    margin: 0 !important;
    padding: 0;
    flex: 0 0 auto;
}
.admin-body .page-body .admin-catalogue-actions .admin-action {
    margin: 0;
    padding: 3px 8px;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    flex-shrink: 0;
}
@media (max-width: 700px) {
    .admin-catalogue-table .catalogue-name { width: 24%; }
    .admin-catalogue-table .catalogue-status { width: 65px; }
    .admin-catalogue-table .catalogue-actions { width: 112px; }
    .admin-body .admin-catalogue-table :is(th, td),
    .admin-body table.admin-catalogue-table :is(th, td):last-child { padding: 4px 6px; }
}

/* Compact admin table spacing. */
.admin-body .page-body table { line-height: 1.4; }
.admin-body .page-body table td .admin-action {
    min-height: 28px;
    padding: 3px 8px;
    margin: 0;
    gap: 4px;
    border-radius: 0.5rem;
}
.admin-body .page-body table td p { margin: 0; }

/* Catalogue and search buttons. */
.admin-body .page-body :is(.admin-action-add, .admin-action-search) {
    --action-bg: #205a80;
    --action-text: #ffffff;
    --action-border: #205a80;
    --action-hover: #184766;
    background: var(--action-bg);
    color: var(--action-text);
    border-color: var(--action-border);
    border-radius: 0.5rem;
    padding: 10px 20px;
    white-space: nowrap;
}
/* Centre catalogue status between the title and actions columns. */
.admin-body .admin-catalogue-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
}
.admin-body .admin-status-dot {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-radius: 0.5rem;
}
.admin-body .admin-catalogue-status.is-active .admin-status-dot { background: #27834b; }
.admin-body .admin-catalogue-status.is-inactive .admin-status-dot { background: #c44242; }
.admin-body .admin-submission-status { white-space: nowrap; }
.admin-body .admin-catalogue-table th:nth-child(3),
.admin-body .admin-catalogue-table td:nth-child(3) {
    text-align: center;
}
/* Subtle column separators matching the admin table borders. */
.admin-body .admin-table-wrap table th:not(:last-child),
.admin-body .admin-table-wrap table td:not(:last-child) {
    border-right: 1px solid #dfe8f0;
}
/* Member and submission detail labels occupy one third; values occupy two thirds. */
.admin-body :is(.admin-member-details, .admin-submission-details) .admin-details {
    table-layout: fixed;
    width: 100%;
}
.admin-body :is(.admin-member-details, .admin-submission-details) .admin-details tr > :first-child {
    width: 33.333333%;
}
.admin-body :is(.admin-member-details, .admin-submission-details) .admin-details tr > :nth-child(2) {
    width: 66.666667%;
}
.admin-body :is(.admin-member-details, .admin-submission-details) .admin-details :is(th, td) {
    box-sizing: border-box;
    padding: 8px 10px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
}
/* Match the catalogue status selector to the other edit fields. */
.admin-body:not(.settings-page) .page-body select.admin-catalogue-status-input {
    width: min(100%, 480px);
}
/* Consistent compact attachment controls without long filenames. */
.admin-body .admin-attachment-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.admin-body .page-body .admin-attachment-actions .admin-action {
    margin: 0;
    min-height: 44px;
    white-space: nowrap;
    overflow-wrap: normal;
    flex: 0 0 auto;
}
.admin-body .page-body .admin-attachment-actions .admin-action-view { min-width: 80px; }
.admin-body .page-body .admin-attachment-actions .admin-action-download { min-width: 136px; }
/* Shared change-password layout for members and administrators. */
.admin-body .content-card > :is(.page-title, .password-settings, .footer-meta) {
  width: calc(100% - 2 * clamp(0rem, 4.5vw - 1rem, 4.5rem));
  max-width: none; min-width: 0; margin-inline: auto;
}
.password-settings > p { margin: 12px 0; }
.password-settings .admin-password-form { max-width: 540px; margin: 16px 0; }
:is(.password-page, .admin-body) .password-settings .admin-password-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.password-settings .settings-cancel { display: inline-block; margin-left: 16px; color: #21618c; text-decoration: none; font-weight: 600; }
.password-settings .settings-cancel:hover { color: #174b78; text-decoration: none; }
.password-settings { max-width: 960px; }
.password-settings .settings-section { box-sizing: border-box; width: 100%; max-width: 586px; margin: 22px 0; padding: 22px; border: 1px solid #dfe8f0; border-radius: 0.5rem; background: #fff; }
.password-settings .form-group { margin-bottom: 20px; }
.password-settings .form-group input { width: 100%; box-sizing: border-box; }
/* Override the admin's generic input/button rules so the eye stays inside the field. */
.password-settings .password-input { position: relative; width: 100%; }
:is(.password-page, .admin-body) .password-settings .admin-password-form .form-group .password-input input { width: 100%; max-width: 100%; box-sizing: border-box; min-height: 44px; border: 1px solid #c9d8e4; border-radius: 0.5rem; padding: 10px 48px 10px 13px; background: #fff; color: #18364f; font: inherit; }
:is(.password-page, .admin-body) .password-settings .admin-password-form .password-visibility {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; min-width: 0; min-height: 0; margin: 0; padding: 0;
  border: none; border-radius: 0.5rem; background: transparent; box-shadow: none;
  color: #52789b; cursor: pointer; line-height: 1; appearance: none;
}
:is(.password-page, .admin-body) .password-settings .admin-password-form .password-visibility:hover { background: transparent; color: #174b78; }
:is(.password-page, .admin-body) .password-settings .admin-password-form .password-visibility:focus-visible { outline: 2px solid #2f6b9c; outline-offset: -3px; }
.password-settings .password-visibility svg { display: block; width: 18px; height: 18px; flex-shrink: 0; pointer-events: none; }
/* The back-to-settings button is one control shared by every sub-page of Tetapan, so it is keyed
   on the member shell rather than on the password page's own wrapper. */
body.member-page .password-back { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 0.5rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; color: #475569; background: #eef1f5; }
.password-settings .admin-password-form .password-save { min-height: 44px; }
body.member-page .password-back:hover { background: #e0e6ed; }
/* Member submission history. */
.form-history-page .history-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-inline: auto;
  box-sizing: border-box;
}
.admin-body .admin-submission-response {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 22px 0 0;
    padding: 28px;
    border: 1px solid #dfe8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
}
.admin-body .admin-submission-response h3 { margin: 0 0 18px; color: #0b2b4a; font-size: 16px; font-weight: 700; }
.admin-body .admin-submission-response label { margin-bottom: 14px; }
.admin-body .admin-response-fields { display: grid; grid-template-columns: minmax(210px, 28%) minmax(0, 1fr); gap: 24px; align-items: start; }
.admin-body .admin-response-fields label { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.admin-body .admin-submission-response select { width: 100%; box-sizing: border-box; }
.admin-body .admin-submission-response > form { margin: 0; }
@media (max-width: 640px) {
    .admin-body .admin-response-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .admin-body .admin-submission-response select { max-width: 210px; }
}
.admin-body .admin-submission-response textarea { width: 100%; box-sizing: border-box; resize: none; overflow-y: auto; border: 1px solid #c9d8e4; border-radius: 0.5rem; padding: 10px 13px; background: #fff; color: #18364f; font: inherit; line-height: 24px; }
.admin-body .admin-response-fields select,
.admin-body .admin-response-fields textarea { height: 46px; min-height: 46px; max-height: 46px; }
.admin-body .admin-response-required { color: #c53e3e; }
.admin-body .admin-response-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.admin-body .admin-response-actions .admin-action { min-width: 105px; min-height: 42px; justify-content: center; }
.form-history-page .history-table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; margin: 14px 0; box-sizing: border-box; border: 1px solid #dfe8f0; border-radius: 0.5rem; }
.form-history-page .history-table { width: 100%; min-width: 620px; table-layout: fixed; border-collapse: collapse; font-size: 14px; color: #18364f; }
.form-history-page .history-col-number { width: 7%; }
.form-history-page .history-col-form { width: 43%; }
.form-history-page .history-col-date { width: 20%; }
.form-history-page .history-col-status { width: 18%; }
.form-history-page .history-col-action { width: 12%; }
.form-history-page .history-table :is(th, td) { padding: 10px 12px; text-align: left; vertical-align: middle; line-height: 1.5; overflow-wrap: anywhere; border-bottom: 1px solid #e4ebf2; }
.form-history-page .history-table :is(th, td):first-child { text-align: center; }
.form-history-page .history-table :is(th, td):nth-child(3),
.form-history-page .history-table :is(th, td):nth-child(4),
.form-history-page .history-table :is(th, td):nth-child(5) { text-align: center; }
.form-history-page .history-table th { background: #f0f5fa; font-weight: 600; white-space: nowrap; }
.form-history-page .history-table tr:last-child td { border-bottom: 0; }
.form-history-page .history-table tbody tr:hover { background: #f7fafc; }
.form-history-page .history-sent { display: inline-block; max-width: 100%; padding: 3px 9px; box-sizing: border-box; border: 1px solid #c3dacd; border-radius: 0.5rem; background: #edf6f0; color: #285c40; white-space: nowrap; }
.form-history-page .history-pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.form-history-page .history-pending { background: #fff7e8; border-color: #e6d4ad; color: #72551f; }
.form-history-page .history-received { background: #edf4fb; border-color: #c5d8eb; color: #275579; }
.form-history-page .history-view-button { display: inline-flex; align-items: center; justify-content: center; min-width: 76px; min-height: 34px; padding: 6px 12px; box-sizing: border-box; border: 1px solid #bdd2e8; border-radius: 0.5rem; background: #e5effa; color: #174b78; font-weight: 600; line-height: 1.3; text-decoration: none; white-space: nowrap; }
.form-history-page .history-view-button:hover { background: #cfe2f5; }
.form-history-page .history-pagination :is(a, [aria-current]) { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 34px; padding: 4px 10px; box-sizing: border-box; border: 1px solid #cbd8e4; border-radius: 0.5rem; background: #f5f8fc; color: #18364f; text-decoration: none; }
.form-history-page .history-pagination [aria-current] { background: #dceaf6; border-color: #8baec9; font-weight: 600; }
.form-history-page .history-pagination a:hover { background: #e5effa; }
.form-history-page :is(.history-pagination a, .history-table-wrap):focus-visible { outline: 2px solid #21618c; outline-offset: 3px; }
@media (max-width: 640px) {
  body.forms-system .file-upload-row:has(.form-view-file-name) { grid-template-columns: 1fr; row-gap: 8px; }
  .password-settings .settings-section { max-width: 574px; padding: 16px; }
}

/* Date inputs keep ISO values for submission and show day/month/year. */
.date-field { position: relative; display: flex; width: 100%; min-width: 0; align-items: center; }
.date-field > input[type="text"] { width: 100%; min-width: 0; box-sizing: border-box; padding-right: 44px; }
body .date-field > .date-field-source { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
body .date-field > .date-field-calendar { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 4px; background: transparent; color: #64748b; cursor: pointer; }
body .date-field > .date-field-calendar:hover { color: #174b85; background: #e5effa; }
body .date-field > .date-field-calendar:focus-visible { outline: 2px solid #7aa8d2; outline-offset: 2px; }
body .date-field > .date-field-calendar:disabled { opacity: 0.5; cursor: default; background: transparent; }

/* Submission processing history. */
.admin-body .admin-progress { margin-top: 28px; padding-top: 24px; border-top: 1px solid #dfe8f0; }
.admin-body .admin-submission-response > .admin-progress:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.admin-body .admin-progress .admin-table-wrap { border: 1px solid #dfe8f0; border-radius: 0.5rem; overflow-x: auto; }
.admin-body .page-body table.admin-progress-table :is(th, td) { padding: 12px 14px; vertical-align: top; text-align: left; overflow-wrap: anywhere; white-space: normal; }
.admin-body .admin-progress-status { display: inline-block; padding: 4px 9px; border: 1px solid #c5d8eb; border-radius: 0.5rem; background: #edf4fb; color: #275579; line-height: 1.5; }
.admin-body .admin-progress-status--sedang_dimajukan { background: #fff3d6; border-color: #efd28e; color: #72551f; }
.admin-body .admin-progress-status--selesai { background: #edf6f0; border-color: #c3dacd; color: #285c40; }
.admin-body .page-body table.admin-progress-table { width: 100%; min-width: 640px; table-layout: fixed; }
.admin-body .page-body table.admin-progress-table th:nth-child(1) { width: 22%; }
.admin-body .page-body table.admin-progress-table th:nth-child(2) { width: 16%; }
.admin-body .page-body table.admin-progress-table th:nth-child(3) { width: 22%; }
.admin-body .page-body table.admin-progress-table :is(th, td):last-child { width: 40%; min-width: 0; white-space: normal; text-align: left; overflow-wrap: anywhere; }



/* ==========================================================================
   Canonical shell.
   One sidebar and one top navigation for every User page
   (User/includes/layout/main/*), the e-borang pages
   (User/includes/layout/forms/*) and the admin portal, which shares the
   same sidebar classes.
   assets/js/sidebar.js drives the collapse; its mobile breakpoint is 700px.
   ========================================================================== */

/* Shell tokens live on :root so that inherited text picks them up: body.member-page
   reads var(--ink), and a token declared on .app would be out of reach there because
   custom properties only resolve upwards. The themeable three (--ink, --line,
   --shadow) are flipped by the night palette at the end of this file. */
:root {
  color-scheme: light;
  --navy: #082e63;
  --blue: #07519a;
  --ink: #092957;
  --line: #d8e3f1;
  --gold: #efa925;
  --shadow: 0 5px 18px #163e6810;
}

/* Sidebar, shared markup: aside.sidebar > .sidebar-brand, .sidebar-nav, .sidebar-footer. */
.sidebar {
  width: 256px;
  flex: 0 0 256px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 32px 12px 20px;
  background: var(--navy, #082e63);
  color: #fff;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ffffff1f;
}
.sidebar-brand h1 { color: #fff; font-size: 1.5rem; line-height: 1.2; }
.sidebar-brand span { color: #b9d3ef; font-size: .7rem; }
.sidebar-logo {
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 5px solid #1b3b59;
  border-radius: .5rem;
  background: #fff;
  background-clip: padding-box;
  object-fit: contain;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 53px;
  padding: 0 20px;
  gap: 25px;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  text-decoration: none;
  transition: transform .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.sidebar-nav a i { width: 31px; flex: none; text-align: center; font-size: 21px; color: #b9d3ef; }
.sidebar-nav a:hover,
.sidebar-nav a:focus-visible {
  transform: translateX(3px);
  background: #1264ad;
  color: #fff;
  box-shadow: 0 4px 12px #061b3233;
}
.sidebar-nav a:hover i,
.sidebar-nav a:focus-visible i { color: #fff; }
.sidebar-nav a.active { background: var(--blue, #07519a); color: #fff; font-weight: 600; }
.sidebar-nav a.active i { color: #fff; }
.nav-group { display: flex; flex-direction: column; min-width: 0; }
.nav-group > a::after {
  content: "\f107";
  display: block;
  margin-left: auto;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 12px;
  opacity: .75;
  transition: transform .2s ease;
}
.nav-group > a[aria-expanded="true"]::after { transform: rotate(180deg); }
/* The submenu is the animated surface: its height is measured by sidebar.js,
   so it must stay in the layout (visibility, not display) while closed. */
.sub-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 0 0 1rem;
  padding: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transition: height .3s ease, margin-top .3s ease, opacity .25s ease, visibility 0s linear .3s;
}
.sub-nav.open {
  height: auto;
  margin-top: 3px;
  visibility: visible;
  opacity: 1;
  transition: height .3s ease, margin-top .3s ease, opacity .25s ease .05s, visibility 0s;
}
.sidebar-nav .sub-nav a { min-height: 42px; padding: 0 14px; gap: 14px; border-radius: 10px; color: #dbeafb; font-size: 14px; }
.sidebar-nav .sub-nav a i { width: auto; font-size: 17px; }
/* overflow:hidden on the animated container would clip the shared outside ring. */
.member-page .sidebar-nav .sub-nav a:focus-visible { outline-offset: -2px; }
.sidebar-nav .sub-nav a:hover,
.sidebar-nav .sub-nav a.active { background: #1264ad; color: #fff; }
.sidebar-footer { display: flex; flex-direction: column; gap: .3rem; padding-top: 1rem; border-top: 1px solid #ffffff1f; }
/* Motto pinned to the bottom of the member sidebar. */
.side-quote {
  margin: auto auto 14px;
  color: #e3eefb;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}
.side-quote::after {
  content: "";
  display: block;
  width: 48px;
  margin: 16px auto 0;
  border-top: 1px solid var(--gold, #efa925);
}
/* sidebar.js injects this close button into every sidebar; it is only drawn in the phone drawer. */
.mobile-sidebar-close { display: none; }

/* Member shell grid: brand and topbar on the first row, then sidebar, main, footer. */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  grid-template-rows: 68px minmax(0, 1fr) 50px;
}
.app > * { min-width: 0; }
/* The chrome carries its own ink: the standalone e-borang pages give <body> the paper
   palette, and without this the brand and top navigation would inherit that instead. */
.app > :is(.brand, .topbar) { color: var(--ink); }
.app > .brand {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 68px;
  padding: 12px 26px;
  background: #fff;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  flex-wrap: nowrap;
  color: inherit;
  text-decoration: none;
}
.brand-mark { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-weight: 800; font-size: 24px; letter-spacing: -1.4px; line-height: 1; white-space: nowrap; }
.app > .topbar {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 28px 0 36px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow: visible;
}
.app > .sidebar {
  grid-column: 1;
  grid-row: 2 / 4;
  flex: none;
  width: 100%;
  align-self: start;
  position: sticky;
  top: 68px;
  min-height: calc(100vh - 68px);
}
.app > main { grid-column: 2; grid-row: 2; padding: 6px 20px 16px; background: linear-gradient(#eef4fb, #eaf1f8); }
/* E-borang paper: white like every other surface, with a faint dot grid so the white
   input boxes and the letter panel read as boxes sitting on a page rather than as holes
   cut in the background. Dots, not rules, because grid lines collide with field borders. */
.app > .forms-main {
  background: #fff radial-gradient(#e6ecf4 1.1px, transparent 1.2px) 0 0 / 24px 24px;
}
/* Reader text size scales the content column only: the brand panel, sidebar and top
   navigation keep their shape, and the column simply rewraps. */
html[data-text-size="small"] .app > main { zoom: .9; }
html[data-text-size="large"] .app > main { zoom: 1.15; }
.app > footer {
  grid-column: 2;
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 23px;
  background: #f8fafd;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: #294873;
}
.app > footer b { font-size: 16px; color: #0a2c5b; margin-right: 14px; }

/* Top navigation controls. */
.header-title { display: flex; align-items: center; gap: 14px; flex: 1 1 auto; min-width: 0; }
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink, #092957);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--line, #d8e3f1);
  border-radius: 10px;
  background: #fff;
  color: var(--navy, #082e63);
  font-size: 17px;
  cursor: pointer;
  box-shadow: 0 2px 5px #123c6508;
}
.tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; min-width: 0; }
.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--navy);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 2px 5px #123c6508;
}
.tool.icon-tool { width: 40px; padding: 0; font-size: 16px; }
.text-size { display: flex; overflow: hidden; }
.text-size button {
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
}
.text-size button:last-child { border-right: 0; }
/* Segmented control: the step in force is filled, the others read as open choices. */
.text-size button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.text-size button:hover { background: #dcebfa; }
.text-size button[aria-pressed="true"]:hover { background: #0d3d78; }
.text-size button:active { background: #c3ddf5; transform: translateY(1px); }
.text-size button[aria-pressed="true"]:active { background: #062650; }
.notification { position: relative; }
.notification-trigger {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--navy);
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 5px #123c6508;
}
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #c22646;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  /* The bell sits at the right-hand end of the top navigation, so the panel is anchored by
     its own right edge and grows back over the bar. Anchoring the left edge instead pushes
     the panel past the viewport and makes the whole page scroll sideways. */
  right: 0;
  z-index: 300;
  width: min(320px, calc(100vw - 20px));
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 26px #123b6833;
}
.notification-dropdown[hidden] { display: none; }
.notification-dropdown strong { color: var(--ink); }
.notification-dropdown p { margin: 6px 0 0; color: #385476; }
.profile { position: relative; display: flex; align-items: center; gap: 13px; }
.profile-trigger {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.profile .name { font-size: 14px; font-weight: 700; }
.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0d4a8c;
  color: #fff;
  font-size: 22px;
}
.caret { color: var(--navy); font-size: 18px; }
.profile-dropdown {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 300;
  min-width: 160px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 22px #123b6820;
}
.profile-dropdown[hidden] { display: none; }
.profile-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}
.profile-dropdown a:hover { background: #edf4fb; }
.profile-dropdown i { color: var(--blue); }

/* Sidebar minimise: the member shell drops the column entirely, never an icon rail. */
@media (min-width: 701px) {
  .app.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
  .app.sidebar-collapsed > .sidebar { display: none; }
}

/* Reduced desktop widths keep the shell columns aligned and the header readable. */
@media (max-width: 1100px) {
  .app { grid-template-columns: 232px minmax(0, 1fr); }
  .app > .brand { padding: 10px 16px; }
  .app > .topbar { padding: 0 18px; gap: 8px; }
  .app > main { padding: 6px 16px 14px; }
  .page-title { font-size: 19px; }
  .header-title { gap: 9px; margin-right: 10px; }
  .tools { gap: 8px; }
  .text-size { display: none; }
}

/* Phone drawer: the sidebar becomes an overlay panel with the injected close button. */
@media (max-width: 700px) {
  .app { display: block; min-height: 100vh; min-height: 100dvh; }
  .app > .brand { display: none; }
  .app > .topbar { height: 60px; padding: 0 10px; justify-content: flex-end; gap: 8px; }
  .app > .topbar .page-title { font-size: 17px; }
  .header-title { flex: 0 0 auto; gap: 8px; margin-right: 0; }
  .tools { flex: 1 1 auto; justify-content: flex-end; gap: 5px; }
  .tool { min-height: 36px; padding: 0 8px; }
  .tool.icon-tool,
  .notification-trigger { width: 34px; min-width: 34px; height: 34px; padding: 0; }
  /* Even right-anchored, a 320px panel is wider than the room left of the bell on a phone,
     so the menu takes the full width of the screen and opens flat under the bar. */
  .notification-dropdown {
    position: fixed;
    top: calc(60px + 8px);
    left: 10px;
    right: 10px;
    width: auto;
  }
  .profile { gap: 8px; }
  .profile .name,
  .caret { display: none; }
  .avatar { width: 36px; height: 36px; font-size: 18px; }
  .app > main { width: 100%; padding: 10px 12px 18px; }
  .app > footer { padding: 0 12px; font-size: 9px; }
  .app > footer b { font-size: 15px; }
  .app > .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    width: min(300px, 86vw);
    height: 100vh;
    height: 100dvh;
    padding: 18px 12px;
    overflow-y: auto;
    transform: translateX(-100%);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease, visibility 0s .22s;
  }
  .app > .sidebar.mobile-open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: transform .22s ease, opacity .22s ease, visibility 0s;
  }
  .app > .sidebar.sidebar-hidden { display: flex; }
  .app .sidebar-nav a { min-height: 48px; padding: 0 18px; gap: 18px; font-size: 14px; }
  .mobile-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    width: 44px;
    min-height: 44px;
    border: 1px solid #587690;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-nav a,
  .sub-nav,
  .nav-group > a::after,
  .app > .sidebar { transition: none; }
  .sidebar-nav a:hover,
  .sidebar-nav a:focus-visible { transform: none; }
}

/* Member page typography. :where() keeps every page-specific size above this. */
body.member-page { font-size: 14px; color: var(--ink); }
body.member-page main { font-size: 14px; }
body.member-page main :where(h1, h2, h3, h4, h5, h6) { font-size: 16px; }
body.member-page main :where(p, li, label, small, td, th, input, select, textarea, button) { font-size: 14px; }

/* ==========================================================================
   Greeting band, shared by every User page.
   ========================================================================== */
body.member-page .welcome {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 160px;
  margin-bottom: 20px;
  padding: 0 28px;
  border-radius: 15px;
  background:
    linear-gradient(90deg, #dceafaee 0%, #eaf3f9de 52%, #b9d4ec33 100%),
    linear-gradient(180deg, #aac9e7 0%, #e8f1f9 55%, #7199b2 56%, #254e6b 100%);
  box-shadow: var(--shadow);
}
body.member-page .welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(165deg, transparent 66%, #fff8 67%, transparent 68%),
    linear-gradient(175deg, transparent 72%, #ffffff40 73%, transparent 75%);
  opacity: .8;
}
body.member-page .welcome::after {
  content: "DEMI FAEDAH ANGGOTA DAN KOMUNITI.";
  position: absolute;
  right: 16px;
  bottom: 12px;
  max-width: 180px;
  padding-left: 9px;
  border-left: 1px solid #fff;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 1px 4px #123;
}
body.member-page .welcome-copy { position: relative; z-index: 1; }
body.member-page .greet { margin: 0 0 10px; font-size: 18px; }
body.member-page .welcome h1 { margin: 0 0 4px; font-size: 22px; line-height: 1.1; letter-spacing: -.7px; font-weight: 800; }
body.member-page .role { margin: 0; font-size: 14px; }
body.member-page .welcome-meta { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 14px; }
body.member-page .welcome-meta > span {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 9px;
  border: 1px solid #ffffffa8;
  border-radius: 8px;
  background: #ffffffa3;
  box-shadow: 0 3px 9px #123b6818;
  color: #082e63;
}
body.member-page .welcome-meta b { display: flex; align-items: center; font-size: 19px; color: #07519a; }
body.member-page .divider { height: 20px; border-left: 1px solid var(--blue); }
body.member-page .motto { position: absolute; left: 57%; top: 24px; z-index: 1; max-width: 310px; font: italic 17px/1.3 Georgia, serif; }
body.member-page .motto::after { content: ""; display: block; width: 48px; margin: 13px 0; border-top: 2px solid var(--gold); }
@media (max-width: 1100px) {
  body.member-page .welcome { padding: 0 22px; }
}
@media (max-width: 900px) {
  body.member-page .welcome::after,
  body.member-page .motto { display: none; }
  body.member-page .welcome h1 { font-size: clamp(18px, 3.4vw, 27px); }
}
@media (max-width: 700px) {
  body.member-page .welcome { height: auto; min-height: 140px; padding: 12px 14px; }
  body.member-page .welcome h1 { font-size: clamp(17px, 5.5vw, 24px); overflow-wrap: anywhere; }
  body.member-page .greet,
  body.member-page .role { font-size: 14px; }
  body.member-page .welcome-meta { flex-wrap: wrap; gap: 9px; margin-top: 15px; font-size: 12px; }
  body.member-page .welcome-meta b { font-size: 17px; }
}

/* ==========================================================================
   Dashboard content (User/dashboard/index.php).
   ========================================================================== */

/* Announcement band */
body.dashboard-page .announcements {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 120px;
  margin-top: 10px;
  padding: 10px 19px;
  border: 1px solid #dce7f3;
  border-radius: 14px;
  background: #ffffffc9;
  box-shadow: var(--shadow);
}
body.dashboard-page .announcement-heading { display: flex; align-items: center; gap: 13px; }
body.dashboard-page .announcement-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  background: #e1edf9;
  color: #07519a;
  font-size: 21px;
}
body.dashboard-page .announcement-heading h2 { margin: 0; font-size: 16px; }
body.dashboard-page .announcement-heading p { margin: 0; color: #385476; font-size: 12px; }
body.dashboard-page .announcement-space {
  display: flex;
  align-items: center;
  padding-left: 18px;
  border-left: 1px solid #d7e2ef;
}
body.dashboard-page .announcement-card {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #dce7f3;
  border-radius: 10px;
  background: linear-gradient(110deg, #f4f8fd, #fff);
}
body.dashboard-page .announcement-label { color: #b96a12; font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }
body.dashboard-page .announcement-card h3 { margin: 4px 0; font-size: 16px; line-height: 1.3; }
body.dashboard-page .announcement-details { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 11px; }
body.dashboard-page .announcement-details i { color: #07519a; }

/* Allocation cards */
body.member-page .section-head { display: flex; align-items: center; justify-content: space-between; margin: 15px 2px 8px; }
body.member-page .section-head h2 { margin: 0; font-size: 16px; }
body.member-page .history { color: #0051a0; font-size: 14px; font-weight: 600; text-decoration: none; transition: color .16s ease, transform .16s ease; }
body.dashboard-page .cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
  align-items: stretch;
  /* No floor on the row: the 250px below already comes from each card's own min-height, and a
     row whose cards are all compact has to be allowed to shrink, or the strip keeps a band of
     empty page between its last card and Capaian Pantas. */
  grid-auto-rows: auto;
}
body.dashboard-page .card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 250px;
  border: 1px solid #f5d37b;
  border-radius: 12px;
  background: #fff9e7;
  box-shadow: var(--shadow);
}
body.dashboard-page .card.blue { background: #e6f2ff; border-color: #9bc9f7; }
body.dashboard-page .card.green { background: #e5f5ec; border-color: #a5dec4; }
/* An allocation still through the board has no figure, address or instalment recorded yet, so the
   status line is the only thing the panel holds. The height the strip reserves for a filled card
   left that line at the bottom of an empty box, so this card takes the height of what it actually
   carries and stops stretching to match its taller neighbours. The extra class is what beats the
   responsive min-heights further down, rather than repeating this rule inside their blocks. */
body.dashboard-page .card.card-ringkas { height: auto; min-height: 0; align-self: start; }
body.dashboard-page .card-ringkas .card-body { min-height: 0; }
/* Hover lift, matched to the quick-access cards below but shallower for the taller panels. */
body.dashboard-page .card,
body.dashboard-page .announcement-card {
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
body.dashboard-page .card:hover,
body.dashboard-page .announcement-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px #173c651f; }
body.dashboard-page .card:hover { border-color: #e8c063; }
body.dashboard-page .card.blue:hover { border-color: #7fb8f0; }
body.dashboard-page .card.green:hover { border-color: #86cfb1; }
body.dashboard-page .announcement-card:hover { border-color: #c4d5ea; }
body.dashboard-page .card-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 68px;
  height: 68px;
  padding: 8px 16px;
  background: inherit;
}
body.dashboard-page .code {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 54px;
  height: 46px;
  flex: none;
  border-radius: 10px;
  background: #edae32;
  color: #fff;
  font-size: 25px;
  font-weight: 700;
}
body.dashboard-page .card.blue .code { background: #478dd7; }
body.dashboard-page .card.green .code { background: #34a36a; }
body.dashboard-page .card-title { position: relative; z-index: 1; flex: 1; font-size: 14px; font-weight: 700; line-height: 1.4; }
body.dashboard-page .card-title span { display: block; font-size: 13px; font-weight: 400; }
body.dashboard-page .card-symbol {
  position: absolute;
  top: -3px;
  right: 14px;
  z-index: 0;
  color: #eba92c;
  font-size: 78px;
  font-weight: 800;
  line-height: 1;
  opacity: .4;
  transform: rotate(4deg);
  pointer-events: none;
}
body.dashboard-page .card.blue .card-symbol { color: #4788cb; }
body.dashboard-page .card.green .card-symbol { color: #30a066; }
body.dashboard-page .card-body {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 118px;
  margin: 0 12px 8px;
  padding: 16px 18px;
  border: 1px solid #e5edf5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 7px #173c650a;
}
/* Details start at the top of every card, so the first rows of P3, P2 and P1 sit on the same line
   across the strip; the status keeps its auto margin and rests on the panel floor. */
body.dashboard-page .card-body > :first-child { margin-top: 0; }
/* One icon column per card body: the address pin and the fact line centre on the same x, so
   every line of text starts on the same edge. */
body.dashboard-page .card-body { --card-icon-col: 36px; --card-icon-gap: 11px; }
body.dashboard-page .info { display: flex; align-items: flex-start; gap: var(--card-icon-gap); font-size: 13px; line-height: 1.4; }
/* Card text uses two sizes only: 13px for words, 14px bold for every RM figure, on all three cards. */
body.dashboard-page .info strong { display: inline-block; margin-top: 2px; font-weight: 700; font-size: 14px; }
/* A 19px glyph in a flex-start row is otherwise a whole line taller than the 13px words beside it. */
body.dashboard-page .info-icon { flex: none; width: var(--card-icon-col); color: #07519a; font-size: 19px; line-height: calc(13px * 1.4); text-align: center; }
/* Red alert on a card (transfer not finished, choice not made). A clear red box at the top of the
   card body: it slides in once with a small nudge, then only the icon keeps a slow pulsing ring, so
   the eye is drawn to it without the whole card moving. */
body.dashboard-page .info.red {
  align-items: center;
  gap: 11px;
  margin: 0;
  padding: 10px 14px 10px 10px;
  border: 1px solid #b91c1c;
  border-left: 5px solid #7f1d1d;
  border-radius: 9px;
  background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
  box-shadow: 0 3px 12px #dc262640;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  animation: kad-amaran-masuk .55s cubic-bezier(.2, .8, .2, 1) both, kad-amaran-gegar .5s ease-in-out .6s 1;
}
body.dashboard-page .card-body > .info.red:first-child { margin-top: 0; }
/* An info line holding only its empty icon slot (P3 with no choice yet) is blank space: drop it. */
body.dashboard-page .card-body > .info:has(> .info-icon:only-child:empty) { display: none; }
body.dashboard-page .info-icon.red {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: #dc2626;
  font-size: 11.5px;
  line-height: 1;
  animation: kad-amaran-denyut 1.8s ease-out infinite;
}
@keyframes kad-amaran-masuk { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes kad-amaran-gegar {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
@keyframes kad-amaran-denyut {
  0% { box-shadow: 0 0 0 0 #ffffffcc; }
  70% { box-shadow: 0 0 0 8px #ffffff00; }
  100% { box-shadow: 0 0 0 0 #ffffff00; }
}
@media (prefers-reduced-motion: reduce) {
  body.dashboard-page .info.red, body.dashboard-page .info-icon.red { animation: none; }
}
html[data-theme="dark"] body.dashboard-page .info.red { border-color: #ef4444; border-left-color: #fca5a5; background: linear-gradient(90deg, #b91c1c 0%, #dc2626 100%); box-shadow: 0 3px 12px #00000059; color: #fff; }
html[data-theme="dark"] body.dashboard-page .info-icon.red { background: #fff; color: #b91c1c; }

/* "Diterima: RM x" on the P2 card reads as one row across the card: label on the left edge under
   the status tick, figure on the right edge, like a receipt line. */
body.dashboard-page .info.info-terima { align-items: center; justify-content: space-between; }
body.dashboard-page .info.info-terima .info-label { flex: 1 1 auto; color: var(--ink); font-size: 13px; }
body.dashboard-page .info.info-terima .info-amount { flex: none; color: #0b2b4a; font-size: 14px; font-weight: 700; line-height: calc(13px * 1.4); white-space: nowrap; }
/* A P2 address reads like the P1 address beside it, not like a money figure. */
body.dashboard-page .info strong.alamat-kad { display: block; margin: 0; font-size: 13px; font-weight: 400; line-height: 1.4; }
/* The cooperative's note under P3: same icon column as the rows above, quieter text. */
body.dashboard-page .info.p3-nota { color: #5a6f86; font-size: 13px; }
body.dashboard-page .info.p3-nota .info-icon { font-size: 15px; color: #6a87a6; }
html[data-theme="dark"] body.dashboard-page .info.p3-nota { color: #9fb3c8; }
html[data-theme="dark"] body.dashboard-page .info.info-terima .info-amount { color: #e6f0fa; }
body.dashboard-page .info-pair { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; color: var(--ink); font-size: 13px; }
body.dashboard-page .info-pair span { display: inline-flex; align-items: center; gap: var(--card-icon-gap); min-width: 0; overflow-wrap: anywhere; }
body.dashboard-page .info-pair i { flex: none; width: var(--card-icon-col); color: #07519a; text-align: center; }
/* The figure of an instalment is one fact: "RM" and its amount never split across lines. */
body.dashboard-page .info-pair b { font-size: 14px; font-weight: 700; white-space: nowrap; }
/* A part already handed over paints green; the stopwatch marking the one that has not stays blue. */
body.dashboard-page .info-pair i.selesai { color: #1d7844; }
/* One instalment is one line: the label and its figure stay on the same row. */
body.dashboard-page .info-pair.bahagian { flex-wrap: nowrap; }
body.dashboard-page .info-pair.bahagian span { white-space: nowrap; }
body.dashboard-page .status {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  min-height: 39px;
  margin-top: auto;
  padding: 10px 0 0;
  background: transparent;
  color: #126b45;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
  text-transform: uppercase;
}
body.dashboard-page .status::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  border-top: 1px dashed #a9c2d8;
}
body.dashboard-page .check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 6px;
  background: #22b979;
  color: #fff;
}
/* An allocation recorded but not yet through the board. Same strip, different colour, so the
   member reads the difference without having to read the words. */
body.dashboard-page .status-tunggu .check { background: #d3a13a; }
body.dashboard-page .status.status-tunggu { color: #9a6a12; }

/* Quick access */
body.dashboard-page .quick-title { margin: 14px 2px 8px; font-size: 16px; }
body.dashboard-page .quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
body.dashboard-page .quick-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 76px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffffb8;
  box-shadow: var(--shadow);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
body.dashboard-page .quick-card:hover { transform: translateY(-4px); border-color: #9bc9f7; box-shadow: 0 10px 22px #173c6526; }
body.dashboard-page .quick-card > div:last-child { min-width: 0; }
body.dashboard-page .quick-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  background: #e0edf9;
  color: #064d91;
  font-size: 22px;
  font-weight: 700;
  transition: transform .16s ease, background-color .16s ease;
}
body.dashboard-page .quick-card:hover .quick-icon { transform: scale(1.08); background: #d1e6fa; }
body.dashboard-page .quick-card b { font-size: 13px; }
body.dashboard-page .quick-card small { display: block; margin-top: 5px; color: #193a62; font-size: 11px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
  body.dashboard-page .quick-card,
  body.dashboard-page .quick-icon,
  body.dashboard-page .card,
  body.dashboard-page .announcement-card { transition: none; }
  body.dashboard-page .quick-card:hover,
  body.dashboard-page .quick-card:hover .quick-icon,
  body.dashboard-page .card:hover,
  body.dashboard-page .announcement-card:hover { transform: none; }
}

/* Responsive dashboard layout */
@media (max-width: 1100px) {
  body.dashboard-page .announcements { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  body.dashboard-page .announcement-space { border-left: 0; border-top: 1px solid #d7e2ef; padding: 10px 0 0; }
  body.dashboard-page .cards { grid-template-columns: minmax(0, 1fr); }
  body.dashboard-page .card { height: auto; min-height: 220px; }
  body.dashboard-page .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 701px) {
  body.dashboard-page .card-head { height: 96px; flex-basis: 96px; padding: 10px 16px; }
  body.dashboard-page .card-body { margin: 0 8px 8px; padding: 14px 16px 12px; }
}
@media (max-width: 700px) {
  body.dashboard-page .card { min-height: 230px; }
  body.dashboard-page .card-head { height: 66px; flex-basis: 66px; padding-left: 14px; padding-right: 14px; }
  body.dashboard-page .card-body { margin-left: 14px; margin-right: 14px; }
  body.dashboard-page .announcements { min-height: 0; padding: 10px 12px; gap: 8px; }
  body.dashboard-page .announcement-space { padding: 8px 0 0; }
  body.dashboard-page .announcement-card { padding: 10px 12px; }
  body.dashboard-page .announcement-details { display: grid; gap: 8px; }
  body.dashboard-page .quick { grid-template-columns: minmax(0, 1fr); }
  body.dashboard-page .quick-card { min-height: 70px; }
  body.dashboard-page .quick-icon { width: 44px; height: 44px; }
}

/* ==========================================================================
   Control interaction states for the member portal, in one place.
   The physics follow each control's look: filled slabs sink, bordered chips
   press down one pixel, plain text links darken, expandable surfaces deepen,
   the switch squashes its knob. `summary` is deliberately absent from the
   shared ring: the E-Borang cards clip an outside ring with overflow:hidden
   and keep their own inset teal ring to match the mint accent.
   ========================================================================== */
.member-page :is(a[href], button, [role="button"]):focus-visible { outline: 2px solid #2f6b9c; outline-offset: 2px; }
/* The top navigation also fronts the standalone e-borang pages, whose <body> has no
   .member-page class, so its controls keep a keyboard ring there too. */
.app > .topbar :is(button, [role="button"]):focus-visible { outline: 2px solid #2f6b9c; outline-offset: 2px; }
.member-page :is(input, select, textarea):focus-visible { outline: 2px solid #2f6b9c; outline-offset: -2px; }
.member-page .setting-row .toggle:focus-visible { outline-offset: 3px; }

.member-page :is(.btn-outline, .password-back, .history-view-button, .settings-cancel, .action-link, .profile-trigger, .clear-btn, .save-btn, .cancel-btn, .toggle, .tool, .text-size button, .header-sidebar-toggle, .notification-trigger, a.history) {
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.member-page select { cursor: pointer; }

.header-sidebar-toggle:hover,
.notification-trigger:hover,
.tool:hover { background: #eef4fa; border-color: #b8cee5; }
.profile-trigger:hover .avatar { background: #0a3f78; }
.profile-trigger:hover .name { color: #1264ad; }
.profile-dropdown a:active { background: #dbe8f6; }
.member-page select:hover,
.borang-page .filter-select:hover,
.borang-page .search-box input:hover { border-color: #a9c6e2; }
.per-accordion:not(.jubli) .per-accordion-header:hover { background: #f4f8fd; }

.btn-outline:active { background: #dbe7f4; border-color: #7ea6cd; transform: translateY(1px); }
.header-sidebar-toggle:active,
.notification-trigger:active,
.tool:active { background: #dcebfa; border-color: #8fb4d8; box-shadow: none; transform: translateY(1px) scale(.98); }
body.member-page .password-back:active { background: #dde3ea; border-color: #a8b4c2; transform: translateY(1px); }
.form-history-page .history-view-button:active { background: #d3e3f5; border-color: #8fb4d8; transform: translateY(1px); }
.form-history-page .history-pagination a:active { background: #dbe7f3; border-color: #9db8d3; transform: translateY(1px); }
.setting-row a.action-link:active,
.password-settings .settings-cancel:active { color: #0d3a5c; transform: translateY(1px); }
body.member-page a.history:hover { color: #0a3f78; text-decoration: underline; transform: translateX(2px); }
body.member-page a.history:active { color: #072e58; transform: translateY(1px); }
.per-accordion:not(.jubli) .per-accordion-header:active { background: #e6eff8; }
.per-accordion.jubli .per-accordion-header:active { background: rgba(255, 255, 255, .6); }
.borang-page .form-card summary:active { background: #e6f2f0; }
.sidebar-nav a:active { background: #0d5899; transform: translateX(3px) scale(.99); }
.editable-field .save-btn:active { background: #0f4a32; transform: translateY(1px); }
.editable-field .cancel-btn:active { background: #87a3bf; transform: translateY(1px); }
.editable-field :is(.save-btn, .cancel-btn):disabled { opacity: .55; cursor: progress; transform: none; }
.edit-toggle:active { background: #c4d9ef; transform: scale(.94); }
.borang-page .search-box .clear-btn:active { color: #19385e; background: #dbe7f3; transform: scale(.9); }
.setting-row .toggle:active::after { width: 21px; }
.setting-row .toggle:checked:active::after { left: 20px; }

@media (prefers-reduced-motion: reduce) {
  .member-page :is(a[href], button, [role="button"], summary, select, input):active { transform: none; }
}

/* ==========================================================================
   "Hubungi Pegawai" - the dashboard's contact card. It is a native <dialog>,
   so the backdrop, Escape and the focus trap come from the browser;
   assets/js/contact-dialog.js owns the wiring and User/dashboard/hubungi.php
   the markup. Only the member shell mounts either, so the .contact- classes
   cannot reach the admin pages or the standalone e-borang paper.
   ========================================================================== */
body.dashboard-page :is(a, button).quick-card {
  font-family: inherit;
  text-align: left;
  color: var(--ink);
  text-decoration: none;
}
body.dashboard-page button.quick-card { cursor: pointer; }
/* The card's text column gets min-width:0 from a rule keyed on <div>; a button only
   allows phrasing content, so the dialog trigger's column is a <span>. */
body.dashboard-page .quick-card > span:last-child { min-width: 0; }

.contact-dialog {
  width: min(980px, calc(100vw - 40px));
  /* inset:0 with margin:auto is what keeps a modal centred. The cap and overflow let a
     short viewport scroll the card instead of pushing its edges off screen, and the dialog
     sits outside <main> in the shell so the reader's text-size zoom is applied once. */
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f7fafd;
  color: var(--ink);
  box-shadow: 0 24px 60px #09295740;
}
.contact-dialog::backdrop { background: rgba(9, 29, 51, .55); backdrop-filter: blur(3px); }
.contact-dialog[open] { animation: contact-pop .18s cubic-bezier(.2, .8, .2, 1); }
@keyframes contact-pop {
  from { transform: scale(.96); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.contact-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 0;
}
.contact-dialog-head h2 { margin: 0; font-size: 20px; }
.contact-dialog-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}
.contact-dialog-close:hover { background: #eef4fb; }
.contact-dialog-close:active { background: #dce9f7; }

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 16px;
  padding: 16px 22px 20px;
}
.contact-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
}
.contact-panel h3 { margin: 0 0 14px; font-size: 17px; }

.contact-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.contact-row + .contact-row { margin-top: 13px; }
.contact-chip {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #e0edf9;
  color: #064d91;
  font-size: 15px;
}
.contact-row h4 { margin: 2px 0 5px; font-size: 14px; }
.contact-row p { margin: 0; font-size: 13.5px; line-height: 1.6; color: #2c4a6b; overflow-wrap: anywhere; }
.contact-row a { color: #07519a; }
.contact-row a:hover { text-decoration: underline; }
.contact-closed { display: block; margin-top: 3px; font-size: 12.5px; color: #587690; }
.contact-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 9px 15px;
  border-radius: 999px;
  background: #eef4fb;
  color: #0b2b4a;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.contact-social:hover { background: #e0edf9; }
.contact-social:active { background: #d1e6fa; }

.contact-form :is(input, textarea) { width: 100%; box-sizing: border-box; }
.contact-form textarea {
  min-height: 96px;
  padding: .7rem 1rem;
  border: 1px solid #c7d9ec;
  border-radius: .5rem;
  font-family: inherit;
  font-size: .95rem;
  line-height: 1.5;
  color: #0b2b4a;
  resize: vertical;
}
/* No. Anggota arrives from the member record and must not be retyped. */
.contact-form input[readonly] { background: #eef4fb; color: #587690; }
/* One rhythm for the whole card: every stacked block gets the same gap. */
.contact-form > * + * { margin-top: 14px; }
.contact-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.contact-pair .form-group { min-width: 0; }
.contact-pair .form-group + .form-group { margin-top: 0; }
/* Required markers stay out of the label text so language.js still sees one text node per
   label; the asterisk is drawn, never typed. */
.contact-form .is-required::after { content: "*"; margin-left: 4px; color: #d8632e; }
.contact-submit {
  margin-top: 20px;
  border-radius: 999px;
  padding: .62rem 1.6rem;
  font-family: inherit;
}
.contact-hint { margin: 0; font-size: 13px; line-height: 1.5; color: #587690; }
.contact-note { margin: 0; font-size: 12px; line-height: 1.5; color: #587690; }
.contact-status { margin: 0; font-size: 13px; font-weight: 600; color: #1f7a4d; }
.contact-status[hidden] { display: none; }

@media (max-height: 780px) {
  /* On a short viewport the message box gives up height first so the card stays centred
     with a visible gutter all round instead of filling the screen. */
  .contact-form textarea { min-height: 68px; }
}
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .contact-pair { grid-template-columns: minmax(0, 1fr); }
  .contact-grid { padding: 14px 14px 18px; }
  .contact-panel { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .contact-dialog[open] { animation: none; }
}

/* The card is outside <main>, so it carries the reader's text size itself. */
html[data-text-size="small"] .contact-dialog { zoom: .9; }
html[data-text-size="large"] .contact-dialog { zoom: 1.15; }

/* ==========================================================================
   Night palette, driven by data-theme on <html>.
   assets/js/theme.js owns the stored choice; the pre-paint script in
   User/includes/layout/main/shell_open.php writes the same attribute before the
   first frame so the page never flashes light. Every rule here is additive —
   light mode never matches these selectors, so the curated light palette stays
   untouched. Three levers do most of the work: --ink/--line/--shadow flip on
   :root, the shell surfaces below, and the grouped member-page slots.
   Deliberately left alone: the navy sidebar (readable in both themes), the gold
   Jubli Emas identity, and the standalone e-borang paper (.forms-system), which
   stays document-white on the dark canvas.
   ========================================================================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #dbe8f4;
  --line: #263b52;
  --shadow: 0 5px 18px rgba(0, 0, 0, .4);
  --night-page: #0b1624;
  --night-chrome: #101d2b;
  --night-panel: #152435;
  --night-raised: #1b2c3f;
  --night-line: #263b52;
  --night-field: #102030;
  --night-strong: #f2f8fd;
  --night-muted: #9cb3c9;
  --night-accent: #79b7ea;
}

/* Brand panel, page canvas, footer. */
html[data-theme="dark"] body.member-page { background: var(--night-page); }
/* The shell is also mounted by the standalone e-borang pages, whose <body> carries the
   paper palette instead of --ink; the chrome rules above keep its text in step. */
html[data-theme="dark"] .app > :is(.brand, .topbar, footer) { background: var(--night-chrome); }
html[data-theme="dark"] .app > footer { color: var(--night-muted); }
html[data-theme="dark"] body.member-page .app > main { background: linear-gradient(#0f1e2e, var(--night-page)); }
html[data-theme="dark"] .app > footer b { color: var(--night-strong); }

/* Top navigation controls and menus. */
html[data-theme="dark"] :is(.tool, .header-sidebar-toggle, .notification-trigger, .caret) { color: #cfe1f2; }
html[data-theme="dark"] :is(.tool, .header-sidebar-toggle, .notification-trigger) { background: var(--night-raised); box-shadow: none; }
html[data-theme="dark"] .text-size button { color: #cfe1f2; }
html[data-theme="dark"] .text-size button[aria-pressed="true"] { background: #2f74b8; color: #04111d; }
html[data-theme="dark"] .text-size button:hover { background: #24405c; color: #eaf3fb; }
html[data-theme="dark"] .text-size button[aria-pressed="true"]:hover { background: #3d84c6; }
html[data-theme="dark"] .text-size button:active { background: #2c4c6c; }
html[data-theme="dark"] .text-size button[aria-pressed="true"]:active { background: #2b6bab; }
html[data-theme="dark"] :is(.tool, .header-sidebar-toggle, .notification-trigger):hover { background: #24405c; border-color: #3a5f80; }
html[data-theme="dark"] :is(.tool, .header-sidebar-toggle, .notification-trigger):active { background: #2c4c6c; border-color: #47719a; }
html[data-theme="dark"] .avatar { background: #2f74b8; }
html[data-theme="dark"] .profile-trigger:hover .avatar { background: #3d84c6; }
html[data-theme="dark"] .profile-trigger:hover .name { color: var(--night-accent); }
html[data-theme="dark"] :is(.notification-dropdown, .profile-dropdown) { background: var(--night-raised); box-shadow: 0 12px 28px rgba(0, 0, 0, .55); }
html[data-theme="dark"] .notification-dropdown p { color: var(--night-muted); }
html[data-theme="dark"] .profile-dropdown a:hover { background: #24405c; }
html[data-theme="dark"] .profile-dropdown a:active { background: #2c4c6c; }
html[data-theme="dark"] .profile-dropdown i { color: var(--night-accent); }

/* Panels: one slot per white card, one lighter slot for cards nested inside them. */
html[data-theme="dark"] body.member-page :is(.info-section, .penyata-card, .per-accordion, .form-card, .password-settings .settings-section) {
  background: var(--night-panel);
  border-color: var(--night-line);
}
html[data-theme="dark"] body.member-page .per-accordion:hover { border-color: #3a5878; }
html[data-theme="dark"] body.member-page .per-accordion-header,
html[data-theme="dark"] body.member-page .per-accordion-body { background: var(--night-panel); }
html[data-theme="dark"] body.dashboard-page .card-body { background: var(--night-raised); border-color: var(--night-line); }
/* The contact card: the dialog box takes the chrome slot, its two panels the panel slot,
   and the small chips the raised slot used elsewhere for pills. */
html[data-theme="dark"] .contact-dialog { background: var(--night-chrome); }
html[data-theme="dark"] :is(.contact-panel, .contact-dialog-close) { background: var(--night-panel); }
html[data-theme="dark"] .contact-dialog-close:hover { background: #24405c; }
html[data-theme="dark"] .contact-dialog-close:active { background: #2c4c6c; }
html[data-theme="dark"] .contact-chip { background: #1e3a56; color: var(--night-accent); }
html[data-theme="dark"] .contact-social { background: var(--night-raised); color: var(--night-strong); }
html[data-theme="dark"] .contact-social:hover { background: #24405c; }
html[data-theme="dark"] .contact-social:active { background: #2c4c6c; }

/* Body text: headings and values carry the strong slot, labels the muted one. */
html[data-theme="dark"] body.member-page :is(h1, h2, h3, h4, .info-item .value, .per-accordion-header .per-title, .per-row .value-sm, .per-detail .highlight-amount, .setting-row strong, .announcement-card h3, .quick-card b, .address-block, .statement-title) { color: var(--night-strong); }
html[data-theme="dark"] body.member-page.edit-profile-page .display-value { color: var(--night-strong); }
html[data-theme="dark"] body.member-page :is(.info-item .label, .per-row .label-sm, .setting-row small, .form-group label, .year-selector label, .section-note, .announcement-heading p, .quick-card small, .verified-stamp, .password-settings > p, .contact-hint, .contact-note, .contact-closed) { color: var(--night-muted); }
/* The contact card keeps its own body-text weight, so it reads one step brighter than the labels. */
html[data-theme="dark"] .contact-row p { color: #c3dcf3; }
html[data-theme="dark"] .contact-row a { color: var(--night-accent); }
html[data-theme="dark"] .contact-status { color: #6fd39c; }
/* The page classes sit on <body> beside .member-page, so they must be concatenated, never descended from. */
html[data-theme="dark"] body.member-page.dashboard-page :is(.info-icon, .info-pair i, .announcement-icon, .announcement-details i) { color: var(--night-accent); }
html[data-theme="dark"] body.member-page.profile-page .info-item { background: var(--night-raised); border-color: var(--night-line); }
html[data-theme="dark"] body.member-page.profile-page .info-item .info-icon { background: #1e3a56; color: var(--night-accent); }
html[data-theme="dark"] body.member-page :is(.info-section h2 i, .settings-section h3 i, .per-accordion-header .per-title i, .info-item .value i, .per-row .value-sm i, .address-block i, .penyata-card .card-header .icon-box, .bank-name) { color: var(--night-accent); }
html[data-theme="dark"] body.member-page .info-section h2 .history { color: var(--night-accent); }
html[data-theme="dark"] body.member-page .info-section h2,
html[data-theme="dark"] body.member-page .settings-section h2 { border-bottom-color: #2b4258; }
html[data-theme="dark"] body.member-page .per-accordion:not(.jubli) .per-accordion-header:hover { background: #1d3145; }
html[data-theme="dark"] body.member-page .per-accordion:not(.jubli) .per-accordion-header:active { background: #24405c; }
html[data-theme="dark"] body.member-page .setting-row { color: var(--ink); }
html[data-theme="dark"] body.member-page .year-selector { background: #10202f; border-color: var(--night-line); }
html[data-theme="dark"] body.member-page .per-accordion-header .arrow { color: var(--night-muted); }

/* Fields: text inputs, selects and textareas, with the checkbox switch excluded. */
html[data-theme="dark"] body.member-page :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]), select, textarea) {
  background: var(--night-field);
  border-color: #2e4863;
  color: var(--night-strong);
}
/* color-scheme: dark paints the open list dark, but the light-mode ink token in
   `select option` would keep every entry near-black on it. */
html[data-theme="dark"] body.member-page select option { background: var(--night-field); color: var(--night-strong); }
html[data-theme="dark"] body.member-page select option[value=""] { color: var(--night-muted); }
html[data-theme="dark"] body.member-page .setting-row .toggle { background: #33506b; }
html[data-theme="dark"] body.member-page .setting-row .toggle:checked { background: #1f8a5c; }
html[data-theme="dark"] .contact-form .is-required::after { color: #f0a173; }
/* The extra class only exists to reach the field rule above by specificity; the later
   position in the sheet then lets a read-only field look dimmer than an editable one. */
html[data-theme="dark"] body.member-page .contact-form .form-group input[readonly] { background: var(--night-raised); color: var(--night-muted); }

/* Rows and dividers inside panels. */
html[data-theme="dark"] body.member-page :is(.info-item, .setting-row, .per-row, .verified-stamp) { border-color: #263b52; }
html[data-theme="dark"] body.member-page .column-divider::before { background: #2e4863; }
html[data-theme="dark"] body.member-page .address-block { background: #16283a; }
html[data-theme="dark"] body.member-page .status-tunggu { color: #e0b45c; }
html[data-theme="dark"] body.dashboard-page .info-pair i.selesai { color: #4cc08a; }
html[data-theme="dark"] body.member-page .profile-photo-frame { border-color: #1b2c3f; background: #16283a; box-shadow: 0 0 0 1px #2b4258; }
html[data-theme="dark"] body.member-page .profile-photo-frame i { color: #8fb0cd; }

/* Status pills and badges keep their meaning, lose their pastel backgrounds. */
html[data-theme="dark"] body.member-page :is(.per-accordion-header .badge, .penyata-card .card-header .badge-type) { background: #26405a; color: #cfe4f8; }
html[data-theme="dark"] body.member-page .penyata-card .card-header .icon-box { background: #1e3a56; }
html[data-theme="dark"] body.member-page .verified-stamp i { color: #4cc08a; }
html[data-theme="dark"] body.member-page .verified-stamp .time { background: #1e3348; color: #bcd4ea; }

/* Jubli Emas keeps its gold identity, deepened for the night canvas. */
html[data-theme="dark"] body.member-page .per-accordion.jubli { background: linear-gradient(135deg, #241d10 0%, #1b1608 100%); border-color: #4d3f21; }
html[data-theme="dark"] body.member-page .per-accordion.jubli .per-accordion-header .per-title { color: #f3d9a6; }
html[data-theme="dark"] body.member-page .per-accordion.jubli .per-accordion-header .per-title i { color: #d9a45f; }
html[data-theme="dark"] body.member-page .per-accordion.jubli .per-accordion-header .badge { background: #3a2f18; color: #eec87a; }
html[data-theme="dark"] body.member-page .per-accordion.jubli .per-accordion-header:hover { background: rgba(255, 255, 255, .07); }
html[data-theme="dark"] body.member-page .per-accordion.jubli .per-accordion-header:active { background: rgba(255, 255, 255, .12); }
html[data-theme="dark"] body.member-page .per-accordion.jubli .per-row { border-bottom-color: #3a2f18; }

/* Buttons. .btn-primary becomes the light slab so it stays the loudest action. */
html[data-theme="dark"] body.member-page .btn-primary { background: #dcebfb; color: #0a2338; box-shadow: none; }
html[data-theme="dark"] body.member-page .btn-primary:hover { background: #f4fbff; }
html[data-theme="dark"] body.member-page .btn-primary:active { background: #bfdcf6; box-shadow: inset 0 3px 7px rgba(8, 30, 52, .35); }
html[data-theme="dark"] body.member-page .btn-outline { border-color: #3f6b8e; color: #a9cdf0; }
html[data-theme="dark"] body.member-page .btn-outline:hover { background: #1b2f45; border-color: var(--night-accent); }
html[data-theme="dark"] body.member-page .btn-outline:active { background: #24405c; border-color: #47719a; }
html[data-theme="dark"] body.member-page .edit-toggle { color: var(--night-accent); }
html[data-theme="dark"] body.member-page .edit-toggle:hover { background: #1e3a56; }
html[data-theme="dark"] body.member-page .edit-toggle:active { background: #2c4c6c; }
html[data-theme="dark"] body.member-page .editable-field .cancel-btn { background: #3a5a78; color: #eaf3fb; }
html[data-theme="dark"] body.member-page .editable-field .cancel-btn:hover { background: #46688a; }
html[data-theme="dark"] body.member-page .editable-field .cancel-btn:active { background: #2f4c67; }
html[data-theme="dark"] body.member-page .setting-row a.action-link { color: var(--night-accent); }
html[data-theme="dark"] body.member-page a.history { color: var(--night-accent); }
html[data-theme="dark"] body.member-page a.history:hover { color: #a9cdf0; }
html[data-theme="dark"] body.member-page .password-settings .settings-cancel { color: var(--night-accent); }
html[data-theme="dark"] body.member-page .password-settings .settings-cancel:hover { color: #a9cdf0; }
html[data-theme="dark"] body.member-page .password-back { background: #1d2f42; border-color: #33506b; color: #cddff0; }
html[data-theme="dark"] body.member-page .password-back:hover { background: #24405c; }
html[data-theme="dark"] body.member-page .password-back:active { background: #2a4a68; border-color: #47719a; }
html[data-theme="dark"] body.member-page .password-visibility { color: #9cb3c9; }
html[data-theme="dark"] body.member-page .password-visibility:hover { color: var(--night-accent); }
html[data-theme="dark"] body.member-page .date-field > .date-field-calendar { color: #93aabd; }
html[data-theme="dark"] body.member-page .date-field > .date-field-calendar:hover { color: var(--night-accent); background: #24405c; }

/* Notices keep their alert colours. */
html[data-theme="dark"] body.member-page .password-warning { background: #2b1519; border-color: #7e3a44; color: #ffb4bb; }
html[data-theme="dark"] body.member-page .password-warning.password-success { background: #0f2b1c; border-color: #2c6a48; color: #7ee2ab; }

/* Greeting band. */
html[data-theme="dark"] body.member-page .welcome {
  background:
    linear-gradient(90deg, #16304dee 0%, #12283ade 52%, #0d1c2b66 100%),
    linear-gradient(180deg, #1b3f66 0%, #142e4a 55%, #0e2337 56%, #0a1a29 100%);
}
html[data-theme="dark"] body.member-page .welcome::before { opacity: .3; }
html[data-theme="dark"] body.member-page .welcome-meta > span { border-color: #35597b; background: #16293c99; color: #d9e8f6; }
html[data-theme="dark"] body.member-page .welcome-meta b { color: var(--night-accent); }
html[data-theme="dark"] body.member-page .divider { border-left-color: var(--night-accent); }

/* Dashboard. */
html[data-theme="dark"] body.dashboard-page .announcements { background: #152435d6; border-color: var(--night-line); }
html[data-theme="dark"] body.dashboard-page .announcement-icon { background: #1c3852; color: var(--night-accent); }
html[data-theme="dark"] body.dashboard-page .announcement-space { border-left-color: var(--night-line); }
html[data-theme="dark"] body.dashboard-page .announcement-card { background: linear-gradient(110deg, #16283a, #1b2c3f); border-color: #2a4159; }
html[data-theme="dark"] body.dashboard-page .announcement-label { color: #e6a44f; }
html[data-theme="dark"] body.dashboard-page .card { background: #231c0c; border-color: #5a4718; }
html[data-theme="dark"] body.dashboard-page .card.blue { background: #0f2338; border-color: #2b567f; }
html[data-theme="dark"] body.dashboard-page .card.green { background: #0f2a1e; border-color: #2a5c42; }
html[data-theme="dark"] body.dashboard-page .card:hover { border-color: #6f5a24; }
html[data-theme="dark"] body.dashboard-page .card.blue:hover { border-color: #3d7096; }
html[data-theme="dark"] body.dashboard-page .card.green:hover { border-color: #38795a; }
html[data-theme="dark"] body.dashboard-page .announcement-card:hover { border-color: #3a5878; }
html[data-theme="dark"] body.dashboard-page .status { color: #4cc08a; }
html[data-theme="dark"] body.dashboard-page .status-tunggu .check { background: #8a6a20; color: #ffe9bd; }
html[data-theme="dark"] body.dashboard-page .status::before { border-top-color: #3a5878; }
html[data-theme="dark"] body.dashboard-page .status.status-tunggu { color: #e0b45c; }
html[data-theme="dark"] body.dashboard-page .quick-card { background: #152435cc; }
html[data-theme="dark"] body.dashboard-page .quick-icon { background: #1e3a56; color: #8fc2f2; }
html[data-theme="dark"] body.dashboard-page .quick-card:hover .quick-icon { background: #26486a; }

/* E-Borang list and download chips (colour only; the chip shape reads the tokens). */
html[data-theme="dark"] body.borang-page .form-card summary { color: #e2eef9; }
html[data-theme="dark"] body.borang-page .form-card summary:hover,
html[data-theme="dark"] body.borang-page .form-card[open] summary { background: #12312e; }
html[data-theme="dark"] body.borang-page .form-card[open] summary { border-bottom-color: #2b4a4d; }
html[data-theme="dark"] body.borang-page .form-card summary:active { background: #17403b; }
html[data-theme="dark"] body.borang-page .search-box > i { color: #7f97ae; }
html[data-theme="dark"] body.borang-page .search-box .clear-btn:hover { color: var(--night-strong); background: #24405c; }
html[data-theme="dark"] body.borang-page .search-box .clear-btn:active { color: var(--night-strong); background: #2c4c6c; }
html[data-theme="dark"] .borang-page .form-actions .btn-download {
  --chip-bg: #16283a; --chip-bg-hover: #1d3550; --chip-bg-active: #24405c;
  --chip-ink: #dce9f6; --chip-line: #2e4863; --chip-tile: #0f1e2e;
  --chip-icon: #93b6d4; --chip-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
html[data-theme="dark"] .borang-page .form-actions .online { --chip-bg:#0f2b23; --chip-bg-hover:#14392e; --chip-bg-active:#1a4839; --chip-ink:#8fe0b8; --chip-line:#2e5f4f; --chip-icon:#4ec98f; }
html[data-theme="dark"] .borang-page .form-actions .pdf { --chip-bg:#2e1419; --chip-bg-hover:#3d1b22; --chip-bg-active:#4d232c; --chip-ink:#ffb3bd; --chip-line:#5e2b34; --chip-icon:#ff8f9f; }
html[data-theme="dark"] .borang-page .form-actions .word { --chip-bg:#12283f; --chip-bg-hover:#18344f; --chip-bg-active:#1e4061; --chip-ink:#a9cdf5; --chip-line:#2f4f6f; --chip-icon:#74b1ea; }

/* Submission history table. */
html[data-theme="dark"] body.form-history-page .history-table-wrap { border-color: var(--night-line); }
html[data-theme="dark"] body.form-history-page .history-table { color: var(--ink); }
html[data-theme="dark"] body.form-history-page .history-table th { background: #1a2d40; }
html[data-theme="dark"] body.form-history-page .history-table tbody tr:hover { background: #182c42; }
html[data-theme="dark"] body.form-history-page .history-sent { background: #12291f; border-color: #2a5c42; color: #8fe0b8; }
html[data-theme="dark"] body.form-history-page .history-pending { background: #2a2210; border-color: #5f4c1c; color: #f0cf85; }
html[data-theme="dark"] body.form-history-page .history-received { background: #12283f; border-color: #2f4f6f; color: #a9cdf5; }
html[data-theme="dark"] body.form-history-page .history-view-button { background: #1e3852; border-color: #33557a; color: #a9cdf0; }
html[data-theme="dark"] body.form-history-page .history-view-button:hover { background: #26466a; }
html[data-theme="dark"] body.form-history-page .history-view-button:active { background: #2d5177; border-color: #47719a; }
html[data-theme="dark"] body.form-history-page .history-pagination :is(a, [aria-current]) { background: #16283a; border-color: #2e4761; color: var(--ink); }
html[data-theme="dark"] body.form-history-page .history-pagination a:hover { background: #1e3852; }
html[data-theme="dark"] body.form-history-page .history-pagination a:active { background: #2c4c6c; border-color: #3f6b8e; }
html[data-theme="dark"] body.form-history-page .history-pagination [aria-current] { background: #24445f; border-color: #3f6b8e; }

/* Focus rings lighten with the canvas. */
html[data-theme="dark"] .member-page :is(a[href], button, [role="button"], input, select, textarea):focus-visible { outline-color: #6fb0e6; }
html[data-theme="dark"] .app > .topbar :is(button, [role="button"]):focus-visible { outline-color: #6fb0e6; }

/* ==========================================================================
   PDPA consent card — the white A4 sheet a member meets on entry, and the same
   sheet inline on User/tetapan/privasi.php. User/includes/layout/main/konsen-pdpa.php
   owns the markup and assets/js/pdpa-card.js the modal behaviour, so both surfaces
   are one set of rules. No icons: a notice is read as a document, so the sheet is
   type, rules and one button, and nothing in it can be dismissed by accident.
   ========================================================================== */
.pdpa-card {
  /* A portrait sheet, not a wide panel: 210:297 is the paper a member would be handed.
     margin:auto with inset:0 is what centres it, and the viewport caps keep the sheet on
     screen at any window height while .pdpa-body scrolls inside it.
     position:fixed is written here rather than left to the browser because a <dialog> that is
     merely open — a browser with pdpa-card.js unavailable — is laid out in the document flow, at
     the bottom of the page, where nobody would find the question. Fixed keeps it in front of the
     member in both states; showModal() puts it in the top layer regardless. */
  position: fixed;
  inset: 0;
  /* Above every fixed part of the shell — the topbar sits at 100 and the mobile drawer at 1001 —
     because a merely-open dialog is not in the top layer and would otherwise be painted under the
     bar it is supposed to cover. showModal() lifts it regardless. */
  z-index: 1100;
  width: min(660px, calc(100vw - 32px));
  /* Paper, not a fixed frame: the sheet is as tall as its content and no taller than the screen,
     so a short question does not leave a button floating in the middle of an empty page.
     display:flex is what makes the cap real — it lets the sheet be the flex child that shrinks
     and scrolls instead of overflowing the dialog. */
  max-height: min(940px, calc(100vh - 32px));
  max-height: min(940px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  margin: auto;
  padding: 0;
  /* The sheet re-declares the shell's tokens for itself: in dark theme --ink and --line flip
     to light-on-dark values, and a legal notice printed on white paper would go unreadable.
     Paper is paper in both themes, so the paper keeps the light values inside its own scope. */
  --ink: #092957;
  --line: #d8e3f1;
  --navy: #082e63;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 24px 60px #09295759;
}
.pdpa-card::backdrop { background: rgba(9, 29, 51, .62); backdrop-filter: blur(4px); }

/*
 * An `open` attribute alone is not a modal: only showModal() makes the rest of the document inert,
 * and that is pdpa-card.js. So while the card is still the plain-open version — a browser with the
 * script unavailable — the page behind it cannot be used either. The card is a child of <body>, so
 * this leaves the sheet itself clickable.
 */
body:has(> .pdpa-card[open]) > .app { pointer-events: none; }

/* The column inside the paper: a fixed head, then the form, which owns the rest of the height. */
.pdpa-sheet {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* The same sheet inline on its own page (.pdpa-inline, the 'laman' mode of konsen-pdpa.php):
   the paper and its rules carry over, but it is back in the page's own flow — the fixed-inset
   framing exists only to hold the dialog on screen — and the sheet grows with its content
   instead of filling a fixed dialog height. */
.pdpa-inline {
  position: static;
  inset: auto;
  z-index: auto;
  width: min(100%, 720px);
  height: auto;
  max-height: none;
  margin: 0 0 24px;
}
.pdpa-inline .pdpa-body { overflow: visible; }

/*
 * Asked on its own page (User/tetapan/privasi.php while a consent is owed), the sheet is the page:
 * no dialog shadow under paper that nothing is behind, centred in the content column, and the flash
 * above it as wide as the paper so the two read as one block.
 */
.pdpa-tanya { display: grid; justify-items: center; gap: 14px; padding: 6px 0 24px; }
.pdpa-tanya .password-warning { width: min(100%, 720px); }
.pdpa-tanya .pdpa-inline { box-shadow: none; margin-bottom: 0; }

/*
 * The notice on its own page — notis-pdpa.php. The same paper and the same rules, opened as a
 * document instead of a dialog: no shell around it, because the point of the page is that the
 * notice is read whole, and the ticks under it are the same form the card posts.
 */
.pdpa-doc-page {
  --ink: #092957;
  --line: #d8e3f1;
  --navy: #082e63;
  background: #ffffff;
  color: var(--ink);
  min-height: 100vh;
}
.pdpa-doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 28px 56px;
  /* The clauses number themselves, so a section added to the registry is a clause the member can
     be pointed at — and no wording in includes/pdpa.php has to carry its own number. */
  counter-reset: pdpa-clause;
}
.pdpa-doc .pdpa-head { padding: 0 0 20px; }
.pdpa-doc .pdpa-title { font-size: 25px; }
.pdpa-doc .pdpa-scope { margin: 6px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
/* Inline on a white page the sheet is a ruled block, not a dialog lifted off a blurred backdrop. */
.pdpa-doc .pdpa-inline { box-shadow: none; }
.pdpa-doc-note {
  margin: 22px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fafd;
  font-size: 12.8px;
  line-height: 1.6;
}
.pdpa-doc-foot {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: #587690;
}
.pdpa-doc-foot a { color: var(--navy); font-weight: 600; text-decoration: underline; }

.pdpa-head {
  flex: none;
  padding: 22px 28px 16px;
  border-bottom: 1px solid var(--line);
}
.pdpa-act {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #587690;
}
.pdpa-title { margin: 0; font-size: 21px; line-height: 1.3; letter-spacing: -.01em; }
.pdpa-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 18px;
  margin: 14px 0 0;
  padding: 0;
}
.pdpa-meta > div { min-width: 0; }
.pdpa-meta dt { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #587690; }
.pdpa-meta dd { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }

.pdpa-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px 28px 20px;
  /* One scrollbar for the whole notice, so the button at the foot is always where it was. */
  overscroll-behavior: contain;
}
.pdpa-read {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fafd;
  font-size: 13px;
  line-height: 1.6;
}
.pdpa-sec {
  counter-increment: pdpa-clause;
  padding: 0 0 14px;
}
.pdpa-sec + .pdpa-sec { border-top: 1px solid #eef2f7; padding-top: 14px; }
/* The clause marker and the section's own icon, then the title — the icon already names the
   subject in the consent card, so the document uses the same one. */
.pdpa-sec h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.4;
}
.pdpa-sec h2::before {
  content: counter(pdpa-clause) ".";
  color: #7a9bbd;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pdpa-sec h2 i { color: #2a6a9e; font-size: 13px; }
.pdpa-sec p { margin: 0 0 8px; font-size: 13.4px; line-height: 1.72; }
.pdpa-sec p:last-child { margin-bottom: 0; }

.pdpa-scope {
  margin: 0 0 14px;
  font-size: 12px;
  color: #587690;
}

/* The form is the middle band of the sheet: it fills whatever height the head leaves, and inside
   it the notice scrolls while the foot does not. */
.pdpa-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
}
.pdpa-ticks { margin: 0; padding: 0; border: 0; }
.pdpa-ticks legend {
  margin: 0 0 8px;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #587690;
}
.pdpa-tick {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}
.pdpa-tick + .pdpa-tick { margin-top: 8px; }
.pdpa-tick:hover { border-color: #b8c8dd; background: #fbfcfe; }
.pdpa-tick:has(:checked) { border-color: #86b0a0; background: #f4faf6; }
.pdpa-tick input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--navy, #082e63);
  cursor: pointer;
}
.pdpa-tick > span { min-width: 0; display: block; }
.pdpa-tick strong { display: block; font-size: 13px; line-height: 1.45; }
.pdpa-tick > span > span { display: block; margin-top: 3px; font-size: 12.4px; line-height: 1.62; }
.pdpa-tick em { display: block; margin-top: 5px; font-size: 11.4px; font-style: normal; color: #587690; }
.pdpa-tick.diberi em { color: #285c40; }

.pdpa-mandatory {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #e6d4ad;
  border-radius: 6px;
  background: #fff7e8;
  color: #72551f;
  font-size: 12.2px;
  line-height: 1.6;
}

/* The foot sits outside .pdpa-body, so it never scrolls: the button is found by feel at the foot
   of the paper, whether the member has read to the bottom of the notice or not. */
.pdpa-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-top: 1px solid var(--line);
  background: #f7fafd;
}
.pdpa-submit {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #0b2b4a;
  border-radius: 8px;
  background: #0b2b4a;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pdpa-submit:hover:not(:disabled) { background: #1a3f63; }
.pdpa-submit:active:not(:disabled) { background: #06203a; }
.pdpa-submit:disabled { border-color: var(--line); background: #e8edf4; color: #8494a8; cursor: not-allowed; }

/* The other action on the foot, and deliberately not its equal: reading the notice is optional,
   so it is an outlined link beside the filled button rather than a second button. */
.pdpa-notis {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--navy, #082e63);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.pdpa-notis:hover { border-color: #b8c8dd; background: #fbfcfe; }

/* Declining the notice is the same kind of choice as answering it, so it is a button of the same
   size as Teruskan. Red, not navy: the two sit side by side on one foot and must never be pressed
   for each other. */
.pdpa-tolak {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #dcaeb4;
  border-radius: 8px;
  background: #fdf2f3;
  color: #a51d2b;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.pdpa-tolak:hover { border-color: #c96b74; background: #fbe3e5; }
.pdpa-tolak:active { background: #f7d4d7; }

/*
 * The consent ledger on User/tetapan/privasi.php.
 *
 * One consent per ruled line in three rails — question, answer, stamp. A flex row that pushes the
 * answer to the far end of a wide sheet leaves a gap the size of the page between the two facts
 * that belong together, and the pill of one row never sits under the pill of the next.
 */
.pdpa-lejar { width: 100%; min-width: 620px; table-layout: fixed; border-collapse: collapse; font-size: 13.5px; color: #18364f; }
.pdpa-lejar :is(th, td) {
  padding: 13px 22px;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
  overflow-wrap: break-word;
  border-bottom: 1px solid #e4ebf2;
}
.pdpa-lejar thead th { background: #f0f5fa; font-weight: 600; white-space: nowrap; }
.pdpa-lejar thead th:first-child { width: 52%; }
.pdpa-lejar thead th:nth-child(2) { width: 165px; }
.pdpa-lejar tbody th { font-weight: 600; color: #0b2b4a; }
.pdpa-lejar .pdpa-tajuk i { margin-right: 8px; color: #2a6a9e; }
.pdpa-lejar small { display: block; margin-top: 3px; font-weight: 400; font-size: 12px; line-height: 1.5; color: #587690; }
/* A stamp is one fact: the pill and its time never break over two lines. */
.pdpa-lejar td:nth-child(2) { white-space: nowrap; }
/* An answer that was never given has no date to show, so the cell says so in the grey the rest of
   the portal uses for an unrecorded field. */
.pdpa-lejar .pdpa-kosong { color: #8aa0b4; }
.pdpa-lejar tbody tr:last-child :is(th, td) { border-bottom: 0; }
/* The actions on this sheet — the notice link under the ledger and the withdrawal under the field
   list — are controls, so they keep the settings row they live in and nothing in them is allowed
   to wrap over two lines. Keyed on the page rather than one band because the two rows sit apart. */
body.form-history-page .setting-row > :last-child { flex: none; white-space: nowrap; }
/* The flash reports on the ledger printed under it, so it keeps its own gap from that heading. */
.info-section > .password-warning { margin-bottom: 1.1rem; }

/*
 * The field-by-field inventory. It keeps the bordered frame of the history table but not its
 * column widths, which are tuned for form names and dates: a 7% column holding a whole sentence
 * stacked two words deep, centred, is what made this list unreadable. Two columns, both left
 * aligned — the field name in a rail a finger can run down, the reason free to use the sheet.
 */
.pdpa-inventori {
  width: 100%;
  min-width: 620px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13.5px;
  color: #18364f;
}
/* The gutters are sized for the sheet this table is drawn on, not for the shortest one: at 8px a
   row of text sat almost against the hairline below it while the right half of the purpose column
   stayed empty, so the list read as a squeeze instead of a reference. */
.pdpa-inventori :is(th, td) {
  padding: 13px 22px;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
  overflow-wrap: break-word;
  border-bottom: 1px solid #e4ebf2;
}
.pdpa-inventori thead th { background: #f0f5fa; font-weight: 600; white-space: nowrap; }
.pdpa-inventori thead th:first-child { width: 230px; }
.pdpa-inventori td:first-child { font-weight: 600; color: #0b2b4a; }
.pdpa-inventori tbody tr:not(.pdpa-kumpulan):hover { background: #f7fafc; }
.pdpa-inventori tbody:last-of-type tr:last-child td { border-bottom: 0; }
/* A band title is a rule with a name on it, not another row of data. */
.pdpa-inventori .pdpa-kumpulan th {
  padding: 10px 22px;
  background: #eef4fa;
  border-bottom-color: #dfe8f0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #3d6283;
}
.pdpa-inventori .pdpa-kumpulan i { margin-right: 7px; color: #2a6a9e; }
/*
 * Forty-odd fields are a reference, not a page. The frame shows one screen of the list and keeps
 * its two headings at the top while the rows scroll under them, so the consent ledger above stays
 * on the same screen as the list it belongs to.
 */
.pdpa-senarai { max-height: min(520px, 60vh); overflow: auto; }
.pdpa-inventori thead th { position: sticky; top: 0; z-index: 1; }

@media (max-width: 640px) {
  .pdpa-card { width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: 8px; }
  .pdpa-head, .pdpa-body, .pdpa-foot { padding-left: 18px; padding-right: 18px; }
  .pdpa-meta { grid-template-columns: 1fr; gap: 8px; }
  /* None of the three foot controls fits beside the others at this width, so they stack in the
     reading order they have on the desktop and each takes the full width of the paper. */
  .pdpa-foot { flex-direction: column; align-items: stretch; }
  .pdpa-doc { padding: 28px 18px 40px; }
}

/* The sheet is white paper by design, so in dark mode it stays paper — a notice printed on a
   dark screen is still read as a document, and the surrounding chrome follows the theme. */
html[data-theme="dark"] .pdpa-card { border-color: #2e4761; box-shadow: 0 24px 60px #000000a6; }
/* The portal-wide dark rule at the top of this theme paints every heading light-on-dark, and it
   reaches past <main> into the sheet. Paper is paper: the title of the notice stays ink. */
html[data-theme="dark"] body.member-page .pdpa-card .pdpa-head .pdpa-title { color: var(--ink); }
html[data-theme="dark"] .pdpa-read,
html[data-theme="dark"] .pdpa-foot { background: #f7fafd; }
html[data-theme="dark"] .pdpa-tick:hover,
html[data-theme="dark"] .pdpa-tick:has(:checked) { background: #fbfcfe; }

/* The ledger and the field list live inside the portal rather than on the paper, so they follow
   the theme instead of staying white. */
html[data-theme="dark"] body.member-page .pdpa-lejar { color: var(--ink); }
html[data-theme="dark"] body.member-page .pdpa-lejar thead th { background: #1a2d40; }
html[data-theme="dark"] body.member-page .pdpa-lejar :is(th, td) { border-bottom-color: var(--night-line); }
html[data-theme="dark"] body.member-page .pdpa-lejar tbody th { color: var(--night-strong); }
html[data-theme="dark"] body.member-page :is(.pdpa-lejar small, .pdpa-lejar .pdpa-kosong) { color: var(--night-muted); }
html[data-theme="dark"] body.member-page .pdpa-lejar .pdpa-tajuk i { color: var(--night-accent); }
html[data-theme="dark"] body.member-page .pdpa-inventori { color: var(--ink); }
html[data-theme="dark"] body.member-page .pdpa-inventori thead th { background: #1a2d40; }
html[data-theme="dark"] body.member-page .pdpa-inventori :is(th, td) { border-bottom-color: var(--night-line); }
html[data-theme="dark"] body.member-page .pdpa-inventori td:first-child { color: var(--night-strong); }
html[data-theme="dark"] body.member-page .pdpa-inventori tbody tr:not(.pdpa-kumpulan):hover { background: #182c42; }
html[data-theme="dark"] body.member-page .pdpa-inventori .pdpa-kumpulan th {
  background: #16283a;
  border-bottom-color: var(--night-line);
  color: #8fb4d8;
}
html[data-theme="dark"] body.member-page .pdpa-inventori .pdpa-kumpulan i { color: var(--night-accent); }

/* Text size and motion follow the shell's own rules for a card outside <main>. */
html[data-text-size="small"] .pdpa-card { zoom: .9; }
html[data-text-size="large"] .pdpa-card { zoom: 1.15; }

@media (prefers-reduced-motion: reduce) {
  .pdpa-body { scroll-behavior: auto; }
}

/* ==========================================================================
   Session-ended notice. assets/js/session.js mounts this <dialog> when the
   server reports the session is gone (30 minutes idle), so the member reads
   why before the login page appears instead of being dropped there.
   ========================================================================== */
/* dialog.* outranks page-wide resets such as body.login-page * that zero margin and padding. */
dialog.session-dialog {
  width: min(420px, calc(100vw - 32px));
  margin: auto;
  padding: 28px 24px 24px;
  border: 1px solid var(--line, #d9e2ec);
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink, #0b2b4a);
  text-align: center;
  font-family: inherit;
  box-shadow: 0 24px 60px #09295740;
}
/* A light tint with a strong blur: the member still sees their page behind, out of reach. */
.session-dialog::backdrop {
  background: rgba(9, 29, 51, .28);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.session-dialog[open] { animation: contact-pop .18s cubic-bezier(.2, .8, .2, 1); }
dialog.session-dialog .session-dialog-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #fff1e6;
  color: #d8632e;
  font-size: 24px;
}
dialog.session-dialog h2 { margin: 0 0 8px; font-size: 20px; }
dialog.session-dialog p { margin: 0 0 20px; font-size: 15px; line-height: 1.55; }
dialog.session-dialog .session-dialog-ok { justify-content: center; min-width: 140px; padding: .65rem 1.8rem; font-size: 15px; }
html[data-text-size="small"] .session-dialog { zoom: .9; }
html[data-text-size="large"] .session-dialog { zoom: 1.15; }
html[data-theme="dark"] .session-dialog { background: var(--night-chrome); color: var(--night-strong); }
html[data-theme="dark"] .session-dialog-icon { background: #3a2617; color: #f29a63; }
@media (prefers-reduced-motion: reduce) {
  .session-dialog[open] { animation: none; }
}

/* ==========================================================================
   Admin portal on the member shell.
   Admin/includes/layout.php mounts the member chrome (body.member-page.admin-portal)
   and puts each admin page in one .admin-panel inside <main>. The older .admin-body
   content rules still apply inside the panel; this block restyles them to the
   member look (soft blue lines, 14px panels, navy actions) and adds the night
   palette, so it must stay after both.
   ========================================================================== */
body.admin-portal { --admin-line: #dce7f3; --admin-soft: #f3f7fc; --admin-muted: #5b7590; --admin-hover: #f5f9fe; }
html[data-theme="dark"] body.admin-portal { --admin-line: var(--night-line); --admin-soft: var(--night-raised); --admin-muted: var(--night-muted); --admin-hover: #1d3145; }

/* Top navigation: the page name and a small badge naming the portal. */
.admin-portal .header-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.admin-portal .admin-portal-badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  background: #e8f1fb; border: 1px solid #c9dcf0; color: #07519a;
  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; white-space: nowrap;
}
html[data-theme="dark"] .admin-portal .admin-portal-badge { background: #1c3852; border-color: #2c4f70; color: var(--night-accent); }
.admin-portal .side-quote { text-transform: uppercase; letter-spacing: 1px; font-style: normal; font-size: 12px; }
.admin-portal .skip-link { z-index: 200; }

/* The page panel. */
body.admin-portal .admin-panel {
  display: block;
  margin-bottom: 8px;
  border: 1px solid var(--admin-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  color: var(--ink);
}
html[data-theme="dark"] body.admin-portal .admin-panel { background: var(--night-panel); }
.admin-portal .admin-panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid var(--admin-line);
}
.admin-portal .admin-panel-head::before { content: ""; width: 4px; height: 20px; border-radius: 4px; background: linear-gradient(#07519a, #4f8fcc); }
body.admin-portal main .admin-panel-head h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.3px; color: var(--ink); }
.admin-portal .admin-panel .page-body { padding: 18px 22px 22px; }
body.admin-portal .admin-panel .page-body h2 { font-size: 16px; font-weight: 800; color: var(--ink); }
body.admin-portal .admin-panel .page-body h3 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 18px 0 10px; }
.admin-portal .admin-panel .page-body a:not(.admin-action) { color: #07519a; }
html[data-theme="dark"] .admin-portal .admin-panel .page-body a:not(.admin-action) { color: var(--night-accent); }

/* Search bar. */
.admin-portal .admin-panel .page-body form[method="get"] {
  margin: 0 0 14px; padding: 0; gap: 10px; background: none; border: 0; border-radius: 0;
}
.admin-portal .admin-panel .page-body input:not([type="hidden"]):not([type="checkbox"]),
.admin-portal .admin-panel .page-body select,
.admin-portal .admin-panel .page-body textarea {
  min-height: 42px; border: 1px solid #cfdeed; border-radius: 10px; background: #fff; color: var(--ink);
  padding: 9px 13px; font: inherit; box-shadow: 0 1px 2px #0b2b4a0a; transition: border-color .15s, box-shadow .15s;
}
.admin-portal .admin-panel .page-body :is(input:not([type="hidden"]):not([type="checkbox"]), select, textarea):focus {
  outline: none; border-color: #4f8fcc; box-shadow: 0 0 0 3px #4f8fcc33;
}
.admin-portal .admin-panel .page-body form[method="get"] > input { flex: 1 1 260px; width: auto; max-width: 520px; }
html[data-theme="dark"] .admin-portal .admin-panel .page-body :is(input:not([type="hidden"]):not([type="checkbox"]), select, textarea) {
  background: var(--night-field); border-color: #2e4863; color: var(--night-strong); box-shadow: none;
}

/* Buttons and record actions. */
.admin-portal .admin-panel .page-body .admin-action { border-radius: 10px; font-weight: 700; gap: 7px; transition: background .15s, border-color .15s, color .15s; }
.admin-portal .admin-panel .page-body .admin-action i { font-size: .9em; }
.admin-portal .admin-panel .page-body :is(.admin-action-search, .admin-action-add, .admin-action-save, .btn-primary) {
  --action-bg: #07519a; --action-hover: #063f78; --action-border: #07519a; --action-text: #fff;
  min-height: 42px; padding: 9px 18px;
}
.admin-portal .admin-panel .page-body button:not(.admin-action):not(.password-visibility) { border-radius: 10px; background: #07519a; border-color: #07519a; }
.admin-portal .admin-panel .page-body button:not(.admin-action):not(.password-visibility):hover { background: #063f78; }
.admin-portal .admin-panel .page-body .admin-action-view {
  --action-bg: #eaf2fb; --action-hover: #d7e7f7; --action-border: #c9dcf0; --action-text: #07519a;
}
.admin-portal .admin-panel .page-body .admin-action-back {
  --action-bg: #f3f6fa; --action-hover: #e6edf5; --action-border: #d5dfea; --action-text: #3b5672;
  min-height: 38px; padding: 7px 14px;
}
html[data-theme="dark"] .admin-portal .admin-panel .page-body .admin-action:not(.admin-action-search):not(.admin-action-add):not(.admin-action-save) {
  --action-bg: #1c3852; --action-hover: #24405c; --action-border: #2c4f70; --action-text: #cfe1f2;
}
.admin-portal .admin-panel .page-body .admin-action:focus-visible { outline: 3px solid #4f8fcc; outline-offset: 2px; box-shadow: none; }

/* Result count. */
.admin-portal .admin-panel .page-body .admin-list-summary { margin: 0 0 10px; color: var(--admin-muted); font-size: 13px; }

/* Tables: rounded frame, quiet header, roomy rows, no column rules. */
.admin-portal .admin-panel .admin-table-wrap { margin: 0 0 6px; border: 1px solid var(--admin-line); border-radius: 12px; background: inherit; }
.admin-portal .admin-panel table { font-size: 13.5px; }
.admin-portal .admin-panel .admin-table-wrap table :is(th, td) { border-right: 0; }
body.admin-portal .admin-panel th {
  padding: 11px 14px; background: var(--admin-soft); color: var(--admin-muted);
  font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  border-bottom: 1px solid var(--admin-line);
}
body.admin-portal .admin-panel td { padding: 11px 14px; border-bottom: 1px solid var(--admin-line); color: var(--ink); vertical-align: middle; }
body.admin-portal .admin-panel tr:last-child td { border-bottom: 0; }
body.admin-portal .admin-panel tr:hover td { background: var(--admin-hover); }
body.admin-portal .admin-panel table:not(.admin-details) td:first-child { font-weight: 700; color: #07519a; font-variant-numeric: tabular-nums; }
html[data-theme="dark"] body.admin-portal .admin-panel table:not(.admin-details) td:first-child { color: var(--night-accent); }
body.admin-portal .admin-panel .admin-no-record { color: var(--admin-muted); font-style: normal; }
.admin-portal .admin-panel .page-body table td .admin-action { min-height: 32px; padding: 5px 12px; }
html[data-theme="dark"] body.admin-portal .admin-panel :is(td, h2, h3, strong) { color: var(--night-strong); }

/* Member detail: label column tinted, values in the strong ink. */
body.admin-portal .admin-panel .admin-details tr:first-child { display: none; }
body.admin-portal .admin-panel .admin-details th {
  text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600;
  background: var(--admin-soft); border-right: 1px solid var(--admin-line);
}
body.admin-portal .admin-panel .admin-details td { font-weight: 600; }
body.admin-portal .admin-panel :is(.admin-member-details, .admin-submission-details) .admin-details :is(th, td) { padding: 10px 14px; }

/* Member status pills. */
.admin-portal .admin-status-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.admin-portal .admin-status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.admin-portal .admin-status-pill--active { background: #e6f5ec; border-color: #b8e0c8; color: #17673f; }
.admin-portal .admin-status-pill--inactive { background: #f1f4f8; border-color: #d8e0ea; color: #52667b; }
.admin-portal .admin-status-pill--unknown { background: #fdf3e1; border-color: #f0d9a8; color: #8a6414; }
html[data-theme="dark"] .admin-portal .admin-status-pill--active { background: #133527; border-color: #1f5a3d; color: #7fdcaa; }
html[data-theme="dark"] .admin-portal .admin-status-pill--inactive { background: #1b2c3f; border-color: #2c4258; color: #a9bdd1; }
html[data-theme="dark"] .admin-portal .admin-status-pill--unknown { background: #3a2c10; border-color: #6a5220; color: #f1c66d; }

/* Pagination. */
.admin-portal .admin-panel .admin-pagination { margin: 16px 0 0; gap: 6px; }
.admin-portal .admin-panel .page-body .admin-pagination :is(a, .pagination-current) {
  min-width: 36px; min-height: 36px; border-radius: 10px; border-color: var(--admin-line);
  background: #fff; color: var(--ink);
}
.admin-portal .admin-panel .page-body .admin-pagination a:hover { background: #eaf2fb; border-color: #c9dcf0; }
.admin-portal .admin-panel .page-body .admin-pagination .pagination-current { background: #07519a; border-color: #07519a; color: #fff; }
html[data-theme="dark"] .admin-portal .admin-panel .page-body .admin-pagination a { background: var(--night-raised); color: var(--night-strong); }
html[data-theme="dark"] .admin-portal .admin-panel .page-body .admin-pagination a:hover { background: #24405c; }
html[data-theme="dark"] .admin-portal .admin-panel .page-body .admin-pagination .pagination-current { background: #2f74b8; border-color: #2f74b8; }

/* Notices. */
.admin-portal .admin-panel [role="alert"] { border-radius: 10px; border: 1px solid #f1c3ca; border-left-width: 4px; background: #fdeef0; color: #9e2233; }
.admin-portal .admin-panel [role="status"] { padding: 11px 14px; border-radius: 10px; border: 1px solid #b8e0c8; border-left-width: 4px; background: #e9f6ef; color: #17673f; }
html[data-theme="dark"] .admin-portal .admin-panel [role="alert"] { background: #3a1820; border-color: #6b2a36; color: #f5b3be; }
html[data-theme="dark"] .admin-portal .admin-panel [role="status"] { background: #133527; border-color: #1f5a3d; color: #9fe3bd; }

/* Settings and password pages sit inside the panel, so their own boxes lose the outer frame. */
.admin-portal .admin-panel.settings-page .settings-section,
.admin-portal .admin-panel .password-settings .settings-section { margin: 0 0 16px; padding: 18px 20px; border: 1px solid var(--admin-line); border-radius: 12px; background: inherit; }
.admin-portal .admin-panel.settings-page .settings-section:last-child { margin-bottom: 0; }
.admin-portal .admin-panel.settings-page .setting-row + .setting-row { border-top: 1px solid var(--admin-line); }

/* Narrow screens: tighter panel, the badge gives way to the page name. */
@media (max-width: 900px) {
  .admin-portal .admin-portal-badge { display: none; }
}
@media (max-width: 700px) {
  .admin-portal .admin-panel-head { padding: 14px 16px; }
  .admin-portal .admin-panel .page-body { padding: 14px 16px 18px; }
  body.admin-portal .admin-panel :is(th, td) { padding: 9px 10px; }
}
/* Names wrap after a sensible width instead of one word per line. */
body.admin-portal .admin-panel table:not(.admin-details):not(.admin-catalogue-table) td:nth-child(2) { min-width: 160px; }
/* Filled buttons keep white text in both palettes. */
body.admin-portal .admin-panel .page-body button:not(.admin-action):not(.password-visibility),
html[data-theme="dark"] body.admin-portal .admin-panel .page-body button:not(.admin-action):not(.password-visibility) { color: #fff; }
/* Row actions: "Lihat" and "Ringkasan" side by side; the Excel download wears the green of a sheet. */
.admin-portal .admin-panel .admin-row-actions { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.admin-portal .admin-panel p.admin-row-actions { display: flex; justify-content: flex-start; margin: 0 0 14px; }
.admin-portal .admin-panel .page-body .admin-action-download {
  --action-bg: #e6f5ec; --action-hover: #d2eedd; --action-border: #b8e0c8; --action-text: #17673f;
}
html[data-theme="dark"] .admin-portal .admin-panel .page-body .admin-action.admin-action-download {
  --action-bg: #133527; --action-hover: #1a4632; --action-border: #1f5a3d; --action-text: #7fdcaa;
}
body.admin-portal .admin-panel table:not(.admin-details):not(.admin-catalogue-table) :is(th, td):last-child { min-width: 0; }
.admin-portal .admin-panel td .admin-row-actions { flex-wrap: nowrap; }
.admin-portal .admin-panel .page-body td .admin-row-actions .admin-action { min-width: 0; padding: 5px 10px; white-space: nowrap; overflow-wrap: normal; word-break: normal; flex-shrink: 0; }
/* Long e-mails and phone lists wrap so the two row actions stay in view without scrolling. */
body.admin-portal .admin-panel table:not(.admin-details):not(.admin-catalogue-table) td:is(:nth-child(4), :nth-child(5)) { max-width: 220px; overflow-wrap: anywhere; }
/* List rows: "Lihat" and "Ringkasan" with their labels, always left and right on one line. */
.admin-portal .admin-panel td .admin-row-actions--pair { display: inline-flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 6px; }
.admin-portal .admin-panel .page-body td .admin-row-actions--pair .admin-action {
  min-height: 32px; padding: 5px 10px; margin: 0; gap: 6px; white-space: nowrap; flex: 0 0 auto;
}
body.admin-portal .admin-panel table:not(.admin-details):not(.admin-catalogue-table) :is(th, td):last-child { width: 1%; min-width: 0; white-space: nowrap; }
/* Buttons in the panel heading sit at its top right. */
.admin-portal .admin-panel-head .admin-panel-actions { margin-left: auto; display: flex; gap: 8px; }
.admin-portal .admin-panel-head .admin-action {
  --action-bg: #e6f5ec; --action-hover: #d2eedd; --action-border: #b8e0c8; --action-text: #17673f;
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 14px; border: 1px solid var(--action-border);
  border-radius: 10px; background: var(--action-bg); color: var(--action-text); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.admin-portal .admin-panel-head .admin-action:hover { background: var(--action-hover); }
.admin-portal .admin-panel-head .admin-action:focus-visible { outline: 3px solid #4f8fcc; outline-offset: 2px; }
html[data-theme="dark"] .admin-portal .admin-panel-head .admin-action { --action-bg: #133527; --action-hover: #1a4632; --action-border: #1f5a3d; --action-text: #7fdcaa; }
/* Narrower screens: the two labelled buttons drop their icons so the row still fits. */
@media (max-width: 1200px) {
  .admin-portal .admin-panel .page-body td .admin-row-actions--pair .admin-action { padding: 5px 8px; }
  .admin-portal .admin-panel .page-body td .admin-row-actions--pair .admin-action i { display: none; }
  body.admin-portal .admin-panel table:not(.admin-details):not(.admin-catalogue-table) td:nth-child(2) { min-width: 130px; }
  body.admin-portal .admin-panel table:not(.admin-details):not(.admin-catalogue-table) :is(th, td) { padding-left: 10px; padding-right: 10px; }
}

/* Member notifications: bell panel and inbox page.
   Unread = light bright blue with a dot, listed first; read = a white card with a grey outline below.
   Change the --notif-* colours here to retune both the panel and the page. */
:root {
  --notif-unread-bg: #e3f0fe;
  --notif-unread-hover: #d3e7fd;
  --notif-unread-line: #c6dcf5;
  --notif-read-bg: #ffffff;
  --notif-read-hover: #f4f7fb;
  --notif-read-line: #d9e1ea;
}
html[data-theme="dark"] {
  --notif-unread-bg: #1f3d60;
  --notif-unread-hover: #26496f;
  --notif-unread-line: #2f5880;
  --notif-read-bg: #152435;
  --notif-read-hover: #1b2c3f;
  --notif-read-line: #2e4560;
}

.notification-badge[hidden] { display: none; }
.notification-dropdown.notif-panel { width: min(380px, calc(100vw - 20px)); padding: 0; overflow: hidden; }
.notif-drop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 6px; }
.notif-drop-head strong { font-size: 1.15rem; }
.notif-read-all { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #1f5380; cursor: pointer; font-size: 15px; }
.notif-read-all:hover { background: #e3eefa; }
.notif-read-all[hidden] { display: none; }
.notif-tabs { display: flex; gap: 8px; padding: 6px 16px 10px; }
.notif-tabs button { min-height: 34px; padding: 6px 14px; border: 0; border-radius: 999px; background: #eef2f7; color: #385476; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.notif-tabs button:hover { background: #e0e7ef; }
.notif-tabs button[aria-pressed="true"] { background: #d3e7fd; color: #0b4f8f; }
.notif-drop-scroll { max-height: min(480px, 65vh); overflow-y: auto; padding: 0 8px 8px; }
.notif-drop-group[hidden] { display: none; }
.notif-drop-group h4 { margin: 6px 8px; color: #587690; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.notif-drop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.notif-drop-item a { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--notif-read-line); border-radius: 10px; background: var(--notif-read-bg); color: #385476; text-decoration: none; font-size: 13px; line-height: 1.4; }
.notif-drop-item a:hover { background: var(--notif-read-hover); }
.notif-drop-item.unread a { border-color: var(--notif-unread-line); background: var(--notif-unread-bg); }
.notif-drop-item.unread a:hover { background: var(--notif-unread-hover); }
.notif-drop-item .notif-icon { width: 44px; height: 44px; border-radius: 50%; font-size: 17px; }
.notif-drop-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.notif-drop-text b { color: var(--ink); font-weight: 500; }
.notif-drop-item.unread .notif-drop-text b { font-weight: 700; }
.notif-drop-text span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.notif-drop-text small { color: #6b819a; font-size: 12px; }
.notif-drop-item.unread .notif-drop-text small { color: #1f6fc0; font-weight: 700; }
.notif-drop-item .notif-dot { visibility: hidden; margin-top: 0; }
.notif-drop-item.unread .notif-dot { visibility: visible; }
.notif-drop-empty { margin: 0; padding: 28px 16px; text-align: center; }
.notif-drop-empty[hidden] { display: none; }
.notif-drop-foot { display: block; padding: 11px 16px; border-top: 1px solid var(--line); color: #1f5380; font-size: 13px; font-weight: 600; text-align: center; text-decoration: none; }
.notif-drop-foot:hover { background: #f1f6fb; }

.notif-switch-status { display: block; margin-top: 4px; color: #1a6e4a; font-weight: 600; }
.notif-switch-status:empty { display: none; }

.notif-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 1rem; }
.notif-filter { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid #dce6f2; border-radius: 0.5rem; background: #f5f8fc; }
.notif-filter a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: 6px; color: #385476; font-weight: 600; text-decoration: none; }
.notif-filter a:hover { background: #e3eefa; }
.notif-filter a.active { background: #fff; color: #0b2b4a; box-shadow: 0 1px 3px #123c6522; }
.notif-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #c22646; color: #fff; font-size: 11px; line-height: 20px; text-align: center; }
.notif-mark-all { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid #cbd5e1; border-radius: 0.5rem; background: #eef1f5; color: #475569; font: inherit; font-weight: 600; cursor: pointer; }
.notif-mark-all:hover { background: #e0e6ed; }
.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.notif-item a { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border: 1px solid var(--notif-read-line); border-radius: 0.5rem; background: var(--notif-read-bg); color: #173b5d; text-decoration: none; }
.notif-item a:hover { background: var(--notif-read-hover); }
.notif-item.unread a { border-color: var(--notif-unread-line); background: var(--notif-unread-bg); }
.notif-item.unread a:hover { background: var(--notif-unread-hover); }
.notif-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: #e3eefa; color: #286394; }
.notif-icon.notif-type-borang { background: #fdeee6; color: #b4532a; }
.notif-icon.notif-type-epenyata { background: #e4f4ec; color: #1a6e4a; }
.notif-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.notif-meta { color: #587690; font-size: 0.8rem; }
.notif-text strong { color: #0b2b4a; font-size: 1rem; font-weight: 500; }
.notif-item.unread .notif-text strong { font-weight: 700; }
.notif-body { color: #385476; font-size: 0.92rem; line-height: 1.55; overflow-wrap: anywhere; }
.notif-dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: #1f6fc0; }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 3rem 1rem; border: 1px dashed #c7d9ec; border-radius: 0.5rem; text-align: center; color: #587690; }
.notif-empty i { font-size: 2rem; color: #9bb4cc; margin-bottom: 6px; }
.notif-empty strong { color: #0b2b4a; }
.notif-empty p { margin: 0; }
.notif-pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 1.25rem; color: #587690; }
.notif-pager a { color: #1f5380; font-weight: 600; text-decoration: none; }
@media (max-width: 640px) {
  .notif-item a { padding: 14px; gap: 12px; }
  .notif-icon { width: 34px; height: 34px; }
}

html[data-theme="dark"] :is(.notif-read-all, .notif-drop-foot) { color: var(--night-accent); }
html[data-theme="dark"] :is(.notif-read-all:hover, .notif-drop-foot:hover) { background: #24405c; }
html[data-theme="dark"] .notif-tabs button { background: #22364b; color: var(--night-muted); }
html[data-theme="dark"] .notif-tabs button:hover { background: #2a4560; }
html[data-theme="dark"] .notif-tabs button[aria-pressed="true"] { background: #1f4a75; color: #d6ebff; }
html[data-theme="dark"] .notif-drop-group h4 { color: var(--night-muted); }
html[data-theme="dark"] .notif-drop-item a { color: var(--night-muted); }
html[data-theme="dark"] .notif-drop-text b { color: var(--night-strong); }
html[data-theme="dark"] .notif-drop-text small { color: var(--night-muted); }
html[data-theme="dark"] .notif-drop-item.unread .notif-drop-text small { color: var(--night-accent); }
html[data-theme="dark"] .notif-switch-status { color: #7fd3a8; }
html[data-theme="dark"] body.member-page .notif-filter { background: var(--night-field); border-color: var(--night-line); }
html[data-theme="dark"] body.member-page .notif-filter a { color: var(--night-muted); }
html[data-theme="dark"] body.member-page .notif-filter a:hover { background: #24405c; }
html[data-theme="dark"] body.member-page .notif-filter a.active { background: var(--night-raised); color: var(--night-strong); box-shadow: none; }
html[data-theme="dark"] body.member-page .notif-mark-all { background: #1d2f42; border-color: #33506b; color: #cddff0; }
html[data-theme="dark"] body.member-page .notif-mark-all:hover { background: #24405c; }
html[data-theme="dark"] body.member-page .notif-item a { color: var(--ink); }
html[data-theme="dark"] :is(.notification, body.member-page) .notif-icon { background: #0f1e2e; color: var(--night-accent); }
html[data-theme="dark"] :is(.notification, body.member-page) .notif-icon.notif-type-borang { background: #3a2418; color: #f0a37e; }
html[data-theme="dark"] :is(.notification, body.member-page) .notif-icon.notif-type-epenyata { background: #16332a; color: #7fd3a8; }
html[data-theme="dark"] body.member-page :is(.notif-meta, .notif-body, .notif-pager, .notif-empty) { color: var(--night-muted); }
html[data-theme="dark"] body.member-page :is(.notif-text strong, .notif-empty strong) { color: var(--night-strong); }
html[data-theme="dark"] .notif-dot { background: var(--night-accent); }
html[data-theme="dark"] body.member-page .notif-empty { border-color: var(--night-line); }
html[data-theme="dark"] body.member-page .notif-pager a { color: var(--night-accent); }

/* Member page changes. The brand, top bar and sidebar are captured as their own layers and
   held still, so only the page content changes: the old page fades out and the new one fades
   in while rising a few pixels. Member pages opt in with @view-transition in their <head>.
   Browsers without cross-page transitions get the same fade-in on load instead. */
body.member-page .app > .brand { view-transition-name: member-brand; }
body.member-page .app > .topbar { view-transition-name: member-topbar; }
body.member-page .app > .sidebar { view-transition-name: member-sidebar; }
::view-transition-group(member-brand),
::view-transition-group(member-sidebar),
::view-transition-old(member-brand),
::view-transition-new(member-brand),
::view-transition-old(member-sidebar),
::view-transition-new(member-sidebar) { animation: none; }
::view-transition-group(member-topbar) { animation-duration: .2s; }
::view-transition-old(root) { animation: member-page-out .18s ease-in both; }
::view-transition-new(root) { animation: member-page-in .34s cubic-bezier(.2, .8, .2, 1) .06s both; }
@keyframes member-page-out { to { opacity: 0; } }
@keyframes member-page-in { from { opacity: 0; transform: translateY(10px); } }
@supports not (view-transition-name: none) {
  body.member-page .app > main { animation: member-page-in .34s cubic-bezier(.2, .8, .2, 1) both; }
}

/* Thin bar across the top while the next page loads, so a click is answered at once. */
.page-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, #2f74b8, #efa925);
  pointer-events: none;
  transition: transform 2.4s cubic-bezier(.1, .7, .2, 1), opacity .25s ease;
}
.page-progress.running { transform: scaleX(.85); }
.page-progress.done { opacity: 0; transition: opacity .25s ease; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
  body.member-page .app > main { animation: none !important; }
  .page-progress { transition: none; }
}

/* Notifikasi page tabs filter in place: the area keeps a steady height so the footer does not
   jump, and the list fades in when the tab changes. */
.notif-inbox { min-height: 320px; }
.notif-inbox .notif-empty[hidden] { display: none; }
.notif-inbox[data-filter="belum"] .notif-item:not(.unread) { display: none; }
.notif-inbox.switching :is(.notif-list, .notif-empty) { animation: notif-tab-in .24s ease-out both; }
@keyframes notif-tab-in { from { opacity: 0; transform: translateY(4px); } }
.notif-filter a { transition: background-color .18s ease, color .18s ease, box-shadow .18s ease; }
@media (prefers-reduced-motion: reduce) {
  .notif-inbox.switching :is(.notif-list, .notif-empty) { animation: none; }
}

/* The bell panel is placed by assets/js/notifications.js: fixed to the window, lined up with
   the bell and kept inside the window at any width; the list scrolls within the space left. */
.notification-dropdown.notif-panel { position: fixed; right: auto; display: flex; flex-direction: column; box-sizing: border-box; }
.notification-dropdown.notif-panel[hidden] { display: none; }
.notif-panel .notif-drop-scroll { flex: 1 1 auto; min-height: 0; max-height: none; }
.notif-panel :is(.notif-drop-head, .notif-tabs, .notif-drop-foot) { flex: none; }

/* Tetapan: "Notifikasi pelayar ini" button (assets/js/web-push.js sets its label). */
.web-push-button { flex-shrink: 0; min-height: 40px; padding: 8px 16px; border: 1px solid #c7d9ec; border-radius: 0.5rem; background: #fff; color: #1f5380; font: inherit; font-weight: 600; cursor: pointer; }
.web-push-button:hover:not(:disabled) { background: #eef5fc; }
.web-push-button[data-state="on"] { border-color: #e3b7bd; color: #a51d2b; }
.web-push-button:disabled { opacity: .6; cursor: default; }
html[data-theme="dark"] body.member-page .web-push-button { background: #1d2f42; border-color: #33506b; color: var(--night-accent); }
html[data-theme="dark"] body.member-page .web-push-button[data-state="on"] { color: #ffb4bb; border-color: #7e3a44; }
[data-web-push-status]:is([data-state="denied"], [data-state="error"], [data-state="unsupported"]) { color: #a51d2b; }
html[data-theme="dark"] [data-web-push-status]:is([data-state="denied"], [data-state="error"], [data-state="unsupported"]) { color: #ffb4bb; }
.setting-row strong > label { display: inline; margin: 0; font: inherit; color: inherit; cursor: pointer; }

/* Admin submission page, dark mode: the "Pengurusan Serahan" panel and its history table
   follow the night palette instead of staying white (headings and labels were white-on-white). */
html[data-theme="dark"] .admin-body .admin-submission-response { background: var(--night-raised); border-color: var(--night-line); }
html[data-theme="dark"] .admin-body .admin-submission-response h3 { color: var(--night-strong); }
html[data-theme="dark"] .admin-body .admin-response-fields label,
html[data-theme="dark"] .admin-body .admin-response-fields label > span { color: var(--night-muted); }
html[data-theme="dark"] .admin-body .admin-progress { border-top-color: var(--night-line); }
html[data-theme="dark"] .admin-body .admin-progress .admin-table-wrap { background: var(--night-panel); }
html[data-theme="dark"] .admin-body .admin-progress-status { background: #1c3852; border-color: #2c4f70; color: #a9d1f5; }
html[data-theme="dark"] .admin-body .admin-progress-status--sedang_dimajukan { background: #3a2c10; border-color: #6a5220; color: #f1c66d; }
html[data-theme="dark"] .admin-body .admin-progress-status--selesai { background: #133527; border-color: #1f5a3d; color: #7fdcaa; }
/* The generic admin rule squeezes a table's last column to 1% for action buttons; in the
   processing history that column is the remark, so it gets its share back and may wrap. */
body.admin-portal .admin-panel .page-body table.admin-progress-table:not(.admin-details) :is(th, td):last-child { width: 40%; white-space: normal; overflow-wrap: anywhere; }

/* Admin > Notifikasi: send announcements / new-statement notices. */
.admin-body .admin-broadcast > [role="status"],
.admin-body .admin-broadcast > [role="alert"] { margin: 0 0 16px; }
.admin-body .admin-broadcast-form input[type="text"] { width: 100%; box-sizing: border-box; min-height: 46px; }
.admin-body .admin-broadcast-body { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; }
.admin-body .admin-broadcast-form textarea { width: 100%; box-sizing: border-box; resize: vertical; border: 1px solid #c9d8e4; border-radius: 0.5rem; padding: 10px 13px; background: #fff; color: #18364f; font: inherit; line-height: 1.6; }
.admin-body .admin-broadcast-target { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; padding: 14px 16px; border: 1px solid #dfe8f0; border-radius: 0.5rem; }
.admin-body .admin-broadcast-target legend { padding: 0 6px; font-weight: 700; color: #0b2b4a; }
.admin-body .admin-broadcast-target label { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.admin-body .admin-broadcast-target [hidden] { display: none; }
.admin-body .admin-broadcast-confirm { padding: 10px 12px; border-radius: 0.5rem; background: #fff3d6; color: #72551f; }
.admin-body .admin-broadcast-note { margin: 0 0 16px; color: #587690; font-size: 0.9rem; }
html[data-theme="dark"] .admin-body .admin-broadcast-target { border-color: var(--night-line); }
html[data-theme="dark"] .admin-body .admin-broadcast-target legend { color: var(--night-strong); }
html[data-theme="dark"] .admin-body .admin-broadcast-target label,
html[data-theme="dark"] .admin-body .admin-broadcast-note { color: var(--night-muted); }
html[data-theme="dark"] .admin-body .admin-broadcast-confirm { background: #3a2c10; color: #f1c66d; }
html body.admin-portal .admin-panel .page-body .admin-broadcast-target input:is([type="radio"], [type="checkbox"]) { flex: none; width: 18px; height: 18px; min-width: 0; min-height: 0; max-width: none; margin: 0; padding: 0; border-radius: 50%; box-shadow: none; accent-color: #1e577f; }
html body.admin-portal .admin-panel .page-body .admin-broadcast-target input[type="checkbox"] { border-radius: 4px; }
html body.admin-portal .admin-panel .page-body .admin-broadcast-target label { justify-content: flex-start; width: auto; font-weight: 500; }
html body.admin-portal .admin-panel .page-body .admin-broadcast-target label { flex-direction: row; align-items: center; text-align: left; gap: 10px; }
html body.admin-portal .admin-panel .page-body .admin-broadcast-form input[type="text"] { width: 100%; max-width: none; }
