:root {
  --navy: #08304d;
  --navy-2: #0f4a73;
  --navy-soft: #e8f1f7;
  --orange: #e07818;
  --orange-soft: #fff1e3;
  --ink: #1a2836;
  --muted: #5b6d7e;
  --line: #dce5ee;
  --paper: #eef3f7;
  --card: #ffffff;
  --bad: #b42318;
  --ok: #067647;
  --shadow: 0 10px 30px rgba(8, 48, 77, 0.08);
  --shadow-sm: 0 2px 10px rgba(8, 48, 77, 0.06);
  --radius: 14px;
  --font: "Roboto", "Segoe UI", sans-serif;
  --font-display: "Roboto", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(14, 74, 115, 0.12), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(224, 120, 24, 0.10), transparent 50%),
    linear-gradient(180deg, #f7fafc 0%, var(--paper) 40%, #e9eef3 100%);
  background-attachment: fixed;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--navy-2); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--orange); text-decoration: none; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  color: white;
  background: linear-gradient(135deg, #062538 0%, var(--navy) 45%, #0d4d78 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  overflow: visible;
}

.topbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px 14px;
  padding: 10px 22px;
  max-width: 1440px;
  margin: 0 auto;
  overflow: visible;
}
.topbar > .brand {
  flex: 0 0 auto;
}
.topbar > .main-nav {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}
.topbar > .user-menu {
  flex: 0 0 auto;
  margin-left: auto;
}

.brand { display: flex; flex-direction: column; gap: 1px; }
.brand strong {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.brand span {
  color: rgba(213, 228, 240, 0.85);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand a { color: white; }
.brand a:hover { color: #ffe1c4; }

.user-menu { position: relative; flex: 0 0 auto; z-index: 1; }
.user-menu.open { z-index: 120; }
.user-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: auto;
  max-width: 100%;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: white;
  font: inherit;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  transition: background 0.15s ease;
  transform: none;
}
.user-menu-toggle:has(img) {
  padding-left: 6px;
}
.user-menu-toggle:hover,
.user-menu.open .user-menu-toggle {
  background: rgba(255, 255, 255, 0.14);
  transform: none;
  filter: none;
}
.user-menu-toggle img {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  object-fit: cover;
  background: white;
  border: 2px solid rgba(255, 255, 255, 0.35);
}
.user-menu-id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  min-width: 0;
}
.user-menu .name { font-weight: 650; font-size: 14px; line-height: 1.2; white-space: nowrap; }
.user-menu .desig { color: rgba(213, 228, 240, 0.9); font-size: 12px; line-height: 1.2; white-space: nowrap; }
.user-menu-toggle::after {
  content: "";
  flex: 0 0 auto;
  width: 0;
  height: 0;
  margin: 0 0 0 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(255, 255, 255, 0.75);
}
.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(6, 37, 56, 0.22);
  padding: 6px;
  z-index: 120;
}
.user-menu.open .user-menu-dropdown { display: grid; }
.user-menu-dropdown a,
.user-menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
  font: inherit;
  font-weight: 550;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
  background: var(--navy-soft);
  color: var(--navy);
  text-decoration: none;
}
.user-menu-dropdown form { margin: 0; }
.user-menu-dropdown button { color: var(--bad); }
.user-menu-dropdown button:hover { background: #fef3f2; color: var(--bad); }
.photo-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.card.staff-edit-form > label,
.card.staff-edit-form > .photo-field {
  align-self: stretch;
}
.card.staff-edit-form textarea[name="Remarks"] {
  margin-top: 0;
  height: 168px;
  min-height: 168px;
  max-width: none;
  resize: none;
  box-sizing: border-box;
}
.photo-placeholder {
  position: relative;
  width: 148px;
  height: 168px;
  min-height: 168px;
  box-sizing: border-box;
  border: 1px dashed #c5d0db;
  border-radius: 12px;
  overflow: hidden;
  background: #f7fafc;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-preview.is-hidden,
.photo-empty.is-hidden,
.is-hidden { display: none !important; }
.photo-empty { color: var(--muted); font-size: 12px; }
.photo-placeholder input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  opacity: 0;
  cursor: pointer;
}
.app-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 24, 38, 0.45);
}
.app-dialog[hidden] { display: none; }
.app-dialog-card {
  width: min(420px, 100%);
  background: white;
  border-radius: 16px;
  padding: 22px 22px 16px;
  box-shadow: 0 24px 60px rgba(8, 48, 77, 0.28);
}
.app-dialog-card p {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.45;
}
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.app-dialog-actions button {
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: #e8eef4;
  color: var(--ink);
}
.profile-card {
  max-width: none;
  width: 100%;
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.profile-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0;
  border: 2px solid var(--line);
  flex: 0 0 72px;
}
.profile-photo-empty {
  display: grid;
  place-items: center;
  background: #e8eef4;
  color: var(--navy);
  font-weight: 700;
  font-size: 22px;
}
.profile-form { margin: 0; }
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 20px;
  align-items: start;
}
.card.profile-card label.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: #6b7c8f;
  min-width: 0;
}
.card.profile-card .profile-field input {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 40px;
  margin: 0;
  box-sizing: border-box;
  padding: 0 10px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.profile-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}
@media (max-width: 800px) {
  .profile-grid { grid-template-columns: 1fr; }
}
.linkish {
  background: transparent;
  color: #ffd7b0;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.linkish:hover { color: white; text-decoration: underline; }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  padding: 0;
  margin: 0;
  border-top: 0;
  max-width: none;
  overflow: visible;
}
.main-nav-home,
.main-nav-toggle {
  background: transparent;
  border: 0;
  color: rgba(220, 232, 242, 0.92);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.main-nav-toggle::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 7px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  vertical-align: middle;
  opacity: 0.7;
}
.main-nav-home:hover,
.main-nav-toggle:hover,
.main-nav-item.open .main-nav-toggle {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  text-decoration: none;
}
.main-nav-item { position: relative; z-index: 1; }
.main-nav-item.open { z-index: 120; }
.main-nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  max-height: min(70vh, 440px);
  overflow: auto;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(6, 37, 56, 0.22);
  padding: 8px;
  z-index: 120;
  animation: menuIn 0.16s ease;
}
.main-nav-item.open .main-nav-dropdown { display: grid; gap: 2px; }
.main-nav-dropdown a {
  display: block;
  padding: 10px 12px;
  color: var(--ink);
  border-radius: 8px;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 500;
}
.main-nav-dropdown .main-nav-denied {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  color: #9aa7b5;
  font: inherit;
  cursor: not-allowed;
}
.main-nav-dropdown a:hover {
  background: var(--navy-soft);
  color: var(--navy);
}

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

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Page shell ---- */
.page {
  width: min(1400px, calc(100% - 36px));
  max-width: 100%;
  margin: 28px auto 56px;
  animation: riseIn 0.35s ease both;
  overflow-x: hidden;
}

.section-title {
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.03em;
  margin: 22px 0 10px;
  font-weight: 700;
}

.card {
  background: var(--card);
  border: 1px solid rgba(220, 229, 238, 0.95);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.card label { display: block; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.card input { width: 100%; max-width: 320px; display: block; margin-top: 4px; }

/* ---- Control Panel / Dashboard ---- */
.cp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: start;
}
.cp-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 0 0 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, #f7fafc 0%, #eef4f9 55%, #f8fafc 100%);
}
.cp-hero-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.cp-hero-identity .person-avatar {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 35, 55, 0.06);
}
.cp-hero-identity .person-avatar-initials { font-size: 20px; }
.cp-hero h1 { margin: 4px 0 0; font-size: 28px; color: var(--navy); }
.cp-hero .dash-kicker {
  color: #8a5a2b;
}
.cp-hero .dash-sub {
  margin-top: 4px;
  color: #3d5266;
  font-size: 14px;
  font-weight: 550;
}
.cp-hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.cp-board { display: grid; gap: 14px; }
.cp-section { margin: 0; }
.cp-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.cp-collapse {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.cp-section-head h2 {
  margin: 0;
  font-size: 18px;
  color: var(--navy);
  flex: 1;
}
.cp-section-count,
.cp-section-link {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.cp-section-link {
  margin-left: auto;
  color: var(--navy-2);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.cp-section-link:hover { color: var(--orange); }
.cp-col-headers,
.cp-columns {
  display: grid;
  grid-template-columns: repeat(var(--cp-cols, 3), minmax(0, 1fr));
  gap: 10px;
}
.cp-col-headers { margin-bottom: 2px; }
.cp-col-header {
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 8px;
}
.cp-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.cp-tile-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}
.cp-tile-wrap.is-denied .cp-tile {
  background: #f3f5f7;
  border-color: #e3e8ee;
  color: var(--muted);
  cursor: not-allowed;
}
.cp-tile-wrap.is-denied .cp-tile-title { color: var(--muted); font-weight: 600; }
.cp-tile {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fb;
  color: inherit;
  text-decoration: none;
  min-height: 52px;
  font: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.cp-tile:hover {
  background: #eef4f9;
  border-color: #b9c9d8;
  color: inherit;
  text-decoration: none;
}
.cp-tile-wrap:not(.is-denied) .cp-tile:hover {
  transform: translateY(-1px);
}
.cp-tile-title {
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cp-tile-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f5c518;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.cp-tile-count.is-zero {
  background: #e8eef3;
  color: var(--muted);
}
.cp-tile-sep {
  align-self: center;
  color: var(--muted);
  font-weight: 700;
  opacity: 0.5;
}
.cp-tile-alt { flex: 1; }
.cp-rail {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 88px;
}
.cp-rail-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 241, 227, 0.55) 0%, rgba(255, 255, 255, 0.96) 42%),
    var(--card);
  box-shadow: var(--shadow-sm);
  padding: 12px;
}
.cp-rail-downloads {
  background:
    linear-gradient(180deg, rgba(232, 241, 247, 0.9) 0%, rgba(255, 255, 255, 0.98) 40%),
    var(--card);
}
.cp-rail-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(224, 120, 24, 0.28);
}
.cp-rail-banner h2 {
  margin: 0;
    font-size: 16px;
  color: var(--navy);
  flex: 1;
}
.cp-rail-detail {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-2);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}
.cp-rail-detail span { color: var(--orange); }
.cp-rail-detail:hover { color: var(--orange); }
.cp-rail-notices { margin-bottom: 12px; }
.cp-rail-marquee {
  max-height: 200px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}
.cp-notice {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.cp-notice h3 {
  margin: 0;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--navy);
  background: linear-gradient(90deg, #f5c518, #ffe58a);
  border-left: 4px solid #7cb342;
}
.cp-notice-body {
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.4;
}
.cp-notice-img {
  display: block;
  max-width: 100%;
  height: auto;
  padding: 0 10px 10px;
}
.cp-rail-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-top: 10px;
  overflow: hidden;
}
.cp-rail-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #f7fafc, #eef4f9);
  border-bottom: 1px solid var(--line);
}
.cp-rail-panel-head strong {
  color: var(--navy);
  font-size: 13.5px;
}
.cp-rail-tag {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.cp-rail-toggle {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.cp-rail-panel-body { padding: 10px; }
.cp-rail-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.cp-comm {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.cp-comm:last-child { margin-bottom: 0; }
.cp-comm img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--navy-soft);
}
.cp-comm-who {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  background: #f1f4f7;
  padding: 4px 6px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.cp-comm-who span { color: var(--navy-2); font-weight: 600; }
.cp-comm p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink);
}
.cp-comm time {
  display: block;
  margin-top: 4px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
}
.cp-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.cp-link-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cp-link-list img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}
.cp-link-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7cb342;
  flex-shrink: 0;
}
.cp-link-list a {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-dl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.cp-dl-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid #eef2f6;
}
.cp-dl-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7cb342;
  flex-shrink: 0;
}
.cp-dl-list a {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  min-width: 0;
}
.cp-dl-list span {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy-2);
}
.cp-rail-promo {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.cp-rail-promo img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
@media (max-width: 1100px) {
  .cp-layout { grid-template-columns: 1fr; }
  .cp-rail { position: static; }
}
@media (max-width: 900px) {
  .cp-col-headers,
  .cp-columns { grid-template-columns: 1fr; }
}
.dash-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 28px 30px;
  margin-bottom: 20px;
  color: white;
  background:
    linear-gradient(125deg, rgba(6, 37, 56, 0.92), rgba(15, 74, 115, 0.88) 55%, rgba(224, 120, 24, 0.78)),
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.18), transparent 35%);
  box-shadow: var(--shadow);
  animation: riseIn 0.4s ease both;
}
.dash-hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.dash-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 225, 196, 0.95);
  font-weight: 600;
}
.dash-hero h1 {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.04em;
  font-weight: 700;
  color: white;
}
.dash-sub {
  margin: 0;
  max-width: 52ch;
  color: rgba(232, 241, 247, 0.9);
  font-size: 15px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 20px;
}
.stat-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 229, 238, 0.9);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: riseIn 0.45s ease both;
}
.stat-card:nth-child(1) { animation-delay: 0.03s; }
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.09s; }
.stat-card:nth-child(4) { animation-delay: 0.12s; }
.stat-card:nth-child(5) { animation-delay: 0.15s; }
.stat-card:nth-child(6) { animation-delay: 0.18s; }
.stat-card:nth-child(7) { animation-delay: 0.21s; }
.stat-card:nth-child(8) { animation-delay: 0.24s; }
.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--navy-2);
}
.stat-card.tone-orange::before { background: var(--orange); }
.stat-card.tone-bad::before { background: var(--bad); }
.stat-card.tone-navy::before { background: var(--navy-2); }
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #c9d7e4;
}
.stat-link { color: inherit; display: block; text-decoration: none; }
.stat-link:hover { text-decoration: none; color: inherit; }
.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  margin-top: 10px;
  font-weight: 650;
  color: var(--ink);
  font-size: 14px;
}
.stat-hint { margin-top: 3px; color: var(--muted); font-size: 12.5px; }

.dash-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.dash-columns .card {
  animation: riseIn 0.5s ease both;
  animation-delay: 0.12s;
}
.dash-panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.dash-panel-title h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.dash-panel-title span {
  font-size: 12px;
  color: var(--muted);
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.activity-list li {
  display: grid;
  gap: 2px;
  padding: 12px 10px;
  margin: 0 -10px;
  border-radius: 10px;
  border-bottom: 1px solid #eef3f7;
  transition: background 0.15s ease;
}
.activity-list li:last-child { border-bottom: 0; }
.activity-list li:hover { background: #f6f9fb; }
.activity-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}
.activity-module {
  color: var(--navy-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10.5px;
}
.activity-title { font-weight: 600; font-size: 14px; }
.activity-detail { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.plans { display: grid; gap: 8px; }
.plan {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  margin: 0 -10px;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.plan:hover { background: #f6f9fb; }
.plan img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  background: #eef3f7;
}
.due {
  color: var(--bad);
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}
.plan a {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--navy-soft);
  color: var(--navy);
}
.plan a:hover { background: var(--orange-soft); color: var(--orange); }

/* ---- Shared UI ---- */
.groups { display: grid; gap: 18px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: white;
  min-height: 78px;
  box-shadow: var(--shadow-sm);
}
.tile strong { display: block; color: var(--navy); margin-bottom: 4px; }
.tile span { color: var(--muted); font-size: 12px; }
.tile.open { border-top: 3px solid var(--navy-2); }
.tile.open:hover { border-color: var(--orange); text-decoration: none; }
.tile.locked { background: #f7f8fa; color: #9aa6b2; }
.tile.locked strong, .tile.locked span { color: #9aa6b2; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.toolbar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  border: 1px solid #c8d4e0;
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  min-width: 180px;
  background: white;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
/* Custom chevron: square 16×16 glyph, optically centered in the control. */
select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4.25 6.25L8 10L11.75 6.25' stroke='%235a7184' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  padding-right: 34px;
}
select:not([multiple]):not([size])::-ms-expand { display: none; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #7aa4c4;
  box-shadow: 0 0 0 3px rgba(15, 74, 115, 0.12);
}

button.primary, a.primary {
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  box-shadow: 0 6px 16px rgba(8, 48, 77, 0.18);
  transition: transform 0.15s ease, filter 0.15s ease;
}
button.primary:hover, a.primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}
button.primary.danger { background: linear-gradient(180deg, #c9372c, var(--bad)); box-shadow: none; }
button.linkish.danger {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--bad);
  font: inherit;
  cursor: pointer;
  box-shadow: none;
}
button.linkish.danger:hover { text-decoration: underline; transform: none; filter: none; }
form.inline { display: inline; margin: 0; }
td.actions { white-space: nowrap; }
.card textarea, .card select, .card input[type="date"], .card input[type="number"] {
  width: 100%;
  max-width: 520px;
  display: block;
  margin-top: 4px;
}

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
table.data th, table.data td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 12px;
  vertical-align: top;
}
table.data th {
  background: #f3f7fb;
  color: var(--navy);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #f8fbfe; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.staff-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  padding: 6px 2px 2px;
}
.staff-pager-info {
  color: #7d8b99;
  font-size: 15px;
  font-weight: 500;
}
.staff-pager-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.staff-pager-nav a {
  color: var(--navy);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.staff-pager-nav a:hover { color: var(--orange); }

.login-body {
  margin: 0;
  min-height: 100vh;
  background: #061926;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}
.login-story {
  position: relative;
  overflow: hidden;
  color: #f4f8fb;
  padding: clamp(32px, 6vw, 72px);
  display: flex;
  align-items: center;
  background:
    linear-gradient(160deg, rgba(6, 37, 56, 0.55), rgba(8, 48, 77, 0.35) 45%, rgba(14, 74, 115, 0.2)),
    linear-gradient(135deg, #041824 0%, #08304d 48%, #0c4a6e 100%);
}
.login-aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.55;
  animation: loginDrift 14s ease-in-out infinite alternate;
}
.login-orb-a {
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  left: -12%;
  top: -18%;
  background: radial-gradient(circle, rgba(224, 120, 24, 0.45), transparent 68%);
}
.login-orb-b {
  width: 36vw;
  height: 36vw;
  max-width: 420px;
  max-height: 420px;
  right: -8%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(56, 168, 214, 0.35), transparent 70%);
  animation-delay: -4s;
  animation-duration: 18s;
}
.login-orb-c {
  width: 24vw;
  height: 24vw;
  max-width: 280px;
  max-height: 280px;
  left: 38%;
  bottom: -10%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%);
  animation-delay: -7s;
  animation-duration: 16s;
}
.login-story-inner {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
}
.login-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 214, 170, 0.92);
  font-weight: 650;
}
.login-brand {
  margin: 0 0 14px;
  font-family: "Outfit", var(--font-display);
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: #fff;
}
.login-tagline {
  margin: 0 0 22px;
  max-width: 42ch;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.45;
  color: rgba(226, 236, 244, 0.9);
}
.login-modules-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(190, 210, 224, 0.75);
  font-weight: 650;
}
.login-slider { margin-top: 8px; }
.login-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.login-slider-nav { display: flex; gap: 8px; }
.login-slider-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.login-slider-btn:hover {
  background: rgba(224, 120, 24, 0.28);
  border-color: rgba(224, 120, 24, 0.7);
  transform: translateY(-1px);
}
.login-slider-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 78%);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 2px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.login-slider-track::-webkit-scrollbar { display: none; }
.login-slide {
  scroll-snap-align: start;
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 16px 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}
.login-slide strong {
  font-family: "Outfit", var(--font);
  font-size: 16px;
  font-weight: 650;
  color: #fff;
}
.login-slide span {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(205, 220, 232, 0.9);
}
.login-slider-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 4px;
}
.login-slider-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
}
.login-slider-dot.is-active {
  width: 18px;
  background: var(--orange);
}
.login-anim {
  opacity: 0;
  transform: translateY(18px);
  animation: loginRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--d, 0s);
}
.login-panel {
  display: flex;
  min-height: 100vh;
  padding: 0;
  background:
    radial-gradient(720px 420px at 100% 0%, rgba(224, 120, 24, 0.12), transparent 55%),
    radial-gradient(640px 380px at 0% 100%, rgba(15, 74, 115, 0.08), transparent 50%),
    linear-gradient(165deg, #fbfcfd 0%, #f3f7fa 48%, #eaf0f5 100%);
  animation: loginPanelIn 0.55s ease both;
}
.login-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: clamp(32px, 8vh, 72px) clamp(28px, 6vw, 72px);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.login-form-main {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 28px 28px 30px;
  border: 1px solid rgba(220, 229, 238, 0.95);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 24px 50px rgba(8, 48, 77, 0.08);
  backdrop-filter: blur(10px);
}
.login-form-badge {
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(224, 120, 24, 0.12);
  color: #b86110;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.login-form h2 {
  margin: 0 0 6px;
  color: var(--navy);
  font-family: "Outfit", var(--font-display);
  font-size: clamp(30px, 4vw, 38px);
  letter-spacing: -0.03em;
  font-weight: 700;
}
.login-form p.lead {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.login-field {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 500;
  color: #607487;
}
.login-field span { margin: 0; }
.login-form input,
.login-field input {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 48px;
  margin: 0;
  box-sizing: border-box;
  border: 1px solid #d2dde8;
  border-radius: 12px;
  padding: 0 14px;
  background: #f8fafc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.login-form input:focus,
.login-field input:focus {
  background: #fff;
  border-color: #7aa4c4;
  box-shadow: 0 0 0 4px rgba(15, 74, 115, 0.12);
}
.login-submit {
  width: 100%;
  margin-top: 6px;
  height: 50px;
  border-radius: 12px;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.login-form-note {
  margin: 14px 0 0;
  color: #8093a5;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
.login-form > .fine {
  margin: auto 0 0;
  padding-top: 28px;
  text-align: center;
  color: #8a9aab;
  font-size: 11px;
}
@keyframes loginRise {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes loginDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(18px, -22px, 0) scale(1.06); }
}
@keyframes loginPanelIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story {
    min-height: auto;
    padding: 36px 24px 28px;
  }
  .login-brand { font-size: 44px; }
  .login-tagline { margin-bottom: 18px; }
  .login-slider-track { grid-auto-columns: minmax(200px, 86%); }
  .login-panel { min-height: auto; }
  .login-form {
    min-height: auto;
    padding: 24px 18px 36px;
  }
  .login-form-main { padding: 22px 20px 24px; }
}
@media (min-width: 1100px) {
  .login-slider-track { grid-auto-columns: minmax(220px, calc((100% - 24px) / 2.2)); }
}
@media (prefers-reduced-motion: reduce) {
  .login-anim,
  .login-orb,
  .login-panel {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  .login-slider-track { scroll-behavior: auto; }
}

.hp { position: absolute; left: -9999px; }
.alert {
  background: #fef3f2;
  color: var(--bad);
  border: 1px solid #fecdca;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.ok {
  background: #ecfdf3;
  color: var(--ok);
  border: 1px solid #abefc6;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.fine { color: var(--muted); font-size: 12.5px; margin-top: 14px; }
.projects { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.projects a, .projects span {
  background: var(--navy-soft);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 550;
}
dl.record { display: grid; grid-template-columns: 220px 1fr; gap: 8px 12px; }
dl.record dt { color: var(--muted); }
dl.record dd { margin: 0; }

/* ---- Staff ---- */
.staff-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  margin-top: 0;
}
body:has(.staff-layout) .page {
  margin-top: 14px;
}
.staff-filters {
  position: sticky;
  top: 110px;
  min-width: 0;
}
.staff-filters label { margin-bottom: 10px; }
.staff-filters select,
.staff-filters input { width: 100%; min-width: 0; }
.staff-filters button { width: 100%; margin-top: 4px; }
.staff-main {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.staff-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.staff-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: white;
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}
.staff-add-btn:hover {
  background: var(--orange);
  color: white;
  text-decoration: none;
}
.staff-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow-sm);
}
.staff-grid {
  font-size: 12px;
  border: 0;
  border-radius: 0;
  width: max-content;
  min-width: 100%;
  max-width: none;
}
.staff-grid th, .staff-grid td { padding: 6px 8px; white-space: nowrap; }
.staff-grid .num { text-align: right; }
.staff-grid .total-col { color: #990000; font-weight: 600; }
.staff-grid tr.group-div td { background: #3d5568; color: white; font-weight: 700; }
.staff-grid tr.group-dept td { background: #d9e4ee; font-weight: 700; padding-left: 10px; }
.staff-grid tr.page-total td { background: #e8eef4; font-weight: 700; }
.staff-grid tr.grand-total td { background: #3d5568; color: white; font-weight: 700; }
.staff-add {
  background: linear-gradient(180deg, #fff8e8, #fff1cf);
  border-color: #efd28a;
  margin-top: 16px;
}
.staff-add h3 { margin: 0 0 10px; color: #6b4a10; font-family: var(--font-display); }
.staff-add-form, .staff-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
.staff-add-form .span2, .staff-edit-form .span2 { grid-column: span 2; }
.staff-add-form label, .staff-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.staff-add-form input, .staff-add-form select, .staff-add-form textarea,
.staff-edit-form input, .staff-edit-form select, .staff-edit-form textarea {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.staff-row:hover td { background: #eef6fb !important; }

.emp-detail { padding: 0; overflow: hidden; }
.emp-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  background: linear-gradient(135deg, #3f6b6b, #5f8a8a);
  color: white;
}
.emp-detail-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: white;
}
.emp-detail-actions { display: flex; gap: 10px; align-items: center; }
.emp-back {
  color: #ffd7b0;
  font-weight: 700;
  padding: 8px 12px;
}
.emp-back:hover { color: white; }
.emp-detail-body {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 24px;
  padding: 22px 24px 28px;
}
.emp-detail-main { display: grid; gap: 0; }
.emp-row {
  display: grid;
  grid-template-columns: 130px 1fr 140px 140px;
  gap: 8px 14px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dotted #c9d4de;
}
.emp-row-wide { grid-template-columns: 130px 1fr; }
.emp-total-row { border-bottom-color: #9eb0c0; border-bottom-style: solid; }
.emp-label { color: var(--muted); font-size: 13px; }
.emp-label.emp-right { text-align: right; }
.emp-value { color: var(--ink); font-size: 14px; }
.emp-value.emp-span { grid-column: 2 / -1; }
.emp-money { text-align: right; font-variant-numeric: tabular-nums; }
.emp-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.emp-photo img {
  width: 140px;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #eef3f7;
  box-shadow: var(--shadow-sm);
}
.emp-photo-empty {
  width: 140px;
  height: 160px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: #f7fafc;
  font-size: 12px;
}
.emp-photo-meta { font-size: 13px; }

/* ---- ePayroll ---- */
.pay-grid { width: 100%; min-width: 720px; }
.pay-grid th, .pay-grid td { vertical-align: middle; }
.pay-check { width: 36px; text-align: center; }
.pay-toggle-col { width: 44px; text-align: center; }
.pay-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid #c8d4e0;
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.pay-toggle:hover { border-color: var(--navy); color: var(--orange); }
.pay-row.is-open td { background: #f8fbfe; }
.pay-row.pay-clickable { cursor: pointer; }
.pay-row.pay-clickable:hover td { background: #e8eff2; }
.pay-row.pay-under-review td { background: #fde8e8; }
.pay-row.pay-under-review:hover td { background: #f8d4d4; }
.pay-manage-col { width: 72px; text-align: center; }
.pay-manage-link { font-weight: 600; color: var(--navy); text-decoration: none; }
.pay-manage-link:hover { color: var(--orange); }
.pay-detail-row > td { padding: 0 !important; background: #fbfcfd; }
.pay-detail { padding: 12px 14px 14px; }
.pay-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.pay-col { padding: 12px 14px 14px; min-width: 0; }
.pay-col + .pay-col { border-left: 1px solid var(--line); }
.pay-block {
  padding: 0 0 14px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
}
.pay-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.pay-section {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 6px;
}
#pay-refdocs a { font-weight: 600; color: var(--navy); text-decoration: none; }
#pay-refdocs a:hover { color: var(--orange); }
.pay-side-block {
  margin: 0 0 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}
.pay-side-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.pay-side-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pay-side-links li { margin: 0 0 6px; }
.pay-side-links a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}
.pay-side-links a:hover { color: var(--orange); }
.pay-list-toolbar {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.pay-list-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}
.pay-add-link {
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.pay-add-link:hover { color: var(--orange); }
.pay-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}
.pay-add-btn:hover {
  border-color: var(--navy);
  color: var(--orange);
}
.pay-note {
  display: grid;
  grid-template-columns: minmax(140px, 32%) 1fr;
  gap: 10px 14px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f5;
  font-size: 13px;
  align-items: start;
}
.pay-note.coo { color: #b42318; }
.pay-note.acct { color: #1d4ed8; }
.pay-note time, .pay-empty { color: var(--muted); font-size: 12px; white-space: nowrap; }
.trans-note-person {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}
.trans-note-avatar {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 8px;
  overflow: hidden;
  background: #e8eef3;
  position: relative;
}
.trans-note-photo {
  width: 50px;
  height: 50px;
  object-fit: cover;
  display: block;
}
.trans-note-initials {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: #1e3a5f;
  background: linear-gradient(160deg, #d7e3ef, #b7c9db);
}
.trans-note-who {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: var(--ink);
}
.trans-note-who strong { font-size: 13px; line-height: 1.25; }
.trans-note-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.trans-note-body time { align-self: flex-end; }
@media (max-width: 720px) {
  .pay-note { grid-template-columns: 1fr; }
}
.pay-empty { white-space: normal; margin: 0; }
.pay-empty-cell { text-align: center; color: var(--muted); padding: 28px 12px !important; }
.pay-files { width: 100%; border-collapse: collapse; font-size: 13px; }
.pay-files td { padding: 5px 6px 5px 0; border-bottom: 1px solid #eef2f5; vertical-align: top; }
.pay-files .num { width: 28px; color: var(--muted); }
.pay-view { width: 48px; text-align: right; }
.pay-comment {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  max-width: 520px;
}
.pay-comment label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.pay-comment textarea {
  display: block;
  width: 100%;
  min-height: 68px;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}
.pay-comment .primary {
  justify-self: start;
  width: auto;
}
.pay-back { margin: 0 0 10px; }
.pay-meta { padding: 12px 14px 0; }

/* ---- eTransportation ---- */
.trans-hub { max-width: 720px; }

/* ---- Material / Equipment summary hubs (full-bleed; must follow .trans-hub) ---- */
body:has(.mat-hub) .page {
  width: calc(100% - 24px);
  max-width: none;
  margin-top: 14px;
  margin-left: 12px;
  margin-right: 12px;
}
.trans-hub.mat-hub,
.mat-hub {
  max-width: none !important;
  width: 100%;
  min-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.mat-hub-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  flex: 1 1 auto;
  align-items: stretch;
  min-height: 0;
  width: 100%;
}
.mat-hub-cols > div {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-width: 0;
}
.mat-hub-cols .trans-contents {
  flex: 0 1 auto;
  align-content: start;
}
.mat-hub-cols > div > .trans-contents:last-child {
  flex: 1 1 auto;
}
.mat-hub-col-title {
  margin: 0 0 8px;
  padding: 8px 12px;
  font-weight: 700;
  background: #d9dee3;
  border: 1px solid #c5ccd3;
  border-radius: 4px;
}
.mat-hub-col-title + .trans-contents + .mat-hub-col-title {
  margin-top: 18px;
}
@media (max-width: 900px) {
  .mat-hub-cols { grid-template-columns: 1fr; }
  .mat-hub { min-height: auto; }
}

/* ---- eEquipment status detail ---- */
body:has(.eq-sheet) .page {
  width: calc(100% - 24px);
  max-width: none;
  margin-top: 14px;
  margin-left: 12px;
  margin-right: 12px;
}
.eq-sheet {
  --eq-ink: #16324f;
  --eq-muted: #5b6b7c;
  --eq-line: #d5dee8;
  --eq-soft: #f3f6f9;
  --eq-accent: #1f6f8b;
  width: 100%;
  max-width: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--eq-line);
  background: linear-gradient(180deg, #f7fafc 0%, #ffffff 140px);
  box-shadow: 0 10px 28px rgba(16, 48, 77, 0.06);
}
.eq-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--eq-line);
}
.eq-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--eq-muted);
  font-weight: 600;
}
.eq-sheet-head h1 {
  margin: 0;
  color: var(--eq-ink);
  font-size: 24px;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.eq-sheet-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.eq-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
}
.eq-status--review { background: #fdeceb; color: #9b2c2c; border-color: #f3c1c1; }
.eq-status--checked { background: #e8f1fb; color: #1d4f91; border-color: #bfd3ef; }
.eq-status--submitted { background: #eef8f0; color: #1f6b3a; border-color: #b7dfc2; }
.eq-status--closed { background: #f4f6e8; color: #5d6b2e; border-color: #d5dcb0; }
.eq-status--forwarded { background: #fff6e8; color: #8a5a12; border-color: #efd3a3; }
.eq-status--default { background: var(--eq-soft); color: var(--eq-ink); border-color: var(--eq-line); }
.eq-back {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--eq-line);
  background: #fff;
  color: var(--eq-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}
.eq-back:hover { background: var(--eq-soft); border-color: #b9c9d8; }
.eq-meta {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(120px, 0.5fr) minmax(220px, 1.6fr);
  gap: 12px;
  padding: 16px 22px;
  background: linear-gradient(90deg, rgba(31, 111, 139, 0.05), transparent 55%);
}
.eq-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--eq-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}
.eq-meta-item--wide { min-width: 0; }
.eq-meta-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--eq-muted);
  font-weight: 700;
}
.eq-meta-item strong {
  color: var(--eq-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}
.eq-form { padding: 0 22px 22px; }
.eq-panel { margin-top: 18px; }
.eq-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}
.eq-panel-head h2 {
  margin: 0;
  font-size: 16px;
  color: var(--eq-ink);
  letter-spacing: -0.02em;
}
.eq-panel-note { color: var(--eq-muted); font-size: 12px; font-weight: 600; }
.eq-table-wrap {
  overflow: auto;
  border: 1px solid var(--eq-line);
  border-radius: 14px;
  background: #fff;
}
.eq-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
  font-size: 13px;
}
.eq-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1a3a57;
  color: #f4f8fc;
  font-weight: 600;
  padding: 10px 8px;
  border-bottom: 1px solid #12293f;
  text-align: center;
  white-space: nowrap;
}
.eq-grid thead tr:nth-child(2) th {
  top: 38px;
  background: #234866;
  font-size: 12px;
  font-weight: 500;
}
.eq-grid td {
  padding: 9px 8px;
  border-bottom: 1px solid #e8eef4;
  color: #243746;
  vertical-align: middle;
}
.eq-grid tbody tr:hover td { background: #f7fafc; }
.eq-grid .num { text-align: right; font-variant-numeric: tabular-nums; color: #31485c; }
.eq-grid .eq-total { font-weight: 700; color: var(--eq-ink); }
.eq-col-sr { width: 42px; text-align: center; color: var(--eq-muted); }
.eq-col-code { width: 64px; text-align: center; }
.eq-col-code code {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef3f7;
  color: #35506a;
  font-size: 11px;
  font-weight: 700;
}
.eq-col-name { text-align: left; font-weight: 600; color: var(--eq-ink); }
.eq-col-gm { min-width: 160px; }
.eq-remark { color: var(--eq-muted); max-width: 180px; }
.eq-group td {
  background: linear-gradient(90deg, #d9e7ef, #eef4f8);
  color: var(--eq-ink);
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 10px 12px;
  border-bottom-color: #c9d8e4;
}
.eq-grand td {
  background: #edf2f6;
  font-weight: 700;
  color: var(--eq-ink);
  border-bottom: 0;
}
.eq-grand-label { text-align: right; padding-right: 12px !important; }
.eq-empty, .eq-comments-empty {
  text-align: center;
  color: var(--eq-muted);
  padding: 28px 16px !important;
  font-weight: 600;
}
.eq-gm-input {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #d7e0e9;
  border-radius: 8px;
  background: #fffdf5;
  color: #7a3b12;
  font-size: 13px;
}
.eq-gm-input:focus {
  outline: none;
  border-color: #c9a46a;
  box-shadow: 0 0 0 3px rgba(201, 164, 106, 0.18);
}
.eq-gm-input[readonly] { background: #f7f9fb; color: #516273; }
.eq-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 16px;
  margin-top: 8px;
}
.eq-comments, .eq-gm {
  border: 1px solid var(--eq-line);
  border-radius: 14px;
  background: #fff;
  padding: 14px 16px 16px;
  min-height: 180px;
}
.eq-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.eq-comment-list li {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--eq-soft);
  border: 1px solid #e4ebf1;
}
.eq-comment-who {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 6px;
}
.eq-comment-who strong { color: var(--eq-ink); }
.eq-comment-who span { color: var(--eq-accent); font-size: 12px; font-weight: 600; }
.eq-comment-list p { margin: 0; color: #31485c; line-height: 1.45; }
.eq-comment-list time {
  display: block;
  margin-top: 8px;
  text-align: right;
  color: var(--eq-muted);
  font-size: 11px;
}
.eq-gm textarea {
  width: 100%;
  min-height: 140px;
  box-sizing: border-box;
  border: 1px solid #d7e0e9;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fffdf5;
  color: #31485c;
  resize: vertical;
  font: inherit;
  line-height: 1.45;
}
.eq-gm textarea:focus {
  outline: none;
  border-color: #c9a46a;
  box-shadow: 0 0 0 3px rgba(201, 164, 106, 0.18);
}
.eq-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 4px;
}
.eq-submit {
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #2a6f95, #1f5878);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(31, 88, 120, 0.22);
}
.eq-submit:hover { filter: brightness(1.05); }
@media (max-width: 980px) {
  .eq-meta { grid-template-columns: 1fr 1fr; }
  .eq-meta-item--wide { grid-column: 1 / -1; }
  .eq-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .eq-sheet-head { flex-direction: column; padding: 16px 14px 12px; }
  .eq-meta { grid-template-columns: 1fr; padding: 12px 14px; }
  .eq-form { padding: 0 14px 16px; }
}

.trans-contents { display: grid; gap: 8px; }
.trans-content-row {
  display: grid;
  grid-template-columns: 1fr 72px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fb;
  color: inherit;
  text-decoration: none;
}
.trans-content-row:hover {
  background: #eef4f9;
  border-color: #b9c9d8;
}
.trans-content-title { font-weight: 650; color: var(--navy); }
.trans-content-count {
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--navy);
}
.mp-site-comments-head {
  background: #606a51;
  color: #ffffcc;
  font-weight: 700;
  text-align: center;
  padding: 8px 10px;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}
.mp-site-comments {
  width: 100%;
  min-height: 150px;
  background: #ffffcc;
  border: 1px solid #a9b09f;
  border-radius: 0 0 8px 8px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}
.mp-detail-meta {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 10px 16px;
  margin: 14px 0 18px;
}
.mp-detail-meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.mp-detail-meta-full { grid-column: 1 / -1; }
.mp-remark { color: #0066ff; }
.mp-strength-grid .mp-qty,
.mp-strength-grid .mp-line-remark {
  width: 100%;
  background: #ffffcc;
  border: 1px solid #d5d9c8;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}
.mp-strength-grid .mp-qty { text-align: right; max-width: 72px; }
.mp-strength-grid .mp-total { text-align: right; font-weight: 600; }
.mp-grand td { background: #eef0ef; font-weight: 700; }
.mp-grand-label { text-align: right; }
.mp-grand-num { text-align: right; }
.mp-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}
.mp-detail-actions .primary { text-decoration: none; }
.mp-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mp-link-actions {
  display: inline-flex;
  gap: 10px;
  font-size: 12px;
}
.mp-date-crit {
  border: 0;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.mp-radio-row {
  display: grid;
  grid-template-columns: 18px auto 1fr auto 1fr;
  gap: 6px;
  align-items: center;
  font-size: 13px;
}
.mp-radio-row input[type="radio"] { margin: 0; }
.mp-radio-row input[type="date"],
.mp-radio-row input[type="text"],
.mp-radio-row select {
  width: 100%;
  min-width: 0;
}
.mp-radio-row:nth-child(3),
.mp-radio-row:nth-child(4) {
  grid-template-columns: 18px auto 1fr;
}
.mp-month-year {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 6px;
}
#mp-monthly .primary {
  display: block;
  width: 100%;
  margin-top: 6px;
}
.trans-back-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
}
.trans-meta {
  display: grid;
  grid-template-columns: 140px 160px 1fr 220px;
  gap: 12px;
  margin: 14px 0 16px;
}
.trans-meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.trans-meta .trans-span { grid-column: span 1; }
.trans-status { color: #b42318; }
.trans-detail-body { margin-bottom: 14px; }
.trans-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.trans-notes > section,
.trans-final {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}
.trans-final { margin-top: 4px; }
.trans-upload {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fb;
}
.trans-upload label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.trans-upload textarea,
.trans-reply {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  background: #ffffe8;
}
.trans-link-btn {
  border: 0;
  background: none;
  color: var(--navy);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  padding: 0;
}
.trans-link-btn:hover { color: var(--orange); }
.trans-edit-form { margin-top: 12px; }
.trans-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 20px;
  margin-top: 14px;
  align-items: start;
}
.trans-field-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-width: 0;
}
.trans-field-wide { grid-column: auto; }
.trans-field-full { grid-column: 1 / -1; }
.trans-edit .trans-field-label,
.trans-edit label.trans-field-label {
  display: block;
  margin: 0;
  margin-bottom: 0;
  padding: 0;
  height: 16px;
  line-height: 16px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7c8f;
}
.trans-edit .trans-field-card input,
.trans-edit .trans-field-card select,
.trans-edit .trans-field-card textarea,
.card.trans-edit .trans-field-card input,
.card.trans-edit .trans-field-card select,
.card.trans-edit .trans-field-card textarea {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 40px;
  margin: 0;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  font: inherit;
  line-height: 38px;
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
}
.trans-edit .trans-field-card select,
.card.trans-edit .trans-field-card select {
  background-position: right 10px center;
  background-size: 16px 16px;
  padding-right: 32px;
}
.trans-edit .trans-field-card textarea,
.card.trans-edit .trans-field-card textarea {
  height: auto;
  min-height: 72px;
  padding: 8px 10px;
  line-height: 1.4;
  resize: vertical;
}
.trans-edit .trans-field-card input:disabled,
.trans-edit .trans-field-card select:disabled,
.trans-edit .trans-field-card textarea:disabled,
.trans-edit .trans-field-card input[readonly],
.trans-edit .trans-field-card textarea[readonly] {
  background: #fff;
  color: #334155;
  opacity: 1;
}
.trans-field-card .fine {
  margin: 0;
  font-size: 11px;
  color: #8090a0;
}
.trans-meta input,
.trans-meta select {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.trans-meta label.emp-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
@media (max-width: 800px) {
  .trans-edit-grid {
    grid-template-columns: 1fr;
  }
  .trans-field-wide,
  .trans-field-full {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---- Support pages ---- */
.support-shell {
  display: grid;
  gap: 14px;
}
.support-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(8, 48, 77, 0.06), rgba(224, 120, 24, 0.08)),
    linear-gradient(180deg, #ffffff, #f7fafc);
  box-shadow: var(--shadow-sm);
}
.support-hero .dash-kicker {
  color: var(--orange);
}
.support-hero .dash-sub {
  color: #000;
}
.support-hero h1 {
  margin: 4px 0 0;
  font-size: 28px;
  color: var(--navy);
}
.support-hero-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-2);
  white-space: nowrap;
}
.support-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}
.support-page h1 {
  margin: 0;
  font-size: 22px;
  color: var(--navy);
}
.support-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.support-accent {
  width: 10px;
  align-self: stretch;
  min-height: 28px;
  border-radius: 999px;
  background: #a5d334;
}
.support-back { margin-top: 18px; }
.faq-list { display: grid; gap: 8px; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 0;
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  color: var(--navy);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary { background: var(--navy-soft); }
.faq-no {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 13px;
  color: var(--navy-2);
}
.faq-answer {
  padding: 0 14px 14px 52px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
.support-form {
  display: grid;
  gap: 10px;
}
.support-form.support-form-grid,
form.support-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 12px;
  align-items: start;
}
.support-field {
  display: grid;
  grid-template-rows: 20px 42px 18px;
  gap: 6px;
  min-width: 0;
  align-content: start;
}
.support-field.support-span-all {
  grid-template-rows: 20px minmax(128px, auto) 18px;
}
.support-field > label {
  margin: 0;
  padding: 0;
  display: block;
  font-size: 12.5px;
  line-height: 20px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.support-field > input,
.support-field > textarea {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.support-field > textarea {
  height: auto;
  min-height: 128px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.4;
}
.support-field > input:focus,
.support-field > textarea:focus {
  outline: none;
  border-color: #8fb4d0;
  box-shadow: 0 0 0 3px rgba(15, 74, 115, 0.12);
}
.support-form .req { color: var(--bad); }
.support-field > .field-error {
  display: block;
  margin: 0;
  min-height: 18px;
  line-height: 18px;
  font-size: 12px;
  font-weight: 500;
  color: var(--bad);
  overflow: hidden;
}
.support-span-2 { grid-column: span 2; }
.support-span-all { grid-column: 1 / -1; }
.support-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.support-form-actions .fine { margin: 0; }
.support-form-actions .primary { min-width: 160px; }
.support-pending {
  margin: 24px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}
.contact-office-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.contact-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
}
.contact-office-top h2 {
  margin: 0;
  font-size: 20px;
  color: var(--navy);
}
.contact-sub {
  margin: 4px 0 0;
  font-weight: 600;
  color: var(--muted);
}
.contact-badge {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}
.contact-office-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.contact-meta-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 14px;
}
.contact-meta-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--navy);
}
.contact-meta-card > p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}
.contact-section-head {
  margin-bottom: 12px;
}
.contact-section-head h2 {
  margin: 0;
  font-size: 16px;
  color: var(--navy);
}
.contact-people {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.contact-person {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.contact-name {
  display: block;
  color: var(--navy);
  font-size: 15px;
  margin-bottom: 2px;
}
.contact-role {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--orange);
}
.contact-meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.contact-meta-list li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 13px;
}
.contact-meta-list span {
  color: var(--muted);
  font-weight: 600;
}
.contact-meta-list strong {
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}
@media (max-width: 900px) {
  .contact-people { grid-template-columns: 1fr 1fr; }
  .contact-office-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .support-hero { flex-direction: column; align-items: flex-start; }
  .support-form.support-form-grid,
  form.support-form-grid { grid-template-columns: 1fr; }
  .support-span-2 { grid-column: 1 / -1; }
  .contact-people { grid-template-columns: 1fr; }
  .contact-office-top { flex-direction: column; }
}

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-columns { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .emp-detail-body { grid-template-columns: 1fr; }
  .emp-photo { order: -1; align-items: flex-start; }
  .emp-row { grid-template-columns: 120px 1fr; }
  .emp-label.emp-right { text-align: left; margin-top: 6px; }
  .emp-money { text-align: left; }
  .emp-value.emp-span { grid-column: 2; }
}

@media (max-width: 800px) {
  .tiles { grid-template-columns: 1fr; }
  .topbar {
    align-items: center;
    flex-wrap: nowrap;
    padding: 10px 14px;
    gap: 8px;
  }
  .topbar > .brand { flex: 0 0 auto; }
  .topbar > .main-nav {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
  }
  .topbar > .user-menu { flex: 0 0 auto; margin-left: auto; }
  .main-nav-home,
  .main-nav-toggle {
    font-size: 12px;
    padding: 7px 8px;
  }
  .page { width: calc(100% - 24px); margin-top: 18px; }
  .dash-hero { padding: 22px 18px; }
  dl.record { grid-template-columns: 1fr; }
  .staff-layout { grid-template-columns: 1fr; }
  .pay-body { grid-template-columns: 1fr; }
  .pay-col + .pay-col { border-left: 0; border-top: 1px solid var(--line); }
  .trans-meta, .trans-notes { grid-template-columns: 1fr; }
  .staff-filters { position: static; }
  .staff-add-form, .staff-edit-form { grid-template-columns: 1fr; }
  .staff-add-form .span2, .staff-edit-form .span2 { grid-column: span 1; }
  .stat-grid { grid-template-columns: 1fr; }
  .main-nav-dropdown {
    position: static;
    box-shadow: none;
    margin: 0 0 6px;
    max-height: none;
    animation: none;
  }
  .emp-detail-head { flex-direction: column; align-items: flex-start; }
}

/* ----- Downloads (PHP mod_downloads) ----- */
.dl-categ-list {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dl-categ-list .section-title { font-size: 14px; margin-bottom: 6px; }
.dl-categ-link {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}
.dl-categ-link em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}
.dl-categ-link:hover,
.dl-categ-link.is-active {
  background: #eef5f8;
  color: var(--accent, #1a5f7a);
}
.dl-categ-row td {
  background: #c6d0cc !important;
  color: #8b1e1e;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px !important;
}
.dl-detail { display: flex; flex-direction: column; gap: 18px; max-width: 920px; }
.dl-detail-top { display: flex; justify-content: flex-start; }
.dl-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.9fr);
  gap: 22px 28px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(26, 95, 122, 0.06), transparent 42%),
    #fff;
}
.dl-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a5f7a;
  font-weight: 700;
}
.dl-detail-title {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.25;
  color: var(--text);
  font-weight: 700;
}
.dl-detail-summary {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
  max-width: 54ch;
}
.dl-detail-facts {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
}
.dl-detail-facts > div {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5f8fa;
  border: 1px solid #e6eef2;
}
.dl-detail-facts dt {
  margin: 0 0 3px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.dl-detail-facts dd {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}
.dl-attach-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.dl-attach-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}
.dl-attach-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.dl-attach-count {
  font-size: 12px;
  color: var(--muted);
}
.dl-attach-empty {
  padding: 28px 18px;
  text-align: center;
  color: #a33;
  font-size: 14px;
}
.dl-attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dl-attach-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid #eef2f4;
}
.dl-attach-item:first-child { border-top: 0; }
.dl-attach-item:hover { background: #f9fbfc; }
.dl-attach-item.is-missing { opacity: 0.72; }
.dl-attach-type {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #e8f1f5;
  color: #1a5f7a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.dl-attach-type[data-type="PDF"] { background: #fdeceb; color: #b42318; }
.dl-attach-type[data-type="DOC"],
.dl-attach-type[data-type="DOCX"] { background: #eaf1ff; color: #175cd3; }
.dl-attach-type[data-type="XLS"],
.dl-attach-type[data-type="XLSX"] { background: #e9f8ef; color: #067647; }
.dl-attach-type[data-type="PPT"],
.dl-attach-type[data-type="PPTX"] { background: #fff4e5; color: #b54708; }
.dl-attach-body { min-width: 0; }
.dl-attach-name {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  word-break: break-word;
}
.dl-attach-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.dl-attach-warn { color: #a33; }
.dl-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #1a5f7a;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
.dl-download-btn:hover { background: #154d63; }
.dl-download-disabled {
  display: inline-block;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
  align-items: center;
}
.pager a, .pager span {
  min-width: 32px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  border: 1px solid var(--line);
  color: var(--text);
}
.pager a:hover { background: #eef5f8; }
.pager .is-current {
  background: #1a5f7a;
  border-color: #1a5f7a;
  color: #fff;
  font-weight: 600;
}
table.data td.center, table.data th.center { text-align: center; }
table.data td.right { text-align: right; }
table.data td.empty {
  text-align: center;
  padding: 36px 16px !important;
  color: #a33;
}
@media (max-width: 800px) {
  .dl-detail-hero { grid-template-columns: 1fr; }
  .dl-attach-item { grid-template-columns: 48px minmax(0, 1fr); }
  .dl-attach-action { grid-column: 2; }
}

/* ----- eNews & Events (PHP mod_news) ----- */
.news-page { display: flex; flex-direction: column; gap: 16px; max-width: 920px; }
.news-page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  flex-wrap: wrap;
}
.news-page-title {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  line-height: 1.2;
}
.news-page-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.news-search {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.news-search input[type="search"],
.news-search select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}
.news-search input[type="search"] { min-width: 200px; }
.news-list-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.news-list-meta {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
  font-size: 13px;
  color: var(--muted);
}
.news-list-meta strong { color: var(--text); }
.news-empty {
  padding: 40px 16px;
  text-align: center;
  color: #a33;
}
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.news-list-item {
  display: grid;
  grid-template-columns: 44px 110px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid #eef2f4;
  text-decoration: none;
  color: inherit;
}
.news-list li:first-child .news-list-item { border-top: 0; }
.news-list-item:hover { background: #f7fbfd; }
.news-list-no {
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}
.news-list-date {
  font-size: 13px;
  color: #1a5f7a;
  font-weight: 650;
}
.news-list-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}
.news-list-go {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.news-list-item:hover .news-list-go { color: #1a5f7a; }
.news-detail { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.news-detail-hero {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(26, 95, 122, 0.06), transparent 45%),
    #fff;
}
.news-detail-title {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.3;
}
.news-detail-date {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: #1a5f7a;
  font-weight: 650;
}
.news-detail-body {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  line-height: 1.65;
  font-size: 15px;
  color: var(--text);
}
.news-detail-body a { color: #1a5f7a; }
@media (max-width: 800px) {
  .news-list-item {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-areas:
      "no date"
      "no title"
      "no go";
  }
  .news-list-no { grid-area: no; }
  .news-list-date { grid-area: date; }
  .news-list-title { grid-area: title; }
  .news-list-go { grid-area: go; }
}

/* ----- eMultimedia / Video Gallery (PHP mod_videos) ----- */
.mm-page { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.mm-page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  flex-wrap: wrap;
}
.mm-page-title {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  line-height: 1.2;
}
.mm-page-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.mm-search {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.mm-search input[type="search"],
.mm-search select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}
.mm-search input[type="search"] { min-width: 200px; }
.mm-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.mm-panel-meta {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
  font-size: 13px;
  color: var(--muted);
}
.mm-panel-meta strong { color: var(--text); }
.mm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 20px;
  color: #a33;
  text-align: center;
}
.mm-empty p { margin: 0; font-size: 15px; }
.mm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  padding: 16px;
}
.mm-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e6eef2;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mm-card:hover {
  border-color: #b7d0db;
  box-shadow: 0 6px 18px rgba(26, 95, 122, 0.08);
}
.mm-card.is-missing { opacity: 0.75; }
.mm-card-thumb {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 120px;
  background: linear-gradient(180deg, #fff8d6, #fff1a8);
}
.mm-card-thumb img { width: 56px; height: 56px; object-fit: contain; }
.mm-card-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(26, 95, 122, 0.92);
  color: #fff;
  font-size: 11px;
}
.mm-card-body { padding: 12px 14px 14px; }
.mm-card-body h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 650;
}
.mm-card-file, .mm-card-warn {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.mm-card-warn { color: #a33; }
.mm-detail { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.mm-detail-hero {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(26, 95, 122, 0.06), transparent 45%),
    #fff;
}
.mm-detail-title {
  margin: 0;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  line-height: 1.3;
}
.mm-player-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f1720;
  overflow: hidden;
  padding: 16px;
}
.mm-player {
  display: block;
  width: 100%;
  max-height: 480px;
  background: #000;
  border-radius: 10px;
}
.mm-player-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.mm-player-empty,
.mm-player-legacy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 18px;
  text-align: center;
  color: #e8eef3;
  background: #1a2430;
  border-radius: 10px;
}
.mm-player-legacy p {
  margin: 0;
  max-width: 42ch;
  line-height: 1.5;
  font-size: 14px;
  color: #c9d4de;
}
.mm-player-empty p { margin: 0; color: #f0b4b4; }

/* ----- eImage Gallery (PHP mod_imggallery) ----- */
.gal-page { display: flex; flex-direction: column; gap: 16px; }
.gal-page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  flex-wrap: wrap;
}
.gal-page-title {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  line-height: 1.2;
}
.gal-page-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.gal-search {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.gal-search input,
.gal-search select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}
.gal-search input[type="search"] { min-width: 180px; }
.gal-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.gal-categs { padding: 14px; position: sticky; top: 12px; }
.gal-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.gal-panel-meta {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
  font-size: 13px;
  color: var(--muted);
}
.gal-panel-meta strong { color: var(--text); }
.gal-empty {
  padding: 40px 16px;
  text-align: center;
  color: #a33;
}
.gal-categ-banner {
  padding: 8px 16px;
  background: #c6d0cc;
  color: #8b1e1e;
  font-weight: 700;
  font-size: 13px;
}
.gal-list { display: flex; flex-direction: column; }
.gal-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid #eef2f4;
  text-decoration: none;
  color: inherit;
}
.gal-item:hover { background: #f7fbfd; }
.gal-item-cover {
  width: 96px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #eef3f6;
  display: grid;
  place-items: center;
}
.gal-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gal-item-placeholder {
  font-size: 11px;
  color: var(--muted);
}
.gal-item-body { min-width: 0; }
.gal-item-no {
  display: inline-block;
  margin-right: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}
.gal-item-body time {
  font-size: 12px;
  color: #1a5f7a;
  font-weight: 650;
}
.gal-item-body h2 {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 650;
}
.gal-item-count {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.gal-item-go {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.gal-detail { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.gal-detail-hero {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(26, 95, 122, 0.06), transparent 45%),
    #fff;
}
.gal-detail-title {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.3;
}
.gal-detail-meta {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 13px;
  color: #1a5f7a;
  font-weight: 650;
}
.gal-viewer {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.gal-viewer-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 18px 56px;
  background: #111820;
}
.gal-viewer-figure {
  margin: 0;
  max-width: 100%;
  text-align: center;
}
.gal-viewer-figure img {
  max-width: 100%;
  max-height: 520px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.gal-viewer-figure figcaption {
  margin-top: 12px;
  color: #d7e0e8;
  font-size: 14px;
}
.gal-viewer-missing {
  color: #f0b4b4;
  padding: 40px 20px;
}
.gal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.12);
  color: #fff !important;
  text-decoration: none !important;
  font-size: 24px;
  line-height: 1;
}
.gal-nav:hover { background: rgba(255,255,255,0.22); }
.gal-nav-prev { left: 12px; }
.gal-nav-next { right: 12px; }
.gal-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  padding: 14px;
  background: #f8fafb;
  border-top: 1px solid var(--line);
}
.gal-thumb {
  display: block;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #e8eef2;
}
.gal-thumb.is-active { border-color: #1a5f7a; }
.gal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gal-thumb-missing {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
}
@media (max-width: 900px) {
  .gal-layout { grid-template-columns: 1fr; }
  .gal-categs { position: static; }
  .gal-item { grid-template-columns: 72px minmax(0, 1fr); }
  .gal-item-go { display: none; }
  .gal-item-cover { width: 72px; height: 56px; }
  .gal-viewer-stage { padding: 14px 44px; min-height: 260px; }
}

/* ----- eCommunity (articles / blogs / complaints / suggestions) ----- */
.eco-page { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.eco-page-wide,
.eco-detail-wide { max-width: none; width: 100%; }
body:has(.eco-page-wide) .page,
body:has(.eco-detail-wide) .page {
  width: min(1400px, calc(100% - 48px));
}
.eco-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-end;
}
.eco-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-end;
  margin: 0;
}
.eco-toolbar-filters label,
.eco-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.eco-toolbar-spacer {
  display: block;
  line-height: 1.2;
  visibility: hidden;
  user-select: none;
}
.eco-toolbar-filters select,
.eco-toolbar-filters input[type="search"],
.eco-toolbar-btn {
  min-height: 36px;
  height: 36px;
  box-sizing: border-box;
  border-radius: 8px;
}
.eco-toolbar-filters select,
.eco-toolbar-filters input[type="search"] {
  border: 1px solid var(--line);
  padding: 0 10px;
  background: #fff;
  min-width: 120px;
}
.eco-toolbar-filters input[type="search"] { min-width: 180px; }
.eco-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
}
a.eco-toolbar-btn {
  text-decoration: none;
  color: #fff;
}
.eco-panel-wide .table-wrap { overflow-x: auto; }
.eco-panel-wide table.data td:nth-child(4) {
  white-space: normal;
  word-break: break-word;
}
.eco-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}
.eco-head h1 { margin: 0; font-size: clamp(1.4rem, 2vw, 1.8rem); }
.eco-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.eco-search, .eco-head-actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.eco-search input[type="search"] {
  min-height: 36px;
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}
.eco-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.eco-meta {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
  font-size: 13px;
  color: var(--muted);
}
.eco-meta strong { color: var(--text); }
.eco-empty { padding: 40px 16px; text-align: center; color: #a33; }
.eco-article-list { display: flex; flex-direction: column; }
.eco-article-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border-top: 1px solid #eef2f4;
}
.eco-article-card:first-child { border-top: 0; }
.eco-author {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  background: #616a54;
  color: #ffffcc;
  border-radius: 10px;
  padding: 10px 8px 12px;
}
.eco-author img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #4d5543;
}
.eco-author strong { font-size: 12px; color: #ffffcc; }
.eco-author span { font-size: 11px; color: #e8ecc8; }
.eco-article-body h2 { margin: 0 0 8px; font-size: 16px; }
.eco-article-body p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 14px; }
.eco-article-actions { margin-top: 10px; text-align: right; }
.eco-detail { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.eco-detail.eco-detail-wide { max-width: none; }
.eco-detail-hero {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(26, 95, 122, 0.06), transparent 45%),
    #fff;
}
.eco-detail-hero h1 { margin: 0; font-size: clamp(1.3rem, 2vw, 1.7rem); line-height: 1.3; }
.eco-detail-author {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}
.person-avatar {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #e8eef3;
}
.person-avatar-sm { width: 36px; height: 36px; }
.person-avatar-md { width: 48px; height: 48px; }
.person-avatar-lg { width: 60px; height: 60px; }
.person-avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.person-avatar-photo.is-hidden { display: none; }
.person-avatar-initials {
  position: absolute;
  inset: 0;
  display: grid !important;
  place-items: center;
  margin: 0;
  padding: 0;
  text-align: center;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1e3a5f;
  background: linear-gradient(160deg, #d7e3ef, #b7c9db);
  border-radius: 50%;
  box-sizing: border-box;
}
.person-avatar-initials.is-hidden { display: none !important; }
.person-avatar-sm .person-avatar-initials { font-size: 12px; }
.person-avatar-md .person-avatar-initials { font-size: 15px; }
.person-avatar-lg .person-avatar-initials { font-size: 18px; }
.person-avatar-olive .person-avatar-initials {
  color: #ffffcc;
  background: linear-gradient(160deg, #7a8468, #616a54);
}
.eco-detail-author .person-avatar {
  border: 1px solid var(--line);
}
.eco-detail-author strong { display: block; }
.eco-detail-author > div span { display: block; font-size: 12px; color: var(--muted); }
.eco-date { color: #1a5f7a !important; font-weight: 650; }
.eco-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 13px;
  color: #1a5f7a;
  font-weight: 650;
}
.eco-detail-body {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  line-height: 1.65;
  font-size: 15px;
}
.eco-comments {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 18px 20px;
}
.eco-comments h2 { margin: 0 0 14px; font-size: 16px; }
.eco-comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.eco-comment-list li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
.eco-comment-list img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.eco-comment-head { display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.eco-comment-head span { color: var(--muted); }
.eco-comment-list p { margin: 4px 0 0; line-height: 1.45; }
.eco-comment-form, .eco-edit-form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.eco-comment-form textarea, .eco-edit-form textarea, .eco-ticket-reply textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}
.eco-edit-form { padding: 18px; }
.eco-edit-actions { display: flex; gap: 12px; align-items: center; }
.eco-ticket-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.eco-ticket-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 16px 18px;
}
.eco-ticket-block h2 { margin: 0 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.eco-ticket-block p { margin: 0; line-height: 1.55; white-space: pre-wrap; }
.eco-ticket-reply form { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 800px) {
  .eco-article-card { grid-template-columns: 1fr; }
  .eco-ticket-grid { grid-template-columns: 1fr; }
}

.epr-filter-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px 14px;align-items:end}
.epr-filter-grid label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}
.epr-filter-grid select,.epr-filter-grid input{min-height:36px;padding:6px 8px;border:1px solid var(--line);border-radius:8px;background:#fff}
.epr-filter-actions{display:flex;align-items:end}
.epr-type{display:block;font-size:11px}
.epr-detail-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:14px;align-items:flex-end}
.epr-inline-form,.epr-decide-form{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-end}
.epr-decide-form{flex-direction:column;align-items:stretch;width:min(100%,480px)}
.epr-decide-buttons{display:flex;gap:8px;flex-wrap:wrap}
.epr-facts{margin-top:8px}
.epr-line-form{margin:12px 0 18px;padding:14px;border:1px dashed var(--line);border-radius:12px;background:#fafbfc}
.epr-line-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px 12px;margin-bottom:12px}
.epr-line-grid label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}
.epr-line-grid input,.epr-line-grid select,.epr-line-grid textarea{min-height:34px;padding:6px 8px;border:1px solid var(--line);border-radius:8px}
.epr-span-2{grid-column:span 2}
.epr-edit-form .epr-edit-actions{display:flex;gap:14px;align-items:center;margin-top:16px}
.epr-filters{padding:16px 18px}
button.linkish{background:none;border:0;color:var(--accent,#1a5f7a);cursor:pointer;padding:0;text-decoration:underline;font:inherit}
form.inline{display:inline}

/* ePR PHP-style layout: left filters, right grid/detail */
.epr-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}
body:has(.epr-layout) .page,
body:has(.epr-detail-full) .page { margin-top: 14px; max-width: none; width: min(100% - 32px, 1400px); }
.epr-detail-full { width: 100%; }
.epr-detail-titlebar-links {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}
.epr-sidebar {
  position: sticky;
  top: 110px;
  min-width: 0;
}
.epr-side-link {
  display: inline-block;
  margin: 0 0 10px;
  color: #1a5f7a;
  font-size: 13px;
  font-weight: 600;
}
.epr-side-link:hover { text-decoration: underline; }
.epr-side-form { display: flex; flex-direction: column; gap: 10px; }
.epr-side-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #445566; }
.epr-side-form select,
.epr-side-form input { width: 100%; min-width: 0; min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.epr-side-form button { width: 100%; margin-top: 4px; }
.epr-main { padding: 16px 18px; min-width: 0; }
.epr-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.epr-pager-info {
  color: #667788;
  font-size: 13px;
  font-weight: 500;
}
.epr-pager-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  max-width: 100%;
}
.epr-pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
}
a.epr-pager-btn:hover {
  background: #eef5f8;
  border-color: #b8c9d4;
  color: var(--navy);
  text-decoration: none;
}
.epr-pager-btn.is-current {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  cursor: default;
}
.epr-pager-btn.is-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.epr-pager-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: #8899aa;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.epr-main-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}
.epr-main-head h1 { margin: 2px 0 0; font-size: 22px; color: var(--navy); }
.epr-grid th, .epr-grid td { font-size: 13px; }
.epr-detail-sheet { padding-bottom: 24px; }
.epr-detail-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.epr-detail-titlebar h1 { margin: 0; font-size: 20px; color: var(--navy); }
.epr-status-pill {
  padding: 6px 12px;
  border-radius: 8px;
  background: #ffe4e4;
  color: #9b1c1c;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid #f5b5b5;
}
.epr-header-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 14px;
  margin-bottom: 16px;
}
.epr-header-grid > div {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}
.epr-header-grid span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.epr-header-grid strong { font-size: 13px; color: var(--navy); font-weight: 650; }
.epr-notes { margin: 0 0 14px; padding: 10px 12px; background: #fff8e8; border: 1px solid #efd28a; border-radius: 8px; }
.epr-notes p { margin: 0 0 6px; font-size: 13px; }
.epr-notes p:last-child { margin-bottom: 0; }
.epr-section-label {
  margin: 4px 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.epr-items-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.epr-items-wrap .epr-items-grid { margin: 0; border: 0; }
.epr-items-grid { font-size: 12px; min-width: 1180px; width: max-content; }
.epr-items-grid th, .epr-items-grid td { white-space: nowrap; padding: 6px 8px; }
.epr-items-grid .epr-chk-col { width: 36px; text-align: center; vertical-align: middle; }
.epr-items-grid .epr-chk-col input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin: 0;
  background: #ffffcc;
  accent-color: var(--navy);
  cursor: pointer;
}
.epr-action-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.epr-action-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #445; }
.epr-action-panel textarea,
.epr-action-panel select { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.epr-decide-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.epr-btn-approve,
.epr-btn-reject,
.epr-btn-cancel {
  min-width: 110px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
}
.epr-btn-approve { background: #1f7a3a; color: #fff; }
.epr-btn-reject { background: #c0392b; color: #fff; }
.epr-btn-cancel { background: #fff; color: #c0392b; border-color: #c0392b; }
@media (max-width: 900px) {
  .epr-layout { grid-template-columns: 1fr; }
  .epr-sidebar { position: static; }
}

.epr-status-text { color: #9b1c1c; }
.epr-items-grid input,
.epr-items-grid select {
  width: 100%;
  min-width: 70px;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffcc;
  font-size: 12px;
}
.epr-input-qty { max-width: 88px; text-align: right; }
.epr-input-sm { max-width: 64px; }
.epr-obs { background: #ffffcc; }
.epr-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: #445;
}
.epr-status-row-alone { margin-top: 12px; padding: 10px 0; }
.epr-reroute-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.epr-reroute-row label { width: 100%; max-width: 360px; }
.epr-reroute-row .linkish,
.epr-reroute-row button {
  margin: 0;
  align-self: flex-start;
}
.epr-followup-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}
.epr-upload-comments { margin-top: 0; }
.hidden-form { display: none; }
.epr-line-cut { text-decoration: line-through; opacity: 0.75; }
.epr-coo-block { background:#ffe0e0; border:1px solid #e09090; padding:10px 12px; border-radius:8px; margin-bottom:8px; }
.epr-resub-block { background:#f3e0ff; border:1px solid #c090e0; padding:10px 12px; border-radius:8px; margin-bottom:8px; }
.epr-inline-pm { color:#c00; font-size:12px; display:block; margin-top:4px; }
.epr-span-wide { grid-column: 1 / -1; }

.epr-edit-sheet { padding: 16px 18px 22px; width: 100%; }
.epr-step-kicker {
  margin: 0 0 4px;
  color: #990000;
  font-size: 13px;
  font-weight: 700;
}
.epr-edit-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 280px)) minmax(0, 1fr);
  gap: 14px 18px;
  margin-bottom: 16px;
}
.epr-edit-field { display: flex; flex-direction: column; gap: 4px; }
.epr-edit-field > label { margin: 0; font-size: 13px; color: #445566; font-weight: 600; }
.epr-edit-field-wide { grid-column: 1 / -1; }
.epr-edit-inline { display: flex; align-items: center; gap: 10px; }
.epr-edit-hint { font-size: 12px; color: #778899; }
.epr-edit-form input[type="text"],
.epr-edit-form input:not([type]),
.epr-edit-form select {
  width: 100%;
  max-width: none;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffcc;
  font-size: 13px;
}
.epr-edit-form input[readonly] { background: #f3f6f8; color: #334455; }
.epr-type-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.9fr);
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px dotted #c9b24a;
  border-radius: 10px;
  background: #ffff99;
}
.epr-type-label {
  font-size: 13px;
  font-weight: 700;
  color: #445;
  margin-bottom: 8px;
}
.epr-type-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 10px;
}
.epr-type-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: #223;
  cursor: pointer;
}
.epr-type-option input {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--navy);
}
.epr-type-extra { margin-top: 10px; }
.epr-type-extra label { margin: 0 0 4px; font-size: 13px; color: #445; font-weight: 600; }
.epr-type-help {
  padding: 10px 12px;
  border: 1px dotted #c9b24a;
  border-radius: 8px;
  background: #fff8c4;
  font-size: 12px;
  line-height: 1.45;
  color: #444;
}
.epr-type-hint { margin: 0; display: none; }
.epr-edit-people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
  margin-bottom: 18px;
}
.epr-edit-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.epr-stay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: #334;
  cursor: pointer;
}
.epr-stay input {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  margin: 0;
}
.epr-edit-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.epr-edit-footer-actions a { font-size: 13px; color: #1a5f7a; font-weight: 600; }
@media (max-width: 900px) {
  .epr-edit-top { grid-template-columns: 1fr; }
  .epr-type-panel { grid-template-columns: 1fr; }
}

/* eDocs (module 5) — sidebar + main share top edge, padding, and column rhythm */
.docs-layout {
  align-items: start;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
}
.docs-layout > .docs-sidebar,
.docs-layout > .docs-main {
  margin: 0;
  align-self: start;
  box-sizing: border-box;
  padding: 16px 18px;
  min-width: 0;
}
.docs-layout > .docs-sidebar {
  position: sticky;
  top: 14px;
}
.docs-main { min-width: 0; }
.docs-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.docs-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: #1a5f7a; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.docs-btn:hover { background: #f3f8fa; }
.docs-side-block { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.docs-side-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.docs-side-links a { color: #1a5f7a; font-size: 13px; font-weight: 600; text-decoration: none; }
.docs-side-links a:hover { text-decoration: underline; }
.docs-grid th, .docs-grid td { font-size: 13px; vertical-align: top; }
.docs-grid .docs-check { width: 32px; text-align: center; }
.docs-grid tr.docs-under-review td { background: #fff8e8; }
.docs-urgent {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: 999px; background: #fde8e8; color: #9b1c1c; font-size: 11px; font-weight: 650;
}
.docs-status { display: inline-block; font-weight: 600; }
.docs-status-0 { color: #6b7785; }
.docs-status-1 { color: #1a5f7a; }
.docs-status-2 { color: #1f7a3a; }
.docs-status-3 { color: #b36b00; }
.docs-status-4 { color: #444; }
.docs-status-5 { color: #444; }
.docs-status-feedback { color: #7a3fa0; }
.docs-bulk-form { margin-top: 10px; }
.docs-bulk-comment { display: flex; flex-direction: column; gap: 4px; max-width: 420px; font-size: 12px; color: #445566; }
.docs-bulk-comment input { min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.docs-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin-bottom: 14px; }
.docs-edit-form textarea,
.docs-edit-form select,
.docs-edit-form input[type="text"] { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.docs-edit-form textarea[readonly],
.docs-edit-form input[readonly],
.docs-edit-form input:disabled { background: #f3f6f8; color: #334455; }
.docs-edit-form .epr-edit-field-wide { grid-column: 1 / -1; }
.docs-type-panel { grid-template-columns: 1fr; margin-bottom: 14px; }
.docs-detail .epr-header-grid .epr-span-wide strong { font-weight: 500; white-space: pre-wrap; }
.docs-attach-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.docs-attach-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; font-size: 13px;
}
.docs-attach-file { font-size: 11px; }
.docs-attach-del { margin-left: auto; }
.docs-upload-form,
.docs-action-panel { max-width: 720px; }
.docs-upload-form input[type="text"],
.docs-action-panel input[type="text"] { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.docs-kw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.docs-kw-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #445; }
.docs-check-row { flex-direction: row !important; align-items: center; gap: 8px !important; }
.docs-check-row input { width: 16px; height: 16px; margin: 0; }
.docs-clear-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }
.docs-thread { margin-top: 18px; }

/* GM review cards — PHP grddocsgm expanded rows */
.docs-card-list { display: flex; flex-direction: column; gap: 12px; }
.docs-card-cols,
.docs-card-head {
  display: grid;
  grid-template-columns: 72px 100px minmax(0, 1.6fr) minmax(110px, 0.9fr) 120px 28px;
  gap: 8px 10px;
  align-items: center;
}
.docs-card-list.has-bulk .docs-card-cols,
.docs-card-list.has-bulk .docs-card-head {
  grid-template-columns: 28px 72px 100px minmax(0, 1.6fr) minmax(110px, 0.9fr) 120px 28px;
}
.docs-card-cols { padding: 0 12px 6px; font-size: 11px; font-weight: 700; color: #667; text-transform: uppercase; letter-spacing: .03em; }
.docs-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.docs-card.is-under-review { border-color: #e6c27a; }
.docs-card.is-feedback { box-shadow: inset 3px 0 0 #9b6bb8; }
.docs-card-head {
  padding: 10px 12px;
  background: linear-gradient(180deg, #f4f7f6 0%, #e8eeeb 100%);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.docs-card-col-check { text-align: center; }
.docs-card-col-no { font-weight: 700; color: #1a5f7a; text-decoration: none; }
.docs-card-col-subject { font-weight: 550; color: #223; }
.docs-card-toggle {
  border: 0; background: transparent; cursor: pointer; font-size: 16px; color: #445; line-height: 1; padding: 0;
}
.docs-card.is-collapsed .docs-card-body { display: none; }
.docs-card-body { padding: 12px; background: #fafbfc; }
.docs-card-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.docs-card-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 0;
}
.docs-card-panel h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #334;
  padding-bottom: 6px;
  border-bottom: 1px solid #e6ece9;
}
.docs-card-subhead { margin-top: 14px !important; }
.docs-add-comments {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; font-weight: 700; color: #665500;
  background: #ffff00; padding: 4px 6px; margin-top: 8px; border-radius: 4px;
}
.docs-comment-box {
  width: 100%; min-height: 72px; padding: 8px;
  border: 1px solid #e0d48a; border-radius: 6px; background: #ffffcc;
  font: inherit; resize: vertical;
}
.docs-card-actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid #e8ecea;
}
.docs-inline-remarks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.docs-inline-remarks li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px;
  font-size: 12px; padding: 4px 0; border-bottom: 1px dotted #e0e5e3;
}
.docs-remark-gm { color: #c00; }
.docs-remark-pm { color: #0033cc; }
.docs-remark-when { color: #778; font-size: 11px; white-space: nowrap; }
.docs-empty-note { margin: 6px 0; font-size: 12px; color: #778; }
.docs-empty-warn { color: #c00; font-weight: 600; }
.docs-mini-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.docs-mini-grid th {
  text-align: left; background: #c6cbd0; padding: 5px 6px; font-weight: 700; color: #334;
}
.docs-mini-grid td { padding: 5px 6px; border-bottom: 1px solid #e8ecea; vertical-align: top; }
.docs-mini-grid a { color: #1a5f7a; text-decoration: none; }
.docs-mini-grid a:hover { text-decoration: underline; }
.docs-view-link { font-size: 16px; text-decoration: none; color: #1a5f7a; }
.docs-bulk-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-top: 14px; padding: 10px 0; border-top: 1px solid var(--line);
}
.docs-bulk-count { margin-left: auto; font-weight: 700; font-size: 13px; color: #334; }
.docs-attach-inline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.docs-attach-inline a { color: #1a5f7a; text-decoration: none; }
.docs-attach-inline a:hover { text-decoration: underline; }

/* GM detail sheet — PHP frmdocm.php */
.docs-detail-layout { align-items: start; }
.docs-detail-solo { display: block; width: 100%; max-width: none; }
.docs-detail-solo .docs-main { width: 100%; }
body:has(.docs-detail-solo) .page {
  width: calc(100% - 24px);
  max-width: none;
  margin-top: 14px;
  margin-left: 12px;
  margin-right: 12px;
}
.docs-detail-sheet { padding: 16px 18px 22px; }
.docs-detail-titlebar { gap: 12px; }
.docs-detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.9fr);
  gap: 16px;
  margin-bottom: 14px;
}
.docs-detail-meta {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc;
}
.docs-meta-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 90px minmax(0, 0.8fr);
  gap: 6px 10px; align-items: center; font-size: 13px;
}
.docs-meta-subject { grid-template-columns: 110px minmax(0, 1fr); }
.docs-meta-label { color: #556; font-weight: 600; }
.docs-meta-accent { color: #990000; font-weight: 700; }
.docs-meta-link { color: #0033aa; font-weight: 650; }
.docs-inline-input {
  width: 100%; min-height: 32px; padding: 4px 8px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.docs-inline-input[readonly] { background: #f3f6f8; }
.docs-detail-attach-panel {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff;
}
.docs-detail-attach-panel h3,
.docs-panel h3 {
  margin: 0 0 8px; font-size: 13px; font-weight: 700; color: #334;
  padding-bottom: 6px; border-bottom: 1px solid #e6ece9;
}
.docs-attach-grid { margin-top: 4px; }
.docs-upload-inline {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px;
}
.docs-upload-inline input[type="text"] {
  flex: 1 1 140px; min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px;
}
.docs-detail-reviews {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px;
}
.docs-detail-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.docs-panel {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff;
}
.docs-panel-wide { margin-bottom: 12px; }
.docs-add-comments-block { margin-top: 0; }
.docs-comment-single { min-height: 34px !important; resize: none; }
.docs-kw-stack { display: flex; flex-direction: column; gap: 8px; }
.docs-kw-stack label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #556; font-weight: 600; }
.docs-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #556; font-weight: 600; margin-top: 8px; }
.docs-field input, .docs-field textarea {
  font-weight: 500; color: #223; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff;
}
.docs-field input[readonly], .docs-field textarea[readonly] { background: #f3f6f8; }
.docs-followup-facts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 12px; }
.docs-followup-facts span { color: #667; display: block; }
.docs-reply-inline { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.docs-user-comments { margin: 0; }
.docs-action-details {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 14px;
}
.docs-action-toggle {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 0; background: #70897c; color: #ffffcc;
  font-size: 14px; font-weight: 700; cursor: pointer; text-align: left;
}
.docs-action-plus {
  display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center;
  border-radius: 4px; background: #5f7a6d; font-size: 16px; line-height: 1;
}
.docs-action-body { display: none; padding: 12px; background: #f7f9f8; }
.docs-action-body.is-open { display: block; }
.docs-action-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px;
  align-items: start;
}
.docs-action-grid .docs-field {
  margin-top: 0;
  min-width: 0;
}
.docs-action-grid .docs-field > input,
.docs-action-grid .docs-field > select,
.docs-action-grid .docs-field > textarea,
.docs-action-grid .docs-field .docs-comment-box {
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  display: block;
}
.docs-action-grid .docs-field > select { width: 100%; max-width: none; min-width: 0; }
.docs-field-wide { grid-column: 1 / -1; }
.docs-due-wrap {
  display: flex; flex-direction: column; gap: 6px; min-height: 34px;
}
.docs-due-wrap #docs-due-date.is-hidden { display: none; }
.docs-field-hint { font-weight: 500; color: #778899; font-size: 11px; }
.docs-pct-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 72px 18px;
  gap: 10px; align-items: center;
}
.docs-pct-row input[type="range"] { width: 100%; min-width: 0; accent-color: #1a5f7a; }
.docs-pct-row input[type="number"] { width: 100%; min-width: 0; text-align: center; }
.docs-pct-suffix { font-weight: 700; color: #445; }
.docs-pct-bar {
  height: 6px; border-radius: 999px; background: #e2e8ee; overflow: hidden; margin-top: 2px;
}
.docs-pct-bar > span {
  display: block; height: 100%; background: linear-gradient(90deg, #1a5f7a, #2f8f63); border-radius: inherit;
}
.docs-toast {
  /* Keep class for older views; share global pill toast look */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: min(480px, calc(100vw - 24px));
  padding: 10px 14px 10px 18px;
  border-radius: 999px;
  border: 1px solid #9fd6b0;
  background: #e8f8ee;
  color: #1f6b3a;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(16, 61, 92, 0.12);
  animation: apps-toast-in 0.22s ease-out;
}
.docs-toast.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity 0.2s ease, transform 0.2s ease; }
.docs-toast-close {
  border: 0; background: transparent; color: inherit; font-size: 18px; line-height: 1;
  cursor: pointer; padding: 0 2px; opacity: 0.75;
}
.docs-toast-close:hover { opacity: 1; }
.docs-update-footer {
  display: flex; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--line);
}
.docs-req { color: #c00; font-style: normal; font-weight: 700; }
.docs-skip-due { margin: 0 0 6px; font-weight: 500; color: #334; }
.docs-action-subhead {
  margin: 16px 0 8px; padding: 8px 10px;
  background: linear-gradient(180deg, #e8eeeb, #d5ddd8);
  border: 1px solid #c5cec8; border-radius: 6px;
  font-size: 13px; font-weight: 700; color: #334;
}
.docs-assignee-list { display: flex; flex-direction: column; gap: 10px; }
.docs-assignee-card {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff;
}
.docs-assignee-who { margin-bottom: 8px; font-size: 13px; }
.docs-assignee-who span { color: #36f; }
.docs-assignee-cols {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; font-size: 12px;
}
.docs-assign-block { margin-top: 8px; }
.docs-show-resp, .docs-add-person {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 6px 0 10px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: #1a5f7a; font-weight: 650; font-size: 13px; cursor: pointer;
}
.docs-show-resp:hover, .docs-add-person:hover { color: #000; background: #f3f8fa; }
.docs-action-ico { width: 18px; height: 18px; flex: 0 0 auto; }
.docs-action-ico-img { width: 20px; height: 20px; flex: 0 0 auto; display: block; }
.docs-resp-picker {
  max-height: 280px; overflow: auto; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.docs-resp-picker.is-hidden, .docs-new-person.is-hidden, .docs-add-person.is-hidden { display: none !important; }
.docs-new-person {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  margin-bottom: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; background: #fafbfc;
}
.docs-action-grid select {
  min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
@media (max-width: 900px) {
  .docs-assignee-cols, .docs-new-person { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-layout > .docs-sidebar { position: static; }
  .docs-edit-grid, .docs-kw-grid { grid-template-columns: 1fr; }
  .docs-detail-top, .docs-detail-reviews, .docs-action-grid, .docs-meta-row { grid-template-columns: 1fr; }
  .docs-card-cols { display: none; }
  .docs-card-head {
    grid-template-columns: 28px 1fr 28px;
    grid-template-areas:
      "check no toggle"
      "check subject toggle"
      "check meta toggle";
  }
  .docs-card-col-check { grid-area: check; }
  .docs-card-col-no { grid-area: no; }
  .docs-card-col-subject { grid-area: subject; }
  .docs-card-col-date,
  .docs-card-col-project,
  .docs-card-col-status { grid-area: meta; font-size: 12px; }
  .docs-card-toggle { grid-area: toggle; }
  .docs-card-panels { grid-template-columns: 1fr; }
}

/* ===================== eApplications (module 2) — mirrors .docs-* ===================== */
.apps-layout {
  align-items: start;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
}
.apps-main {
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}
.apps-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: #1a5f7a; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.apps-btn:hover { background: #f3f8fa; }
.apps-btn-danger { color: #9b1c1c; border-color: #e3b4b4; }
.apps-btn-danger:hover { background: #fdf0f0; }

.apps-sidebar { min-width: 0; }
.apps-sidebar .apps-side-first { margin-top: 0; }
.apps-side-block { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.apps-side-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.apps-side-links a { color: #1a5f7a; font-size: 13px; font-weight: 600; text-decoration: none; }
.apps-side-links a:hover { text-decoration: underline; }
.apps-side-links a.is-active { color: #0b3a4a; text-decoration: underline; }
.epr-side-form label.plng-doc-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: #445566;
}
.epr-side-form label.plng-doc-check input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  border-radius: 3px;
  accent-color: #1a5f7a;
}
.epr-side-form label.plng-doc-check span {
  flex: 1 1 auto;
}
.apps-date-crit { display: flex; flex-direction: column; gap: 8px; }
.apps-date-option {
  display: flex !important; flex-direction: row !important; align-items: center; gap: 8px;
  font-size: 12px; color: #445566; font-weight: 600;
}
.apps-date-option input { width: auto !important; min-height: 0 !important; margin: 0; accent-color: #1a5f7a; }
.apps-date-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.apps-date-crit input:disabled,
.apps-date-crit select:disabled { opacity: 0.55; background: #f5f7f9; }

@media (max-width: 900px) {
  .apps-layout { grid-template-columns: 1fr; }
  .apps-sidebar { position: static; }
}
.apps-layout .tasks-list-controls,
.docs-layout .tasks-list-controls {
  justify-content: flex-start;
}
.apps-layout .tasks-list-toolbar,
.docs-layout .tasks-list-toolbar {
  flex-wrap: nowrap;
}
.tasks-list-toolbar .tl-control-sm > select {
  min-width: 72px !important;
}
.tasks-list-toolbar a.tl-btn.tl-btn-primary,
.tasks-list-toolbar a.primary.tl-btn {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap;
}
.apps-grid th, .apps-grid td { font-size: 13px; vertical-align: top; }
.apps-grid tr.apps-has-feedback td { background: #f8f1fb; }
.apps-status { display: inline-block; font-weight: 600; }
.apps-status-0 { color: #6b7785; }
.apps-status-1 { color: #1a5f7a; }
.apps-status-2 { color: #1f7a3a; }
.apps-status-3 { color: #9b1c1c; }
.apps-status-4 { color: #444; }
.apps-status-5 { color: #b36b00; }
.apps-status-6 { color: #1f7a3a; }
.apps-status-10 { color: #6b7785; }
.apps-status-11 { color: #0f5c8a; }
.apps-status-feedback { color: #7a3fa0; font-weight: 600; }

/* eApplication form (PHP mod_jobapp/jobapp.php look) — edit + detail share this chrome */
.apps-radios { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 4px; }
.apps-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: #334; }
.apps-radio input { width: 16px; height: 16px; margin: 0; }
.apps-photo-thumb { display: block; width: 96px; height: 120px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; background: #fafbfc; }

.apps-form-page { max-width: none; margin: 0; }
.apps-form-main { padding: 0; overflow: hidden; }
.apps-form { font-size: 12px; color: #223; }
.apps-form-title {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 14px; color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 0.2px;
  background: #103d5c;
  border-bottom: 1px solid #0a2c44;
}
.apps-form-title h1 { margin: 0; font-size: 15px; font-weight: 700; color: #fff; }
.apps-form-title-actions { display: flex; align-items: center; gap: 8px; }
.apps-form-status { font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, 0.18); padding: 2px 10px; border-radius: 10px; }
.apps-form-back {
  display: inline-flex; align-items: center; padding: 2px 14px; border-radius: 12px;
  background: linear-gradient(180deg, #ffb347, #f08a00); border: 1px solid #c97100;
  color: #fff; font-size: 12px; font-weight: 700; text-decoration: none;
}
.apps-form-back:hover { filter: brightness(1.06); text-decoration: none; color: #fff; }
.apps-form-body { padding: 10px 14px 14px; }
.apps-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.apps-form-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin-bottom: 4px; }
.apps-form-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; align-items: start; }
.apps-form-col { min-width: 0; }

.apps-form-bar {
  margin: 10px 0 6px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: #fff;
  background: #103d5c; border: 1px solid #0a2c44; border-radius: 4px;
}
.apps-form-col > .apps-form-bar:first-child { margin-top: 0; }

.apps-form-row {
  display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 4px 8px; align-items: center; margin: 4px 0;
}
.apps-form-row > label,
.apps-form-row > .apps-form-label { font-weight: 600; color: #234; line-height: 1.25; }
.apps-form-row.is-top { align-items: start; }
.apps-form-req { color: #c00; }
.apps-form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0; }
.apps-form-inline > label,
.apps-form-inline > .apps-form-label { font-weight: 600; color: #234; }
.apps-form-inline input[type="number"] { width: 72px; }
.apps-form-inline .apps-form-grow { flex: 1 1 140px; min-width: 0; }
.apps-form-sub { font-weight: 600; color: #234; margin: 6px 0 2px; }

.apps-form input[type="text"],
.apps-form input[type="number"],
.apps-form select,
.apps-form textarea {
  width: 100%; box-sizing: border-box; padding: 3px 6px; min-height: 24px;
  border: 1px solid #9fb3a6; border-radius: 3px; background: #fff; font: inherit; color: #223;
}
.apps-form textarea { resize: vertical; min-height: 40px; }
.apps-form input[readonly],
.apps-form input:disabled,
.apps-form select:disabled,
.apps-form textarea:disabled { background: #eef2ef; color: #334455; }
.apps-form input[type="text"]:focus,
.apps-form input[type="number"]:focus,
.apps-form select:focus,
.apps-form textarea:focus { outline: 2px solid rgba(95, 163, 31, 0.35); border-color: #5fa31f; }
.apps-form .apps-form-yellow,
.apps-form input.apps-form-yellow,
.apps-form select.apps-form-yellow,
.apps-form textarea.apps-form-yellow,
.apps-form input.apps-form-yellow[readonly],
.apps-form select.apps-form-yellow:disabled { background: #ffff99; border-color: #d4c85a; color: #223; }
.apps-form input.apps-form-narrow { max-width: 90px; }
.apps-form-num { text-align: right; }
.apps-form-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.apps-form-checks label { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: #234; }
.apps-form-checks input { width: 14px; height: 14px; margin: 0; }

/* read-only (detail) values: dotted underline like a PHP static field */
.apps-form-ro {
  display: block; min-height: 18px; padding: 2px 2px 1px; border-bottom: 1px dotted #8a9a90;
  color: #112; word-break: break-word; white-space: pre-wrap;
}
.apps-form-ro.is-yellow { background: #ffff99; font-weight: 700; padding-left: 6px; }
.apps-form-ro.is-narrow { display: inline-block; min-width: 54px; }
.apps-form-ro.is-num { text-align: right; }

/* applicant photo: top-right of the right column, beside Reference..Govt. Service */
.apps-form-refblock { position: relative; padding-right: 96px; }
.apps-form-photo {
  position: absolute; top: 2px; right: 0; width: 80px; height: 100px; box-sizing: border-box;
  border: 1px solid #8a9a90; background: #f4f6f4; display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 10px; color: #778; text-align: center;
}
.apps-form-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.apps-form-attach { margin-top: 12px; }
.apps-form-attach-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 16px; }
.apps-form-attach-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.apps-form-attach-item > label { font-weight: 600; color: #234; }
.apps-form-attach-item input[type="file"] { font-size: 11px; width: 100%; }
.apps-form-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 11px; min-height: 16px; }
.apps-form-links a,
.apps-form-linkbtn { color: #0b5a9c; font-weight: 600; text-decoration: none; }
.apps-form-linkbtn { border: 0; background: transparent; padding: 0; font: inherit; font-weight: 600; font-size: 11px; color: #b02a2a; cursor: pointer; }
.apps-form-links a:hover, .apps-form-linkbtn:hover { text-decoration: underline; }
.apps-form-note { margin: 6px 0 0; font-size: 11px; color: #667; }

.apps-form-buttons {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin-top: 14px; padding-top: 10px; border-top: 1px solid #d5ddd8;
}
.apps-form-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 0 20px;
  border: 1px solid #3f7611; border-radius: 14px; cursor: pointer; text-decoration: none;
  background: linear-gradient(180deg, #8fcf3a, #5fa31f); color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.apps-form-btn:hover { filter: brightness(1.06); color: #fff; text-decoration: none; }
.apps-form-btn.is-secondary { background: linear-gradient(180deg, #a8d86a, #78b83a); }
.apps-form-btn.is-danger { background: linear-gradient(180deg, #e46a5a, #b92f20); border-color: #8f2217; }
.apps-form-btn.is-hold { background: linear-gradient(180deg, #ffb347, #f08a00); border-color: #c97100; }

/* detail: role action blocks inside the form chrome */
.apps-form-actions { margin-top: 12px; }
.apps-form-actions .apps-form-bar { margin-top: 12px; }
.apps-form-actions form { margin: 0; }
.apps-form-decision-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.apps-salary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 10px;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 6px;
}
/* PHP jobapptmr / jobappmr: salary is plain (not yellow) */
.apps-salary-grid.is-readonly {
  background: transparent;
  border: 0;
  padding: 4px 0;
}
/* PHP jobappm / jobapptm: yellow editable decision zone */
.apps-salary-grid.is-decide {
  background: #ffffcc;
  border: 1px solid #e0d48a;
}
.apps-salary-grid .apps-salary-head { font-size: 11px; font-weight: 700; color: #556; text-align: right; }
.apps-salary-grid .apps-salary-head:first-child { text-align: left; }
.apps-salary-grid .apps-salary-label { font-size: 12px; color: #445566; }
.apps-salary-grid .apps-form-ro { min-height: 30px; display: flex; align-items: center; justify-content: flex-end; }
.apps-salary-grid input.apps-form-num { text-align: right; width: 100%; min-height: 30px; }
/* PHP txtblue.gif / border_gradient — Recommended column is display-only */
.apps-salary-grid .apps-form-ro.is-rec {
  border: 0;
  border-bottom: 2px solid #897048;
  background: linear-gradient(180deg, #e8f0ff 0%, #c5d8f0 100%);
  padding: 4px 8px;
  font-weight: 700;
  border-radius: 0;
}
/* PHP jobappm Approved column: plain white text inputs (never blue gradient) */
.apps-salary-grid.is-decide input.apps-form-num.apps-form-editable {
  border: 1px solid #8899aa;
  border-radius: 2px;
  background: #fff !important;
  padding: 4px 8px;
  font-weight: 700;
  color: #112;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}
.apps-salary-grid .apps-form-ro.is-consol {
  border: 2px solid #556;
  background: #fff;
  padding: 4px 8px;
  font-weight: 700;
  border-radius: 2px;
}
.apps-form-decide-block {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #ffffcc;
  border: 1px solid #e0d48a;
  border-radius: 6px;
}
.apps-form-decide-block .apps-form-row { margin-bottom: 6px; }
/* Yellow zones are editable — keep controls white and interactive (PHP input on #FFFFCC row) */
.apps-form-decide-block input.apps-form-editable,
.apps-form-decide-block select.apps-form-editable,
.apps-form-decide-block textarea.apps-form-editable,
.apps-salary-grid.is-decide input.apps-form-editable,
.apps-form input.apps-form-editable,
.apps-form select.apps-form-editable,
.apps-form textarea.apps-form-editable {
  background: #fff !important;
  color: #223;
  pointer-events: auto !important;
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}
.apps-grid textarea.apps-form-editable {
  width: 100%; box-sizing: border-box; min-height: 64px;
  background: #ffffcc; border: 1px solid #d4c85a; border-radius: 3px;
  padding: 4px 6px; font: inherit;
}
.apps-form-benefits-edit {
  padding: 6px 0 10px;
}
.apps-form-benefits-edit label {
  cursor: pointer;
}
.apps-form-benefits-edit input[type="checkbox"] {
  pointer-events: auto !important;
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #103d5c;
}
.apps-form fieldset.is-locked,
.apps-form fieldset[disabled] {
  opacity: 0.85;
}
.apps-form fieldset[disabled] input,
.apps-form fieldset[disabled] select,
.apps-form fieldset[disabled] textarea {
  background: #eef2ef;
}
.apps-form-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.apps-form-meta-item { display: flex; flex-direction: column; gap: 4px; }
.apps-form-val-red { color: #990000 !important; font-weight: 700; }
.apps-form-status-box { min-width: 140px; }
.apps-form-fwd-banner {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 0 12px; padding: 10px 12px;
  background: #d2ffff; border: 1px solid #9ad6d6; border-radius: 6px;
}
.apps-form-fwd-icon {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #1f7a3a; color: #fff; font-size: 20px; font-weight: 700;
}
.apps-form-fwd-body { flex: 1; min-width: 0; }
.apps-form-fwd-body .apps-form-row { margin-bottom: 4px; }
.apps-form-actionbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px;
  align-items: end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
}
.apps-form-tm-block { display: flex; flex-direction: column; gap: 6px; max-width: 280px; }
.apps-form-tm-label { font-size: 12px; font-weight: 700; color: #334; }
.apps-form-decide-btns { justify-content: flex-end; }
.apps-form-btn-approve { background: #1f7a3a !important; border-color: #186330 !important; color: #fff !important; }
@media (max-width: 800px) {
  .apps-form-meta, .apps-form-actionbar { grid-template-columns: 1fr; }
  .apps-form-decide-btns { justify-content: flex-start; }
}
.apps-form-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.apps-form-remarks { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.apps-form-remarks li { padding: 6px 8px; border: 1px solid #c5d3c9; border-radius: 4px; background: #f7faf7; }
.apps-form-remarks .apps-remark-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.apps-form-empty { margin: 4px 0; color: #778; }

/* detail sheet — full width like .docs-detail-solo */
.apps-detail-layout { align-items: start; }
.apps-detail-solo { display: block; width: 100%; max-width: none; }
.apps-detail-solo .apps-main { width: 100%; }
body:has(.apps-detail-solo) .page {
  width: calc(100% - 24px);
  max-width: none;
  margin-top: 14px;
  margin-left: 12px;
  margin-right: 12px;
}
.apps-detail-sheet { padding: 16px 18px 22px; }
.apps-detail-titlebar { gap: 12px; }
.apps-detail-top {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.9fr); gap: 16px; margin-bottom: 14px;
}
.apps-detail-meta {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc;
}
.apps-meta-row {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) 110px minmax(0, 0.9fr);
  gap: 6px 10px; align-items: center; font-size: 13px;
}
.apps-meta-label { color: #556; font-weight: 600; }
.apps-meta-accent { color: #990000; font-weight: 700; }
.apps-meta-link { color: #0033aa; font-weight: 650; }
.apps-detail-attach-panel,
.apps-panel {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; min-width: 0;
}
.apps-detail-attach-panel h3,
.apps-panel h3 {
  margin: 0 0 8px; font-size: 13px; font-weight: 700; color: #334;
  padding-bottom: 6px; border-bottom: 1px solid #e6ece9;
}
.apps-attach-row { display: flex; gap: 14px; align-items: flex-start; }
.apps-attach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.apps-attach-list a { color: #1a5f7a; font-weight: 600; text-decoration: none; }
.apps-attach-list a:hover { text-decoration: underline; }
.apps-detail-reviews {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px;
}
.apps-detail-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.apps-panel-wide { margin-bottom: 12px; }
.apps-panel-decision { border-color: #b8d6c4; background: #f7fbf8; }
.apps-dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 12px; margin: 8px 0 0; font-size: 13px; }
.apps-dl dt { color: #556; font-weight: 600; }
.apps-dl dd { margin: 0; color: #223; min-width: 0; word-break: break-word; }
.apps-pre { white-space: pre-wrap; }
.apps-mini-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.apps-mini-grid th { text-align: left; background: #c6cbd0; padding: 5px 6px; font-weight: 700; color: #334; }
.apps-mini-grid td { padding: 5px 6px; border-bottom: 1px solid #e8ecea; }
.apps-empty-note { margin: 6px 0; font-size: 12px; color: #778; }
.apps-action-panel { background: #f7f9f8; }
.apps-action-form { display: flex; flex-direction: column; gap: 10px; }
.apps-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; align-items: start; }
.apps-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #556; font-weight: 600; min-width: 0; }
.apps-field-wide { grid-column: 1 / -1; }
.apps-field input[type="text"],
.apps-field input[type="number"],
.apps-field select,
.apps-field textarea {
  width: 100%; box-sizing: border-box; min-height: 34px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; font-weight: 500; color: #223; font: inherit;
}
.apps-comment-box { min-height: 72px; border: 1px solid #e0d48a !important; background: #ffffcc !important; resize: vertical; }
.apps-action-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.apps-clear-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.apps-remarks { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.apps-remarks li { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; font-size: 13px; }
.apps-remark-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.apps-remark-when { margin-left: auto; color: #778; font-size: 11px; white-space: nowrap; }

/* Global custom alerts (pill toast) */
.hrl-toast-host {
  position: fixed;
  top: 64px;
  right: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  max-width: min(480px, calc(100vw - 24px));
}
.apps-toast {
  position: relative;
  top: auto; right: auto;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: max-content;
  max-width: min(480px, calc(100vw - 24px));
  margin: 0;
  padding: 10px 14px 10px 18px;
  border-radius: 999px;
  border: 1px solid #9fd6b0;
  background: #e8f8ee;
  color: #1f6b3a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 8px 22px rgba(16, 61, 92, 0.12);
  pointer-events: auto;
  animation: apps-toast-in 0.22s ease-out;
}
.apps-toast > span { flex: 1 1 auto; min-width: 0; }
.apps-toast.ok {
  background: #e8f8ee;
  color: #1f6b3a;
  border-color: #9fd6b0;
}
.apps-toast.alert {
  background: #fef3f2;
  color: #b42318;
  border-color: #fecdca;
}
.apps-toast.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.apps-toast-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.75;
  flex: 0 0 auto;
}
.apps-toast-close:hover { opacity: 1; }
@keyframes apps-toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Page-level toasts (when not inside host) still pin top-right */
main.page > .apps-toast,
body > .apps-toast {
  position: fixed;
  top: 72px;
  right: 18px;
}

@media (max-width: 900px) {
  .apps-layout { grid-template-columns: 1fr; }
  .apps-form-top, .apps-form-cols, .apps-form-attach-grid, .apps-form-decision-grid,
  .apps-detail-top, .apps-detail-reviews, .apps-action-grid, .apps-meta-row, .apps-dl,
  .apps-salary-grid { grid-template-columns: 1fr; }
  .apps-salary-grid .apps-salary-head { text-align: left; }
  .apps-salary-grid .apps-form-ro { justify-content: flex-start; }
}

/* ===== eActions / Tasks ===== */
.tasks-side-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.tasks-side-actions .apps-form-btn { text-align: center; text-decoration: none; }
.tasks-form .tasks-check,
.tasks-form label.tasks-check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px;
  margin: 2px 0 0 !important;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: #445566;
  cursor: pointer;
  white-space: nowrap;
  width: auto;
  text-transform: none;
  letter-spacing: normal;
}
.tasks-form .tasks-check input {
  width: 16px !important;
  height: 16px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: #1a5f7a;
  flex: 0 0 16px;
}
.tasks-batch-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 0 0 12px; padding: 8px 10px; background: #ffffcc; border: 1px solid #e0d48a; border-radius: 6px;
}
.tasks-batch-bar select { min-width: 220px; }
.apps-grid tr.is-not-started { background: #E1E7F1; }
.apps-grid tr.is-completed { background: #E7FFE9; }
.apps-grid tr.is-waiting { background: #FDF2FA; }
.apps-grid tr.is-deferred { background: #F5F4EA; }
.apps-grid tr.is-closed { background: #F8FBEA; }
.apps-grid tr.is-overdue td.tasks-date { color: #b00020; font-weight: 700; }
.apps-grid tr.is-urgent td { font-weight: 600; }
.tasks-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 3px;
  background: #dfe8f2; color: #234; font-size: 11px;
}
/* Searchable multi-select people picker */
.tasks-assign-field { position: relative; width: 100%; }
.tasks-assign-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 18px;
}
.tasks-assign-head > label { margin: 0; }
.tasks-ms { position: relative; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.tasks-ms-chips {
  display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; width: 100%;
}
.tasks-ms-chip {
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 100%; padding: 6px 10px; border: 1px solid #b7d0de;
  border-radius: 999px; background: #e8f3f8; color: #134b61;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.tasks-ms-chip span:first-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px;
}
.tasks-ms-chip:hover { background: #d7ebf3; }
.tasks-ms-control { position: relative; width: 100%; }
.tasks-ms-search { width: 100% !important; }
.tasks-ms-clear {
  border: 0; background: transparent; padding: 0;
  color: #1a5f7a; font-size: 12px; font-weight: 700; cursor: pointer;
}
.tasks-ms-clear:hover { text-decoration: underline; }
.tasks-ms-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  max-height: 280px; overflow: auto;
  border: 1px solid #c5d3de; border-radius: 12px; background: #fff;
  box-shadow: 0 12px 28px rgba(16, 61, 92, 0.14);
}
.tasks-ms-panel-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid #e2e8ee; background: #f7fafc;
  font-size: 12px; font-weight: 700; color: #4a5d6c;
}
.tasks-ms-done {
  border: 0; background: #1a5f7a; color: #fff; border-radius: 8px;
  min-height: 28px; padding: 0 12px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.tasks-ms-done:hover { filter: brightness(1.06); }
.tasks-ms-list { list-style: none; margin: 0; padding: 6px; }
.tasks-form .tasks-ms-option,
.tasks-form label.tasks-ms-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 10px;
  margin: 0 !important;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  width: auto;
  text-transform: none;
  letter-spacing: normal;
}
.tasks-ms-option:hover { background: #f3f8fb; }
.tasks-ms-option.is-selected { background: #e8f3f8; }
.tasks-form .tasks-ms-option input {
  margin: 3px 0 0 !important;
  width: 16px !important;
  height: 16px !important;
  min-height: 0 !important;
  padding: 0 !important;
  accent-color: #1a5f7a;
  flex: 0 0 16px;
}
.tasks-ms-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tasks-ms-option-text strong { font-size: 13px; color: #1f2d3a; font-weight: 700; }
.tasks-ms-option-text em { font-style: normal; font-size: 12px; color: #6b7785; }
.tasks-ms-empty { padding: 16px; text-align: center; color: #6b7785; font-size: 13px; }

/* Modern eAction detail form */
.tasks-form .tasks-form-body { padding: 18px 20px 22px; background: linear-gradient(180deg, #f7fafc 0%, #fff 48px); }
.tasks-form-note { margin: 0 0 14px !important; }
.tasks-form-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #d7e2ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 61, 92, 0.04);
}
.tasks-form-panel {
  margin: 0 0 16px;
  padding: 16px 16px 8px;
  border: 1px solid #d7e2ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 61, 92, 0.04);
}
.tasks-form-panel.is-locked { opacity: 0.92; }
.tasks-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px;
  align-items: start;
}
.tasks-form-stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; width: 100%; }
.tasks-form-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  align-items: start;
}
.tasks-form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; width: 100%; }
.tasks-form-pair > .tasks-form-field { width: 100%; }
.tasks-form-stack > .tasks-form-field { width: 100%; }
.tasks-form-stack .tasks-input,
.tasks-form-stack input.tasks-input,
.tasks-form-stack select.tasks-input,
.tasks-form-stack textarea.tasks-input,
.tasks-form-stack .tasks-readonly,
.tasks-form-stack .tasks-ms-search {
  width: 100% !important;
  max-width: none;
  box-sizing: border-box;
}
.tasks-form-field > label,
.tasks-field-label {
  margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  color: #4a5d6c; text-transform: uppercase;
}
.tasks-form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tasks-form-hint { margin: 0; font-size: 12px; color: #6b7785; }
.tasks-meta-text {
  min-height: 40px; display: flex; align-items: center;
  font-size: 14px; font-weight: 600; color: #1f2d3a;
}
.tasks-status-pill {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid #f0c2c2; background: #fff5f5;
  color: #9b1c1c; font-size: 13px; font-weight: 700; width: fit-content;
}
.tasks-status-pill.is-doc { border-color: #c9d8e4; background: #f3f8fb; color: #1a5f7a; }
.tasks-readonly {
  min-height: 40px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid #e2e8ee; background: #f5f8fa; color: #1f2d3a;
  font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word;
}
.tasks-form .tasks-input,
.tasks-form input.tasks-input,
.tasks-form select.tasks-input,
.tasks-form textarea.tasks-input {
  width: 100%; box-sizing: border-box;
  min-height: 40px; padding: 9px 12px;
  border: 1px solid #c5d3de; border-radius: 10px;
  background: #fff; color: #1f2d3a;
  font-size: 14px; font-family: inherit; line-height: 1.35;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.tasks-form textarea.tasks-input { min-height: 96px; resize: vertical; }
.tasks-form select.tasks-input {
  background-position: right 10px center;
  background-size: 16px 16px;
  padding-right: 34px;
}
.tasks-form .tasks-input.is-narrow { max-width: 120px; }
.tasks-form .tasks-input.is-accent {
  color: #9b1c1c; font-weight: 700; background: #fff8f8; border-color: #e7c0c0;
}
.tasks-form .tasks-input.is-edit {
  background: #fffceb; border-color: #e0d48a; min-height: 84px;
}
.tasks-form .tasks-input:hover { border-color: #9bb4c6; }
.tasks-form .tasks-input:focus {
  outline: none; border-color: #1a5f7a;
  box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.16);
}
.tasks-form .tasks-input[readonly],
.tasks-form .tasks-input:disabled {
  background: #f5f8fa; color: #445566; cursor: default;
}
.tasks-form-section { margin-top: 4px; }
.tasks-form-actions { margin-top: 18px; padding-top: 14px; }
@media (max-width: 900px) {
  .tasks-form-grid, .tasks-form-pair { grid-template-columns: 1fr; }
}

/* Grouped eAction list — apps chrome (same tokens as Applications/Docs) */
.apps-grid tr.apps-group-row td {
  background: #103d5c; color: #fff; font-weight: 700; font-size: 13px; padding: 8px 10px;
}
.apps-grid tr.apps-subgroup-row td {
  background: #eef3f6; color: #234; font-size: 13px; padding: 7px 10px; border-bottom: 1px solid var(--line);
}
.apps-grid tr.apps-subgroup-row.is-mutual td {
  background: #dfe8f0; color: #1a5f7a; font-weight: 700; text-align: center;
}
.apps-inline-add {
  margin-left: 10px; color: #1a5f7a; font-size: 12px; font-weight: 600; text-decoration: none;
}
.apps-inline-add:hover { text-decoration: underline; }
.apps-grid tr.apps-row-overdue td.apps-due-overdue,
.apps-grid td.apps-due-overdue { color: #9b1c1c; font-weight: 700; }
.tasks-remarks { font-size: 12px; line-height: 1.4; }
.tasks-remarks .muted { color: #6b7785; font-weight: 600; }

/* List page: sidebar + main flush; toolbar controls aligned */
.tasks-list-layout {
  align-items: start;
}
.tasks-list-layout > .apps-sidebar,
.tasks-list-layout > .apps-main {
  margin: 0;
  align-self: start;
}
.tasks-list-layout > .apps-sidebar {
  position: sticky;
  top: 14px;
}

/* eContracts / eLedger list pages: .epr-sidebar sticky top:110px pushes the card below the main column */
.eh-list-layout,
.po-list-layout,
.rate-list-layout,
.lgr-hub-layout,
.lgr-list-layout {
  align-items: start;
}
.eh-list-layout > .epr-sidebar,
.eh-list-layout > .apps-main,
.po-list-layout > .epr-sidebar,
.po-list-layout > .apps-main,
.rate-list-layout > .epr-sidebar,
.rate-list-layout > .apps-main,
.lgr-hub-layout > .epr-sidebar,
.lgr-hub-layout > .apps-main,
.lgr-list-layout > .epr-sidebar,
.lgr-list-layout > .apps-main {
  margin: 0;
  align-self: start;
}
.eh-list-layout > .epr-sidebar,
.po-list-layout > .epr-sidebar,
.rate-list-layout > .epr-sidebar {
  position: sticky;
  top: 14px;
}
.lgr-hub-layout > .epr-sidebar,
.lgr-list-layout > .epr-sidebar {
  position: sticky;
  top: 0;
}
.tasks-list-layout > .apps-main {
  padding: 16px 18px;
}
.tasks-list-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.tasks-list-title h1 {
  margin: 2px 0 0;
  font-size: 22px;
  color: var(--navy);
}
.tasks-list-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
}
.tasks-list-left,
.tasks-list-right {
  display: block;
  min-width: 0;
  margin: 0;
}
.tasks-list-right {
  margin-left: auto;
}
/* Equal columns: label + 36px control. Select clipped so native height can't drift. */
.tasks-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin: 0;
}
.tasks-list-toolbar .tl-item {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  margin: 0;
}
.tasks-list-toolbar .tl-label {
  display: block;
  height: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #556;
  line-height: 14px;
}
.tasks-list-toolbar .tl-label-spacer {
  visibility: hidden;
  user-select: none;
}
.tasks-list-toolbar .tl-control {
  display: block;
  box-sizing: border-box;
  height: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.tasks-list-toolbar .tl-control > select {
  display: block !important;
  box-sizing: border-box !important;
  width: auto !important;
  min-width: 160px;
  max-width: none !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 34px 0 10px !important;
  line-height: 36px !important;
  font-size: 13px !important;
  font-weight: 500;
  color: #223;
  background-color: #fff !important;
  box-shadow: none !important;
  outline: none !important;
}
.tasks-list-toolbar .tl-btn.apps-btn,
.tasks-list-toolbar button.tl-btn {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--navy) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: pointer;
  white-space: nowrap;
}
.tasks-list-toolbar .tl-note {
  display: inline-flex;
  align-items: center;
  height: 36px;
  font-size: 12px;
  font-weight: 500;
  color: #667;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .tasks-list-layout > .apps-sidebar { position: static; }
  .tasks-list-right { margin-left: 0; width: 100%; }
}

/* Re-assert centered select chevrons after module `background:` / padding shorthands. */
select:not([multiple]):not([size]) {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4.25 6.25L8 10L11.75 6.25' stroke='%235a7184' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 16px 16px !important;
  padding-right: 34px !important;
}
select:not([multiple]):not([size])::-ms-expand { display: none; }

/* ---- eLedger (New) — Views/Modules/Ledger*.cshtml ---- */
.lgr-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.lgr-num { text-align: right; }
.lgr-neg { color: #c00; font-weight: 700; }
.lgr-red { color: #c00; }
.lgr-blue { color: #00c; }
.lgr-head { color: #900; }
.lgr-grid tr.lgr-ca-row td { background: #ffffe6; }
.lgr-grid tr.lgr-ca-row.apps-has-feedback td { background: #f8f1fb; }
.lgr-grid .lgr-bf-row td { background: #e3e6e0; }
.lgr-grid .lgr-bf-row--period td { background: #ffff99; }
.lgr-grid .lgr-total-row td { background: #e8eff2; border-top: 1px solid #9fb3a6; }
.lgr-auto {
  display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 11px; line-height: 16px;
  color: #1a5f7a; background: #e8f3f8; border: 1px solid #b9d8e6; border-radius: 8px; white-space: nowrap;
}
.lgr-ret { color: #1a5f7a; margin-right: 4px; font-size: 11px; }
.lgr-del { padding: 1px 8px; color: #9b1c1c; border-color: #e3b4b4; font-size: 12px; }
.paystat-project { color: #c60; }
.paystat-grid select,
.paystat-grid input.paystat-amount { max-width: 100%; font-size: 12px; }
.paystat-grid input.paystat-amount { width: 96px; }
.notice-grid td.notice-pic-cell,
.notice-grid td.notice-cell {
  vertical-align: middle;
}
.notice-pic-cell { padding: 6px 8px; }
img.notice-thumb {
  display: inline-block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #eee;
  vertical-align: middle;
}
.notice-thumb-empty { color: #9aa5ad; }
.notice-preview img {
  object-fit: cover; border: 1px solid var(--line); border-radius: 4px; background: #eee;
}
.notice-preview { margin-bottom: 8px; }
.prog-detail-meta .prog-field {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  min-height: 36px;
  background: #fafbfc;
}
.prog-attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
}
.prog-attach-list li { margin: 2px 0; }
.prog-field-tall { min-height: 72px; white-space: pre-wrap; }
.prog-doc-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1.1fr);
  gap: 18px;
  margin-top: 14px;
}
.prog-doc-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.prog-doc-review label { display: block; margin: 8px 0; }
.prog-doc-review input[type="text"] { width: 100%; }
.prog-attach-wrap { max-height: 420px; overflow: auto; }
.prog-attach-title { display: inline-flex; align-items: center; gap: 6px; }
.prog-attach-title img { flex: 0 0 auto; }
.prog-file-missing { color: #c0392b; font-weight: 600; }
.prog-check-inline { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
@media (max-width: 960px) {
  .prog-doc-split, .prog-doc-two { grid-template-columns: minmax(0, 1fr); }
}

.lgr-detail-layout--noside.epr-layout,
.lgr-detail-layout--noside.apps-layout { grid-template-columns: minmax(0, 1fr); }
.lgr-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.lgr-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.lgr-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.lgr-highlight { background: #ffff99; border: 1px solid #e0d88a; border-radius: 4px; padding: 6px 10px; min-height: 30px; }
.lgr-remarks-list { list-style: none; margin: 12px 0 0; padding: 0; }
.lgr-remarks-list li {
  display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.lgr-remarks-list img { border-radius: 4px; object-fit: cover; background: #eee; }
.lgr-remarks-list p { margin: 4px 0; white-space: pre-wrap; }
.lgr-desig { color: #06c; font-size: 12px; }
.lgr-when { display: block; text-align: right; font-size: 11px; color: #778; margin-top: 8px; }
.lgr-followup-empty { color: #c00; }
.lgr-followup-grid { width: 100%; }
.lgr-followup-grid th:first-child,
.lgr-followup-grid td.lgr-followup-person { width: 1%; white-space: nowrap; }
.lgr-followup-grid td.lgr-followup-person,
.lgr-followup-grid td.lgr-followup-comment {
  vertical-align: middle !important;
}
.lgr-followup-person-inner {
  display: flex; gap: 8px; align-items: center;
}
.lgr-followup-person-inner img {
  width: 50px; height: 50px; border-radius: 2px; object-fit: cover;
  background: #eee; flex: 0 0 50px;
}
.lgr-followup-who { min-width: 0; line-height: 1.35; }
.lgr-followup-who strong { color: #223; font-weight: 700; }
.lgr-followup-who .lgr-desig { white-space: nowrap; }
.lgr-followup-comment-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.lgr-followup-text { margin: 0; white-space: pre-wrap; word-break: break-word; flex: 1 1 auto; min-width: 0; }
.lgr-followup-comment .lgr-when {
  margin: 0; flex: 0 0 auto; font-size: 9px; line-height: 1.2; white-space: nowrap;
}
.lgr-followup-form { margin-top: 14px; }
.lgr-followup-compose {
  display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; align-items: start;
}
.lgr-followup-compose .apps-form-label { padding-top: 4px; text-align: right; }
.lgr-followup-compose textarea.lgr-highlight,
.card .lgr-followup-compose textarea.lgr-highlight {
  width: 100%; max-width: none; display: block; margin-top: 0; box-sizing: border-box;
}
.lgr-detail-layout--noside .apps-form-ro.is-num { text-align: left; max-width: 160px; }
.lgr-highlight { background: #ffffcc !important; }
.lgr-amount-input { text-align: right; }
.lgr-form-hint { margin: 2px 0 0; font-size: 12px; color: #667; }
.lgr-sub-ca { display: contents; }
@media (max-width: 900px) { .lgr-meta { grid-template-columns: 1fr; } }

/* eLedgers hub / financial statements (PHP mod_fmslgrs) */
.lgr-hub-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.lgr-hub-title h1 { margin: 0; font-size: 20px; }
.lgr-hub-title .lgr-actions { margin-top: 0; }
.lgr-hub-title .admin-inline { display: inline; }
.lgr-hub-panels { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.lgr-hub-panel { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.lgr-hub-head { margin: 0; padding: 7px 12px; background: #333; color: #ff0; font-size: 14px; font-weight: 700; }
.lgr-hub-table { width: 100%; border-collapse: collapse; }
.lgr-hub-table th { padding: 6px 12px; background: #333; color: #ff0; text-align: left; font-weight: 600; font-size: 13px; }
.lgr-hub-table td { padding: 8px 12px; border-top: 1px solid var(--line); background: #f3f4f3; }
.lgr-hub-table tbody tr:hover td { background: #e9edf0; }
.lgr-hub-table .lgr-hub-col { text-align: center; width: 120px; white-space: nowrap; }
.lgr-hub-link { color: inherit; text-decoration: none; font-weight: 600; }
.lgr-hub-link:hover { text-decoration: underline; }
.lgr-hub-arrow { color: #1a8a8a; font-size: 10px; margin-right: 4px; }
.lgr-hub-links { list-style: none; margin: 0; padding: 10px 12px; }
.lgr-hub-links li { display: flex; align-items: center; gap: 10px; background: #f3f4f3; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; }
.lgr-hub-go {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 22px;
    background: #1a8a8a; color: #fff; border-radius: 3px; font-size: 10px; text-decoration: none;
}
.lgr-hub-go:hover { background: #146b6b; }
.lgr-hub-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin-bottom: 12px; padding: 8px 12px; background: #f3f4f3; border: 1px solid var(--line); border-radius: 6px; }
.lgr-hub-meta .apps-form-label { margin-right: 6px; }
.lgr-hub-grid tr.lgr-hub-group td { background: #dfe6e2; }
.lgr-hub-grid tr.lgr-hub-row, .lgr-hub-grid td.lgr-hub-row { cursor: pointer; }
.lgr-hub-grid tr.lgr-hub-row:hover td, .lgr-hub-grid tr:hover td.lgr-hub-row { background: #eef3f6; }
.lgr-split .lgr-split-head { background: #333; color: #ff0; text-align: center; }
.lgr-split .lgr-split-gap { border-left: 3px solid var(--line); }
@media (max-width: 900px) {
    .lgr-hub-panels, .lgr-hub-meta { grid-template-columns: 1fr; }
}
@media print {
    .lgr-hub-print .lgr-noprint, .lgr-hub-layout .apps-sidebar, .lgr-list-layout .apps-sidebar { display: none !important; }
    .lgr-hub-layout.apps-layout, .lgr-list-layout.apps-layout { grid-template-columns: minmax(0, 1fr); }
}

/* Progress Photos / eImage Gallery — PHP-style project / categ / subcateg groups */
.pimg-grid tr.pimg-project-row td {
  background: #C6D0CC;
  color: #c45c00;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 10px;
}
.pimg-grid tr.pimg-categ-row td {
  background: #DDE3E0;
  color: #990000;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 10px 6px 14px;
}
.pimg-grid tr.pimg-subcateg-row td {
  background: #EFF1F0;
  color: #222;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 10px 6px 20px;
}
tr.pimg-project-row td {
  background: #C6D0CC;
  color: #c45c00;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 10px;
}

/* eStaff summary (PHP grdhrmain) */
.staff-sum-grid th { background: #ccc; color: #222; font-weight: 700; vertical-align: middle; }
.staff-sum-grid td.num { text-align: right; white-space: nowrap; }
.staff-sum-grid td.staff-sum-total,
.staff-sum-grid .staff-sum-total { color: #990000; font-weight: 700; }
.staff-sum-grid tr.staff-sum-type1 td { background: #A4E2F7; }
.staff-sum-grid tr.staff-sum-type2 td { background: #c4d79b; }
.staff-sum-grid tr.staff-sum-type3 td { background: #b8cce4; }
.staff-sum-grid tr.staff-sum-grand td { background: #ccc; color: #222; }
.staff-sum-grid tr.apps-row-link:hover td { filter: brightness(0.97); }
.staff-filters .apps-side-links a.is-active { font-weight: 700; color: var(--orange); }
.staff-matrix-wrap { overflow: auto; max-width: 100%; }
.staff-alloc-grid th.staff-alloc-proj {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  min-width: 44px;
}
.staff-alloc-grid th.staff-proj-type1 { background: #fefebb !important; }
.staff-alloc-grid th.staff-proj-type2 { background: #c4d79b !important; }
.staff-alloc-grid th.staff-proj-type3 { background: #b8cce4 !important; }
.staff-alloc-grid tr.staff-alloc-group td {
  background: #769CCB;
  color: #ff0;
}
.staff-alloc-grid tr.staff-alloc-sub td {
  background: #9ab6d8;
  color: #10233f;
}
.staff-alloc-grid tr.staff-alloc-detail td { background: #fde9d9; }
.staff-alloc-grid tr.staff-alloc-detail.is-toggle { cursor: pointer; }
.staff-alloc-grid tr.staff-alloc-detail.is-open td { background: #f5d7b8; }
.staff-alloc-grid tr.staff-alloc-l3 td { background: #fff; }
.staff-alloc-grid tr.staff-alloc-l3.is-hidden { display: none; }
.staff-alloc-grid .staff-alloc-caret {
  display: inline-block;
  width: 1em;
  color: #c06000;
  font-size: 11px;
}
.staff-alloc-grid .staff-alloc-l3-label { padding-left: 18px; }
.staff-alloc-grid .staff-alloc-l3-link {
  background: none;
  border: 0;
  padding: 0;
  color: #003399;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.staff-alloc-grid .staff-alloc-l3-link:hover { text-decoration: underline; }
.staff-alloc-grid tr.staff-alloc-totals td { background: #ccc; color: #222; }
.staff-alloc-grid td.num { text-align: right; white-space: nowrap; }
.staff-desig-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow: auto;
}
.staff-desig-modal[hidden] { display: none !important; }
.staff-desig-modal-card {
  width: min(1100px, 100%);
  background: #ffffe8;
  border: 1px solid #999;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}
.staff-desig-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #ccc;
  background: #ffff99;
}
.staff-desig-modal-head strong { color: #00f; font-size: 16px; }
.staff-desig-modal-close {
  border: 0;
  background: transparent;
  color: #c00;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.staff-desig-modal-body { padding: 12px 14px; max-height: 70vh; overflow: auto; background: #fff; }
.staff-desig-modal-foot {
  padding: 8px 14px;
  border-top: 1px solid #ccc;
  text-align: center;
  background: #f7f7f7;
}
.staff-desig-modal-foot .staff-desig-modal-close {
  font-size: 14px;
  color: #003399;
}
.staff-desig-popup-grid tr.staff-desig-popup-totals td {
  background: #ccc;
  font-weight: 600;
}
.staff-filters .mp-date-crit { margin-top: 4px; }
.staff-filters .mp-radio-row { color: inherit; }
.staff-filters .mp-radio-row > span:first-of-type { min-width: 48px; }
