@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Playfair+Display:wght@700&display=swap");

/* ============================================================
   FONT IMPORT
   Reduced to a single combined request (was already good,
   kept as-is for readability).
   ============================================================ */

/* ============================================================
   DESIGN TOKENS
   Added --shadow-sm and --shadow-md to eliminate repeated
   rgba() shadow literals throughout the file.
   ============================================================ */
:root {
  --font-ui: "Manrope", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
  --brand:     #0d3b66;
  --brand-mid: #0f4d86;
  --accent:    #f4d35e;
  --bg:        #f7f5f0;
  --ink:       #1a1a1a;
  --muted:     #6b6b6b;
  --danger:    #dc2626;
  --card:      #ffffff;
  --border:    #d9d9d9;
  --gap:       clamp(12px, 2vw, 24px);
  --radius:    12px;
  --sidebar-width: 280px;
  --shadow-sm: 0 6px 20px rgba(0,0,0,.15);   /* new: replaces repeated literals */
  --shadow-md: 0 10px 30px rgba(0,0,0,.05);  /* new: replaces repeated literals */
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; } /* added pseudo-elements ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â best practice */

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: linear-gradient(180deg, #f2f6fb 0%, var(--bg) 60%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.25;
  letter-spacing: .01em;
  margin: 0 0 12px;
}

/* ============================================================
   HEADER & NAV
   ============================================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(95deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: #fff;
  padding: 14px clamp(16px, 3vw, 28px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 3px solid var(--accent);
  box-shadow: var(--shadow-sm); /* was: 0 6px 20px rgba(0,0,0,.15) */
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  padding: 7px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}

.logo-main {
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1;
}

.logo-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: #ffebb8;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 235, 184, .45);
  line-height: 1.1;
}

/* .nav-left and .nav-right share the same base ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â merged */
.nav, .nav-left, .nav-right {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav a {
  color: #fff;
  text-decoration: none;
  font-size: clamp(12px, 1.2vw, 14px);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Admin pill */
.nav a.admin {
  margin-left: auto;
  background: var(--accent);
  color: var(--ink); /* was hardcoded #1a1a1a ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â now uses token */
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
}

.hamburger {
  display: none;
  font-size: 22px;
  cursor: pointer;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  padding: clamp(16px, 3vw, 28px);
  max-width: min(1200px, 100%);
  margin: 0 auto;
  flex: 1 0 auto;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background:
          linear-gradient(130deg, rgba(13,59,102,.85), rgba(13,59,102,.75)),
          url('/images/hero.jpeg') center / cover no-repeat;
  color: #fff;
  padding: clamp(24px, 5vw, 48px) clamp(18px, 4vw, 36px);
  border-radius: calc(var(--radius) + 4px);
  position: relative;
  overflow: hidden;
}

.hero p {
  max-width: 620px;
  color: #f0f0f0;
}

.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -40px;
  width: 240px;
  height: 240px;
  background: rgba(244,211,94,.2);
  border-radius: 50%;
}

/* ============================================================
   CARDS
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--gap);
  margin-top: 24px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(14px, 2.4vw, 22px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md); /* was: 0 10px 30px rgba(0,0,0,.05) */
}

/* Compact auth card for login/reset pages */
.auth-card-small {
  width: min(100%, 460px);
  margin-left: auto;
  margin-right: auto;
  padding: clamp(18px, 2.6vw, 28px);
}

/* ============================================================
   LIST
   ============================================================ */
.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.list li:last-child { border-bottom: none; }

.more-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--brand);
  font-weight: 600;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: linear-gradient(95deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: rgba(255,255,255,0.88);
  padding: 20px;
  text-align: center;
  margin-top: auto;
  border-top: 3px solid var(--accent);
}

/* ============================================================
   FORMS
   ============================================================ */
fieldset {
  margin-bottom: var(--gap);
  padding: clamp(12px, 2.2vw, 18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

legend { font-weight: bold; }

label {
  display: block;
  margin-top: 10px;
}

/* Required marker fallback: ensures red * even if inline var(--danger) fails */
label span[style*="var(--danger)"],
.required-star {
  color: #dc2626 !important;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
}

button {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

button.secondary {
  background: var(--border); /* was hardcoded #d9d9d9 ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â now uses token */
  color: #222;
}

/* ============================================================
   GRID UTILITY
   ============================================================ */
.grid.two {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ============================================================
   TABLES
   ============================================================ */
table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
}

th, td {
  border: 1px solid #aaa;
  padding: 6px;
}

.simple-table td {
  border: none;
  padding: 8px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.table-scroll table { min-width: 640px; }

/* Table Controls */
.table-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 10px 0 14px;
}

.table-controls input,
.table-controls select {
  width: auto;
  min-width: 180px;
}

/* ============================================================
   INLINE FORM
   Removed duplicate rule block (.inline-form input, .inline-form select)
   that appeared twice. Kept the correct grid version only.
   ============================================================ */
.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}

.inline-form input,
.inline-form select,
.inline-form button {
  width: 100%;
  margin-right: 0;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

label.inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  margin-top: 0;
}

label.inline input[type='checkbox'] {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.hidden { display: none; }

.text-uppercase-input {
  text-transform: uppercase;
}

.ba-help-text {
  color: var(--muted);
  font-size: 12px;
}

.ba-grid-full {
  grid-column: 1 / -1;
}

.ba-note {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}

.ba-note-info {
  background: #f0f6ff;
  color: var(--ink-2);
}

.ba-note-warning {
  background: var(--accent-light);
  border-color: #fcd5a2;
  color: #92400e;
}

.ba-mt-8 { margin-top: 8px; }
.ba-mt-10 { margin-top: 10px; }
.ba-mt-12 { margin-top: 12px; }

.ba-table-empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 18px;
}

.ba-declaration-box {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}

.ba-declaration-agree-row {
  margin: 8px 0 14px;
}

.ba-inline-flex {
  display: flex;
}

.ba-declaration-error {
  text-align: center;
  margin-top: -8px;
  margin-bottom: 10px;
}

.declaration {
  font-size: 14px;
  color: var(--muted);
}

.error-msg   { color: #c0392b; font-weight: 600; }
.success-msg { color: #1b8f4e; font-weight: 600; }

.preview-image {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border: 1px solid #c8d6e8;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

/* ============================================================
   EXCEL EXPORT BUTTON
   ============================================================ */
.excel-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink); /* was hardcoded #1a1a1a */
  border: 1px solid #2e7d32;
  background: #e8f5e9;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.excel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 20px;
  background: #2e7d32;
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.pager button { padding: 6px 10px; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  display: flex;
  gap: clamp(10px, 2vw, 18px);
  margin: 20px 0;
  flex-wrap: wrap;
}

.timeline div {
  padding: 10px;
  border-radius: 50%;
  background: #ccc;
  font-size: 12px;
  text-align: center;
  width: 100px;
}

.timeline .active {
  background: green;
  color: #fff;
}

/* ============================================================
   APPLICATION / GOV FORM VIEW
   ============================================================ */
.application-view {
  font-family: "Source Serif 4", serif;
  font-size: 15px;
  color: #000;
  background: #fff;
  padding: 22px 24px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  max-width: 1060px;
  margin: 0 auto;
  line-height: 1.35;
}

.gov-header {
  text-align: center;
  font-weight: bold;
  margin-bottom: 12px;
  line-height: 1.25;
}

.dept-name  { font-size: 34px; }
.form-title { font-size: 28px; margin-top: 2px; }

.section-title {
  margin-top: 18px;
  margin-bottom: 6px;
  font-weight: bold;
  font-size: 26px;
}

/* Merged .data-table and .meta-table shared rules */
.data-table,
.meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 5px;
}

.data-table td,
.data-table th {
  border: 1px solid #000;
  padding: 6px 8px;
  vertical-align: top;
  font-size: 15px;
}

.meta-table td {
  padding: 7px 8px;
  font-size: 16px;
  font-weight: 600;
}

.application-view .data-table th {
  background: #fff;
  color: #000;
  position: static;
  font-weight: 700;
}

.application-view .data-table tr:nth-child(odd) td,
.application-view .data-table tr:nth-child(even) td {
  background: #fff;
}

.section-grid {
  display: grid;
  grid-template-columns: 2.5fr 0.9fr;
  gap: 12px;
  align-items: start;
}

.photo-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

/* Merged shared rules for photo & signature frames */
.photo-frame,
.signature-frame {
  border: 1px solid #000;
  padding: 4px;
  text-align: center;
  width: 170px;
  height: 190px;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.signature-frame {
  height: 85px;
  min-height: 85px;
}

.photo-frame img,
.signature-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.post-category-row th,
.post-category-row td {
  text-align: left;
}

.action-bar {
  text-align: right;
  margin: 0 0 10px;
}

/* ============================================================
   STATUS
   ============================================================ */
.status-line {
  display: flex;
  gap: clamp(8px, 2vw, 16px);
  flex-wrap: wrap;
}

.dot {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.green::before { background: green; }
.grey::before  { background: grey; }
.red::before   { background: #c0392b; }

.status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-remark {
  font-size: 12px;
  color: var(--muted);
  max-width: 180px;
}

/* ============================================================
   ADMIN SHELL
   ============================================================ */
.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--gap);
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.admin-top-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Reuses --brand token; hardcoded #0d3b66 removed */
.admin-menu {
  background: var(--brand);
  padding: 16px;
  border-radius: 8px;
  color: #fff;
}

.admin-menu a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 8px 0;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   Consolidated from 4 scattered @media blocks into 3 clean ones.
   ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â¢ 1024px: stacks cards + section-grid
   ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â¢ 900px:  stacks admin-shell, collapses nav to hamburger
   ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â¢ 768px:  stacks .grid.two, shrinks timeline circles
   ============================================================ */
@media (max-width: 1024px) {
  .cards        { grid-template-columns: 1fr; }
  .section-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }

  .hamburger { display: block; }

  .nav {
    display: none;
    position: absolute;
    top: 60px;
    right: 10px;
    flex-direction: column;
    background: var(--brand);
    padding: 12px;
    border-radius: 8px;
    width: min(90vw, 260px);
    gap: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,.2);
  }

  .nav-left,
  .nav-right {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .nav a {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
  }

  .nav a.admin {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .grid.two    { grid-template-columns: 1fr; }

  .timeline div {
    width: 84px;
    padding: 8px;
    font-size: 11px;
  }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  html, body {
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .no-print,
  .header,
  .footer { display: none; } /* merged 3 rules into 1 */

  .container {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .application-view {
    width: 100%;
    max-width: 100%;
    box-shadow: none;
    border-radius: 0;
    border: none;
    margin: 0;
    padding: 0;
    font-size: 12px;
    background: #fff !important;
  }

  /* Repeated screen values kept for print override clarity */
  .dept-name  { font-size: 21px; }
  .form-title { font-size: 17px; }
  .section-title { font-size: 16px; margin-top: 10px; margin-bottom: 3px; }

  .section-grid {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .section-grid > div:first-child { width: 75% !important; }

  .photo-box {
    width: 25% !important;
    text-align: right;
  }

  .data-table,
  .meta-table,
  .simple-table { width: 100% !important; }

  .data-table td,
  .data-table th,
  .meta-table td {
    padding: 4px 5px;
    font-size: 12px;
  }

  .photo-frame,
  .signature-frame {
    width: 37mm;
    height: 37mm;
    min-height: 37mm;
    padding: 2px;
  }

  a { color: #000; text-decoration: none; }

  .table-scroll             { overflow: visible !important; }
  .table-scroll table       { min-width: 0 !important; }
}

@page {
  size: A4;
  margin: 7mm;
}

/* ============================================================
   ADMIN/USER DASHBOARD POLISH
   ============================================================ */
.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: start;
}

.admin-top {
  position: sticky;
  top: 72px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid #d6e1ef;
  border-radius: 12px;
  background: #ffffffd9;
  backdrop-filter: blur(4px);
}

.admin-top a {
  text-decoration: none;
  font-weight: 600;
  color: var(--brand);
}

.admin-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-menu {
  position: sticky;
  top: 132px;
  border: 1px solid #1a4e82;
  border-radius: 14px;
  background: linear-gradient(180deg, #0f3e6a 0%, #0d2f51 100%);
  padding: 14px;
  box-shadow: 0 12px 28px rgba(9, 37, 70, 0.3);
}

.admin-menu h3 {
  margin: 0 0 10px;
  padding: 0 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: #e6f0fa;
}

.admin-menu a {
  display: block;
  margin-bottom: 5px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #ecf4ff;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}

.admin-menu a:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateX(2px);
}

.admin-menu form {
  margin: 8px 0 0;
}

.admin-menu form button {
  width: 100%;
}

.floating-logout-form {
  position: fixed;
  right: 18px;
  bottom: 18px;
  margin: 0 !important;
  z-index: 1300;
  transition: transform .2s ease;
}

.floating-logout-btn {
  width: auto !important;
  min-width: 108px;
  padding: 10px 16px !important;
  border-radius: 999px !important;
  border: 1px solid #b91c1c !important;
  background: #dc2626 !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
}

.floating-logout-btn:hover {
  background: #b91c1c !important;
}

.admin-shell .card {
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 14px 26px rgba(14, 35, 61, 0.08);
}

.table-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 8px 0 14px;
  padding: 10px;
  background: #f6faff;
  border: 1px solid #dde8f5;
  border-radius: 10px;
}

.table-controls input,
.table-controls select {
  min-width: 170px;
}

.table-scroll {
  border: 1px solid #d9e3ef;
  border-radius: 10px;
  background: #fff;
}

table {
  border-collapse: collapse;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #e9f1fb;
  color: #0c3458;
}

tbody tr:nth-child(odd) td {
  background: #fcfdff;
}

tbody tr:hover td {
  background: #f4f9ff;
}

.pager {
  margin-top: 10px;
  padding: 6px 8px;
  border: 1px solid #d8e4f1;
  border-radius: 8px;
  background: #fbfdff;
}

.excel-link {
  border-radius: 8px;
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-top,
  .admin-menu {
    position: static;
  }
}


/* BUILDER FINAL UI PASS */
.builder-page {
  max-width: 1080px;
  margin: 0 auto;
}

.builder-title {
  font-size: clamp(28px, 3.2vw, 38px);
  letter-spacing: .2px;
  margin-bottom: 14px;
}

.builder-form {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #d9e3ef;
  border-radius: 14px;
  padding: clamp(14px, 2.4vw, 24px);
  box-shadow: 0 10px 26px rgba(17, 39, 67, 0.08);
}

.builder-section {
  margin-bottom: 16px;
  border: 1px solid #d7e2ef;
  border-radius: 12px;
  background: #fff;
}

.builder-section legend {
  padding: 0 8px;
  color: #0d3b66;
  font-weight: 700;
  letter-spacing: .2px;
}

.builder-form .grid.two {
  gap: 14px 16px;
}

.builder-form label {
  margin-top: 0;
  margin-bottom: 6px;
  font-weight: 600;
  color: #1f2f45;
}

.builder-form input,
.builder-form select,
.builder-form textarea {
  min-height: 40px;
  border: 1px solid #c8d6e8;
  border-radius: 10px;
  background: #fcfeff;
}

.builder-form input:focus,
.builder-form select:focus,
.builder-form textarea:focus {
  outline: none;
  border-color: #2f6fad;
  box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.12);
}

.builder-form .builder-qual-table th {
  background: #f3f8fd;
  color: #132c4a;
}

.builder-form .builder-qual-table td input[type='text'] {
  min-height: 36px;
}

.builder-form .builder-qual-table td input[type='file'] {
  min-height: 36px;
  padding: 6px;
}

.builder-form button[type='submit'] {
  min-width: 220px;
  min-height: 42px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: .2px;
}

.form-submit-row {
  display: flex !important;
  justify-content: flex-end !important;
  width: 100%;
}

.form-submit-row > button[type='submit'],
.form-submit-row > .submit-registration-btn,
.form-submit-row > #submitApplicationBtn {
  margin-left: auto !important;
}

.declaration-agree-row {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100%;
  text-align: center;
}

.declaration-agree-row .inline-checkbox {
  margin: 0 auto !important;
}

@media (max-width: 768px) {
  .builder-form {
    padding: 14px;
  }
  .builder-title {
    font-size: clamp(24px, 6vw, 30px);
  }
}


/* GUIDE CONSISTENCY PASS: VIEW + EDIT */
.guide-view,
.guide-edit {
  max-width: 1080px;
  margin: 0 auto;
}

.guide-view {
  border: 1px solid #d7e1ec;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 12px 30px rgba(13, 41, 74, 0.08);
}

.guide-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.guide-view .dept-name {
  font-size: clamp(30px, 3.2vw, 38px);
  letter-spacing: .2px;
}

.guide-view .form-title {
  font-size: clamp(24px, 2.8vw, 31px);
}

.guide-view .section-title {
  font-size: clamp(22px, 2.4vw, 28px);
  color: #122c49;
}

.guide-view .guide-meta td {
  background: #f4f8fd;
  border-color: #cfd9e5;
}

.guide-view .guide-table th {
  background: #f4f8fd;
  color: #132e4c;
}

.guide-view .guide-table td,
.guide-view .guide-table th {
  border-color: #c6d2df;
}

.guide-edit .guide-title {
  margin-bottom: 14px;
  font-size: clamp(28px, 3.1vw, 36px);
}

.guide-edit .guide-form {
  border: 1px solid #d7e1ec;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: clamp(14px, 2.2vw, 22px);
  box-shadow: 0 12px 28px rgba(13, 41, 74, 0.08);
}

.guide-edit .guide-section {
  border: 1px solid #d6e0ec;
  border-radius: 12px;
}

.guide-edit .guide-section legend {
  color: #0f3559;
  font-weight: 700;
  letter-spacing: .2px;
}

.guide-edit .guide-form label {
  margin-top: 0;
  margin-bottom: 6px;
  font-weight: 600;
  color: #1e3047;
}

.guide-edit .guide-form input,
.guide-edit .guide-form select,
.guide-edit .guide-form textarea {
  min-height: 40px;
  border: 1px solid #c5d3e4;
  border-radius: 10px;
  background: #fcfeff;
}

.guide-edit .guide-form input:focus,
.guide-edit .guide-form select:focus,
.guide-edit .guide-form textarea:focus {
  outline: none;
  border-color: #2f6fad;
  box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.12);
}

.guide-edit .guide-grid-table th {
  background: #f4f8fd;
  color: #132e4c;
  border: 1px solid #c6d2df;
}

.guide-edit .guide-grid-table td {
  border: 1px solid #cfd9e5;
}

@media (max-width: 900px) {
  .guide-top {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  .guide-view {
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: #fff !important;
  }
}

/* ADMIN NAV CONSISTENCY PASS */
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-menu-group {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px;
}

.menu-group-title {
  font-size: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #c7def7;
  margin: 2px 4px 6px;
  font-weight: 700;
}

.admin-nav a {
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
}

.admin-nav a:last-child {
  margin-bottom: 0;
}

.admin-menu-logout {
  margin-top: 4px;
}

.admin-menu-logout button {
  width: 100%;
  background: #f4d35e;
  color: #112b45;
  font-weight: 700;
}

.admin-topbar {
  border: 1px solid #d8e2ee;
  border-radius: 12px;
}

.admin-home-link {
  font-weight: 700;
  letter-spacing: .2px;
}

.admin-user-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid #ccd9e8;
  border-radius: 999px;
  background: #f6f9fd;
  color: #132f4d;
  font-weight: 600;
}

.admin-dashboard-card {
  border-radius: 14px;
}

.admin-quick-links {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.admin-quick-link {
  display: block;
  text-decoration: none;
  text-align: center;
  border: 1px solid #c7d5e6;
  border-radius: 10px;
  padding: 10px 12px;
  color: #103557;
  font-weight: 600;
  background: #f7fbff;
}

.admin-quick-link:hover {
  background: #ecf5ff;
}

.admin-home-logout {
  margin-top: 14px;
}

@media (max-width: 900px) {
  .admin-nav {
    gap: 10px;
  }
  .admin-topbar {
    top: 64px;
  }
}

/* ADMIN CONTENT CONSISTENCY PASS */
.admin-content-card {
  border: 1px solid #d8e2ee;
  border-radius: 14px;
}

.admin-page-title {
  margin-bottom: 4px;
  font-size: clamp(26px, 2.8vw, 34px);
}

.admin-page-subtitle {
  margin: 0 0 12px;
  color: #47607e;
  font-size: 14px;
}

.admin-filter-bar {
  margin: 8px 0 14px;
  padding: 10px;
  border: 1px solid #d9e3ef;
  border-radius: 10px;
  background: #f8fbff;
}

.admin-data-table thead th {
  background: #f3f8fd;
  color: #112f50;
  border-color: #c6d2df;
}

.admin-data-table td {
  border-color: #d2dbe5;
  vertical-align: middle;
}

.admin-data-table tbody tr:nth-child(even) td {
  background: #fcfdff;
}

.admin-form-block {
  margin: 8px 0 14px;
  padding: 12px;
  border: 1px solid #d9e3ef;
  border-radius: 10px;
  background: #f9fcff;
}

/* ADMIN TABLE MICRO PASS */
.admin-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.admin-filter-bar .excel-link {
  justify-self: start;
  align-self: center;
}

.admin-filter-bar input,
.admin-filter-bar select,
.admin-filter-bar button {
  width: 100%;
  min-height: 38px;
}

.admin-filter-bar form.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.admin-filter-bar form.inline label {
  margin: 0;
  font-size: 13px;
  color: #233c59;
  white-space: nowrap;
}

.admin-filter-bar form.inline input[type='checkbox'] {
  width: 16px;
  min-height: 16px;
}

.admin-data-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

.admin-data-table th,
.admin-data-table td {
  padding: 9px 10px;
  line-height: 1.35;
  vertical-align: middle;
  word-wrap: break-word;
}

.admin-data-table th {
  font-weight: 700;
  letter-spacing: .1px;
}

.admin-data-table .remark-input {
  width: 100%;
  min-height: 36px;
  margin-bottom: 4px;
}

.admin-data-table form {
  margin: 0;
}

.admin-data-table .secondary,
.admin-data-table button[type='submit'] {
  min-height: 34px;
  padding: 6px 10px;
}

.pager {
  margin-top: 14px;
  padding-top: 6px;
  border-top: 1px solid #e0e8f2;
}

/* ADDRESS BLOCK ALIGNMENT */
.address-block .address-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  margin-bottom: 6px;
}

.address-block .address-header h4 {
  margin: 0;
}

.inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  margin: 0 0 6px 0;
  white-space: nowrap;
}

.inline-checkbox input[type='checkbox'] {
  width: 16px;
  min-height: 16px;
  margin: 0;
  vertical-align: middle;
}

.inline-checkbox-spacer {
  width: 185px;
  display: inline-block;
}

/* GUIDE CONSISTENCY PASS: REGISTRATION */
.guide-registration {
  max-width: 1080px;
  margin: 0 auto;
}

.guide-registration .guide-title {
  margin-bottom: 14px;
  font-size: clamp(28px, 3.1vw, 36px);
}

.guide-registration .guide-form {
  border: 1px solid #d7e1ec;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: clamp(14px, 2.2vw, 22px);
  box-shadow: 0 12px 28px rgba(13, 41, 74, 0.08);
}

.guide-registration .guide-section {
  border: 1px solid #d6e0ec;
  border-radius: 12px;
}

.guide-registration .guide-section legend {
  color: #0f3559;
  font-weight: 700;
  letter-spacing: .2px;
}

.guide-registration .guide-form label {
  margin-top: 0;
  margin-bottom: 6px;
  font-weight: 600;
  color: #1e3047;
}

.guide-registration .guide-form input,
.guide-registration .guide-form select,
.guide-registration .guide-form textarea {
  min-height: 40px;
  border: 1px solid #c5d3e4;
  border-radius: 10px;
  background: #fcfeff;
}

.guide-registration .guide-form input:focus,
.guide-registration .guide-form select:focus,
.guide-registration .guide-form textarea:focus {
  outline: none;
  border-color: #2f6fad;
  box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.12);
}

.guide-registration .guide-grid-table th {
  background: #f4f8fd;
  color: #132e4c;
  border: 1px solid #c6d2df;
}

.guide-registration .guide-grid-table td {
  border: 1px solid #cfd9e5;
}

.guide-registration .declaration {
  color: #42556f;
}

.guide-registration #submitApplicationBtn {
  min-width: 240px;
  min-height: 42px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: .2px;
}

/* CONSISTENT SIDEBAR WIDTH (ADMIN + USER) */
.admin-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) !important;
}

.admin-shell > .admin-menu {
  width: 100%;
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
}

/* MOBILE/TABLET SIDEBAR TOGGLE */
.menu-close-btn {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32);
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 1024px) {
  body.has-sidebar-menu .hamburger {
    display: block;
  }

  body.has-sidebar-menu .nav {
    display: none !important;
  }

  body.has-sidebar-menu .admin-shell {
    grid-template-columns: 1fr;
  }

  body.has-sidebar-menu .admin-menu {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(82vw, var(--sidebar-width));
    z-index: 1200;
    transform: translateX(-104%);
    transition: transform .2s ease;
    border-radius: 0 14px 14px 0;
    overflow-y: auto;
    padding-top: 48px;
  }

  body.has-sidebar-menu.sidebar-open .admin-menu {
    transform: translateX(0);
  }

  body.has-sidebar-menu .menu-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.has-sidebar-menu .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(8, 20, 35, 0.42);
  }

  body.has-sidebar-menu.sidebar-open .sidebar-overlay {
    display: block;
  }
}

/* UNIFORM WIDTH + TYPOGRAPHY PASS (ADMIN/USER/PREVIEW) */
:root {
  --panel-max-width: 1320px;
  --panel-font-size: 15px;
  --panel-title-size: clamp(27px, 2.8vw, 34px);
}

.admin-shell,
.guide-registration,
.builder-page,
.guide-edit,
.guide-view {
  width: 100%;
  max-width: var(--panel-max-width);
  margin-left: auto;
  margin-right: auto;
}

.admin-shell .card,
.admin-content-card,
.guide-registration .guide-form,
.builder-form,
.guide-edit .guide-form,
.guide-view {
  width: 100%;
  max-width: none;
}

.admin-shell .card,
.admin-shell .card p,
.admin-shell .card label,
.admin-shell .card input,
.admin-shell .card select,
.admin-shell .card textarea,
.admin-shell .card button,
.admin-shell .card td,
.admin-shell .card th,
.guide-registration,
.builder-page,
.guide-edit,
.guide-view,
.application-view {
  font-size: var(--panel-font-size);
}

.admin-page-title {
  font-size: var(--panel-title-size) !important;
}

.admin-page-subtitle {
  font-size: 15px !important;
}

@media (max-width: 1024px) {
  :root {
    --panel-font-size: 14px;
  }
}

.button-link {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  color: #1f2937;
  text-decoration: none;
  background: #fff;
}

.button-link.active {
  background: #0f4c81;
  border-color: #0f4c81;
  color: #fff;
}


/* ============================================================
   PAYMENT PAGE — QR + FORM SIDE BY SIDE LAYOUT
   Scoped to .payment-page to avoid global input width fights
   ============================================================ */

/* ── Outer wrapper ── */
.payment-page { max-width: 880px; }

/* ── Info strip ── */
.pay-info-strip {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
  background: #fef3e2;
  border: 1.5px solid #fcd5a2;
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 20px;
}

.pay-info-item-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin-bottom: 3px;
}

.pay-info-item-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: .5px;
}

.pay-info-item-value.amount { color: #1a7f4e; }

/* ── Main split card ── */
.pay-card {
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(12,45,90,.12);
}

/* ── QR side ── */
.pay-qr-side {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-mid) 100%);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pay-qr-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}

/* The white box that holds the QR image — fixed size, never stretches */
.pay-qr-frame {
  width: clamp(220px, 94%, 320px) !important;
  aspect-ratio: 3 / 4;
  height: auto !important;
  min-width: 220px !important;
  min-height: calc(220px * 4 / 3) !important;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  box-sizing: border-box;
  box-shadow: 0 8px 28px rgba(0,0,0,.32);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* The QR image itself — fixed, never 100% */
.pay-qr-frame img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
  display: block;
}

.pay-qr-apps {
  text-align: center;
}

.pay-qr-apps-title {
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
}

.pay-qr-badges {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
}

.pay-qr-badge {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.88);
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,.2);
}

.pay-qr-link {
  font-size: 11.5px;
  color: rgba(255,255,255,.5);
  text-decoration: none;
}

.pay-qr-link:hover { color: rgba(255,255,255,.9); }

/* ── Form side ── */
.pay-form-side {
  padding: 28px 30px;
}

.pay-form-side h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

.pay-form-side > p {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: var(--muted);
}

/* Form grid — two columns inside the form side */
.pay-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}

.pay-form-full { grid-column: 1 / -1; }

/* Reset the global input:width:100% ONLY inside pay-form-side */
.pay-form-side input,
.pay-form-side select {
  width: 100%;          /* intentional — grid cells are already sized */
  min-width: 0;
}

.pay-form-note {
  margin: 16px 0;
  padding: 10px 14px;
  background: #f0f6ff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
}

.pay-submit-btn {
  width: 100%;
  padding: 12px;
  background: #1a7f4e;
  color: #fff;
  border: none;
  border-radius: 9px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(26,127,78,.28);
  transition: background .2s, transform .1s;
}

.pay-submit-btn:hover {
  background: #156b40;
  transform: translateY(-1px);
}

/* ── Mobile stack ── */
@media (max-width: 660px) {
  .pay-card { grid-template-columns: 1fr; }
  .pay-qr-side { padding: 22px 18px; }
  .pay-form-side { padding: 22px 18px; }
  .pay-form-grid { grid-template-columns: 1fr; }
  .pay-form-full { grid-column: 1; }
}


/* ============================================================
   ADMIN PAYMENT QR PAGE — fixed-size QR display
   ============================================================ */
.admin-qr-page { }

.admin-qr-view-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
}

/* Navy card holding the QR in admin */
.admin-qr-card {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-mid) 100%);
  border-radius: 14px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(12,45,90,.25);
  min-width: 210px;
}

.admin-qr-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}

/* White frame — fixed, cannot be stretched by global rules */
.admin-qr-frame {
  width: clamp(205px, 92%, 300px) !important;
  aspect-ratio: 3 / 4;
  height: auto !important;
  min-width: 205px !important;
  min-height: calc(205px * 4 / 3) !important;
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  box-sizing: border-box;
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-qr-frame img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
  display: block;
}

.admin-qr-open-link {
  font-size: 12px;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  text-align: center;
}

.admin-qr-open-link:hover { color: rgba(255,255,255,.9); }

.admin-qr-meta-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
}

.admin-qr-meta-card h3 { margin: 0 0 16px; }

.admin-qr-meta-table { margin: 0; border: none !important; }
.admin-qr-meta-table td { border: none !important; padding: 7px 10px 7px 0; vertical-align: top; }
.admin-qr-meta-table td:first-child {
  font-weight: 600;
  color: var(--ink-2);
  width: 110px;
  white-space: nowrap;
}

.admin-qr-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0faf4;
  color: #1a7f4e;
  border: 1.5px solid #a7f3d0;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.admin-qr-status::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #1a7f4e;
  border-radius: 50%;
  display: inline-block;
}

.admin-qr-warn {
  margin-top: 18px;
  padding: 11px 14px;
  background: #fef3e2;
  border: 1.5px solid #fcd5a2;
  border-radius: 9px;
  font-size: 13px;
  color: #92400e;
}

/* Upload tab form */
.admin-qr-upload-card {
  max-width: 500px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.admin-qr-upload-info {
  background: #f0f6ff;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--ink-2);
  margin-bottom: 18px;
}

.admin-qr-filepath {
  background: var(--bg);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-2);
  font-family: monospace;
  word-break: break-all;
  display: block;
  margin-top: 4px;
}

/* File input inside admin upload — override global width if needed */
.admin-qr-upload-card input[type="file"] {
  width: 100%;
}

@media (max-width: 660px) {
  .admin-qr-view-grid { grid-template-columns: 1fr; }
  .admin-qr-card { min-width: 0; width: 100%; }
}


/* ============================================================
   LAYOUT STABILITY FIX — v2
   Problem: admin-shell and container have conflicting widths
   causing content area to jump between pages.

   Solution: Lock everything to one shared max-width via
   --layout-max. The .container wraps ALL pages, so we make
   admin-shell fill it fully instead of fighting it.
   ============================================================ */

:root {
  --layout-max:    1280px;   /* single source of truth */
  --sidebar-w:     272px;    /* locked sidebar width   */
  --content-pad:   clamp(16px, 2.5vw, 28px);
}

/* Container: one max-width, always centred */
.container {
  max-width: var(--layout-max) !important;
  width: 100% !important;
  padding: var(--content-pad) !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

/* Admin shell: always fills container, never wider */
.admin-shell {
  display: grid !important;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) !important;
  gap: 20px !important;
  width: 100% !important;
  max-width: 100% !important;   /* relative to container */
  margin: 0 !important;
  align-items: start !important;
  box-sizing: border-box !important;
}

/* Sidebar: fixed width, never shrinks */
.admin-shell > .admin-menu {
  width: var(--sidebar-w) !important;
  min-width: var(--sidebar-w) !important;
  max-width: var(--sidebar-w) !important;
  box-sizing: border-box !important;
}

/* Content card: fills remaining space, never overflows */
.admin-shell > .card,
.admin-shell > div:not(.admin-menu) {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Full-page wrappers (forms, registration, etc.) */
.builder-page,
.guide-registration,
.guide-edit,
.guide-view,
.guide-view,
.payment-page {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}


/* ============================================================
   TABLE STANDARDISATION — v2
   All data tables get consistent column sizing, overflow
   handling, and visual treatment regardless of which page.
   ============================================================ */

/* Universal scroll wrapper — apply to ALL data tables */
.table-scroll {
  width: 100% !important;
  overflow-x: auto !important;
  border-radius: 10px !important;
  border: 1.5px solid var(--border) !important;
  background: #fff !important;
  box-sizing: border-box !important;
}

/* Base table reset — every table gets this */
.table-scroll table,
table.admin-data-table,
table.data-table,
table.simple-table,
.card table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
  font-size: 13.5px !important;
  box-sizing: border-box !important;
}

/* Force min-width only on wide data tables (many columns) */
.table-scroll table { min-width: 600px !important; }

/* TH — uniform header */
.table-scroll th,
table.admin-data-table th,
table.data-table th,
.card table th {
  background: var(--brand) !important;
  color: #fff !important;
  padding: 11px 13px !important;
  text-align: left !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  letter-spacing: .25px !important;
  white-space: nowrap !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
}

/* TD — uniform cell */
.table-scroll td,
table.admin-data-table td,
table.data-table td,
.card table td {
  padding: 10px 13px !important;
  border-bottom: 1px solid #f0f2f6 !important;
  vertical-align: middle !important;
  color: var(--ink-2) !important;
  font-size: 13.5px !important;
  word-break: break-word !important;
}

/* Zebra + hover */
.table-scroll tbody tr:nth-child(even) td,
table.admin-data-table tbody tr:nth-child(even) td { background: #fafbfd !important; }

.table-scroll tbody tr:hover td,
table.admin-data-table tbody tr:hover td,
.card table tbody tr:hover td { background: #fef3e2 !important; }

/* Key-value / simple profile tables — no heavy borders */
table.simple-table th,
table.simple-table td {
  background: transparent !important;
  border-bottom: 1px solid #f0f2f6 !important;
  padding: 9px 12px !important;
  position: static !important;
  font-size: 14px !important;
  color: var(--ink-2) !important;
}

table.simple-table th {
  color: var(--brand) !important;
  font-weight: 700 !important;
  width: 200px !important;
  white-space: nowrap !important;
}

/* Approvals remark inputs inside table cells */
.admin-data-table td input[type="text"].remark-input {
  width: 100% !important;
  min-width: 0 !important;
  margin-bottom: 5px !important;
  font-size: 13px !important;
}

/* Action buttons inside table cells */
.admin-data-table td button,
.card table td button {
  padding: 5px 10px !important;
  font-size: 12.5px !important;
  min-height: auto !important;
}

.admin-data-table td form {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

/* Empty state row */
.table-empty-row td {
  text-align: center !important;
  padding: 28px !important;
  color: var(--muted) !important;
  font-size: 14px !important;
}


/* ============================================================
   TOPBAR — sticky, always same width as container content
   ============================================================ */
.admin-top {
  position: sticky !important;
  top: 64px !important;
  z-index: 50 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 11px 16px !important;
  margin-bottom: 16px !important;
  background: rgba(255,255,255,.95) !important;
  backdrop-filter: blur(6px) !important;
  border: 1.5px solid var(--border) !important;
  border-left: 4px solid var(--accent) !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(12,45,90,.07) !important;
  box-sizing: border-box !important;
}


/* ============================================================
   MOBILE — collapse sidebar, keep content full-width
   ============================================================ */
@media (max-width: 1024px) {
  .admin-shell {
    grid-template-columns: 1fr !important;
  }
  .admin-shell > .admin-menu {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    position: static !important;
  }
  body.has-sidebar-menu .admin-shell {
    grid-template-columns: 1fr !important;
  }
  body.has-sidebar-menu .admin-menu {
    position: fixed !important;
    left: 0 !important; top: 0 !important; bottom: 0 !important;
    width: min(80vw, var(--sidebar-w)) !important;
    max-width: min(80vw, var(--sidebar-w)) !important;
    z-index: 1200 !important;
    transform: translateX(-105%) !important;
    transition: transform .25s ease !important;
    border-radius: 0 14px 14px 0 !important;
    overflow-y: auto !important;
    padding-top: 48px !important;
  }
  body.has-sidebar-menu.sidebar-open .admin-menu {
    transform: translateX(0) !important;
  }
}

@media (max-width: 768px) {
  .admin-top { top: 56px !important; }
}


/* ============================================================
   PROFILE PAGE — section dividers, photo/signature frames
   ============================================================ */

.profile-section {
  margin-bottom: 20px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.profile-section-title {
  background: #f4f6fb;
  border-bottom: 1.5px solid var(--border);
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--brand);
}

/* simple-table inside profile-section: remove extra borders */
.profile-section .simple-table {
  margin: 0;
  border: none !important;
}

.profile-section .simple-table th,
.profile-section .simple-table td {
  border-top: none !important;
  padding: 9px 16px !important;
}

.profile-section .simple-table th {
  width: 210px !important;
  background: #fafbfd !important;
  border-right: 1.5px solid var(--border) !important;
}

/* Doc link button */
.doc-view-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: #f0f6ff;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}

.doc-view-link:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

@media (max-width: 700px) {
  div[style*="grid-template-columns:auto auto 1fr"] {
    grid-template-columns: 1fr !important;
  }
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}


/* ============================================================
   PROFILE PHOTO & SIGNATURE — fixed frames, immune to global
   img/max-width overrides. Uses !important throughout.
   ============================================================ */

/* Wrapper row holding both frames side by side */
.profile-media-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 18px 20px;
  background: #f8fafd;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
}

/* Individual photo/sign block */
.profile-media-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.profile-media-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
}

/* PHOTO frame — portrait 110 × 130 */
.profile-photo-frame {
  width:  110px !important;
  height: 130px !important;
  min-width:  110px !important;
  min-height: 130px !important;
  max-width:  110px !important;
  max-height: 130px !important;
  border: 2px solid var(--border) !important;
  border-radius: 8px !important;
  background: #fff !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.profile-photo-frame img {
  width:  110px !important;
  height: 130px !important;
  max-width:  110px !important;
  max-height: 130px !important;
  object-fit: cover !important;
  display: block !important;
}

/* SIGNATURE frame — landscape 200 × 80 */
.profile-sign-frame {
  width:  220px !important;
  height:  80px !important;
  min-width:  220px !important;
  min-height:  80px !important;
  max-width:  220px !important;
  max-height:  80px !important;
  border: 2px solid var(--border) !important;
  border-radius: 8px !important;
  background: #fff !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.profile-sign-frame img {
  max-width:  208px !important;
  max-height:  68px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
}

/* Empty placeholder inside frame */
.profile-media-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #bbb;
  font-size: 11px;
  text-align: center;
  pointer-events: none;
}

/* Small link below frame */
.profile-media-link {
  font-size: 12px;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}
.profile-media-link:hover { text-decoration: underline; }

/* User Id chip pushed to right */
.profile-id-chip {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  text-align: center;
  align-self: flex-start;
}
.profile-id-chip-label {
  font-size: 10.5px;
  letter-spacing: .8px;
  opacity: .7;
  font-weight: 600;
  text-transform: uppercase;
}
.profile-id-chip-value {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .5px;
  font-family: monospace;
  margin: 2px 0;
}
.profile-id-chip-date {
  font-size: 11px;
  opacity: .6;
}


/* ============================================================
   APPLICATION VIEW — view-application-builder, track/view,
   track/status  (profile-section reused)
   ============================================================ */

/* Top header bar with govt branding + actions */
.app-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 6px 20px rgba(12,45,90,.2);
}

.app-view-gov-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.65);
  margin-bottom: 4px;
}

.app-view-form-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  font-family: "Source Serif 4", serif;
}

.app-view-meta-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.app-view-meta-pill {
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12.5px;
  color: rgba(255,255,255,.9);
  font-family: monospace;
  letter-spacing: .3px;
}

.app-view-meta-pill b {
  color: rgba(255,255,255,.55);
  font-style: normal;
  font-family: "Plus Jakarta Sans", sans-serif;
  letter-spacing: 0;
  font-size: 11px;
}

/* Action buttons (print, download) */
.app-view-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}

.app-view-actions button,
.app-view-actions a {
  padding: 8px 18px;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background .2s;
  white-space: nowrap;
}

.app-view-actions button:hover,
.app-view-actions a:hover {
  background: rgba(255,255,255,.28);
}

/* Application status badge */
.app-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  margin-top: 8px;
}

.app-status-badge.pending   { background:#fef3e2; color:#92400e; border:1.5px solid #fcd5a2; }
.app-status-badge.active    { background:#f0f6ff; color:#1e40af; border:1.5px solid #bfdbfe; }
.app-status-badge.success   { background:#f0faf4; color:#1a7f4e; border:1.5px solid #a7f3d0; }
.app-status-badge.rejected  { background:#fef2f2; color:#dc2626; border:1.5px solid #fca5a5; }

/* Photo + signature banner (reuses profile style but adapted) */
.app-photo-banner {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
}

.app-photo-frame {
  width: 110px;
  height: 130px;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-photo-frame img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

.app-sign-frame {
  width: 220px;
  height: 80px;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-sign-frame img {
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  padding: 4px;
}

.app-photo-placeholder,
.app-sign-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}

.app-photo-placeholder span,
.app-sign-placeholder span { font-size: 11px; }

/* Directors / Projects inline table (within profile-section) */
.app-inner-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.app-inner-table th {
  background: #f4f6fb !important;
  color: var(--brand) !important;
  padding: 8px 12px !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  text-align: left !important;
  border-bottom: 1.5px solid var(--border) !important;
  position: static !important;
}

.app-inner-table td {
  padding: 9px 12px !important;
  border-bottom: 1px solid #f0f2f6 !important;
  vertical-align: middle !important;
  color: var(--ink-2) !important;
}

.app-inner-table tbody tr:hover td { background: #fef8f0 !important; }

/* Address side-by-side inside profile-section */
.app-address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.app-address-col {
  padding: 14px 18px;
}

.app-address-col + .app-address-col {
  border-left: 1.5px solid var(--border);
}

.app-address-col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--brand);
  margin-bottom: 10px;
}

.app-address-row {
  display: flex;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 13.5px;
}

.app-address-row b {
  color: var(--ink-2);
  min-width: 90px;
  flex-shrink: 0;
}

.office-address-list {
  padding: 14px 18px;
}

.office-address-list .app-address-row b {
  min-width: 130px;
}

.office-address-list .app-address-row span {
  margin-left: 8px;
}

.app-category-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.app-category-badge {
  min-width: 172px;
  padding: 11px 16px;
  border-radius: 12px;
  text-align: center;
  color: #fff;
  background: linear-gradient(145deg, #0f4fa8 0%, #153f88 50%, #1e3a8a 100%);
  box-shadow: 0 10px 22px rgba(30, 58, 138, 0.22);
}

.app-category-label {
  font-size: 11px;
  letter-spacing: .9px;
  opacity: .72;
  text-transform: uppercase;
  font-weight: 700;
}

.app-category-value {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .3px;
}

.app-region-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.app-region-dot {
  color: #93a7d7;
}

/* Status timeline */
.status-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 6px 0;
}

.status-timeline-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0 12px;
  position: relative;
}

.status-timeline-item:not(:last-child) .status-tl-line {
  position: absolute;
  left: 17px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--border);
  z-index: 0;
}

.status-tl-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 10px;
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
}

.status-tl-dot.done   { background: #f0faf4; border: 2.5px solid #1a7f4e; color: #1a7f4e; }
.status-tl-dot.current{ background: #fef3e2; border: 2.5px solid var(--accent); color: var(--accent); }
.status-tl-dot.future { background: #f4f6fb; border: 2px solid var(--border); color: var(--muted); }
.status-tl-dot.rejected{ background: #fef2f2; border: 2.5px solid #dc2626; color: #dc2626; }

.status-tl-content {
  padding: 8px 0 18px;
}

.status-tl-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.status-tl-label.done    { color: #1a7f4e; }
.status-tl-label.current { color: #92400e; }
.status-tl-label.future  { color: var(--muted); }
.status-tl-label.rejected{ color: #dc2626; }

.status-tl-remark {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
  font-style: italic;
}

.status-tl-action {
  margin-top: 6px;
}

/* Compliance YES/NO chips */
.compliance-yes {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fef2f2;
  color: #dc2626;
  border: 1.5px solid #fca5a5;
  font-size: 12.5px;
  font-weight: 700;
}

.compliance-no {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #f0faf4;
  color: #1a7f4e;
  border: 1.5px solid #a7f3d0;
  font-size: 12.5px;
  font-weight: 700;
}

/* Payment section */
.txn-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 16px 18px;
}

.txn-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 3px;
}

.txn-field-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

/* Print */
@media print {
  .app-view-actions, .no-print { display: none !important; }
  .app-view-header { background: var(--brand) !important; -webkit-print-color-adjust: exact; }
  .profile-section { break-inside: avoid; }
}

@media (max-width: 700px) {
  .app-photo-banner { grid-template-columns: 1fr; }
  .app-address-grid { grid-template-columns: 1fr; }
  .app-address-col + .app-address-col { border-left: none; border-top: 1.5px solid var(--border); }
  .app-view-header { flex-direction: column; }
  .app-category-panel { align-items: center; }
  .form-submit-row { justify-content: flex-end !important; }
}

/* ============================================================
   FINAL THEME OVERRIDES (HEADER/FOOTER BARS)
   Keeps top/bottom bars consistent even if earlier rules differ.
   ============================================================ */
.header {
  background: linear-gradient(95deg, var(--brand) 0%, var(--brand-mid) 100%) !important;
  border-bottom: 3px solid var(--accent) !important;
}

.footer {
  background: linear-gradient(95deg, var(--brand) 0%, var(--brand-mid) 100%) !important;
  color: rgba(255,255,255,0.88) !important;
  border-top: 3px solid var(--accent) !important;
}

.app-view-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%) !important;
}

/* ============================================================
   FINAL GLOBAL THEME OVERRIDES (ALL PAGES - APP LAYOUT)
   ============================================================ */
body {
  background: linear-gradient(180deg, #edf4fb 0%, var(--bg) 62%, #f2f7fb 100%) !important;
  color: var(--ink) !important;
}

.container {
  background: transparent !important;
}

.card,
fieldset,
.admin-content-card,
.auth-card-small,
.builder-form,
.admin-data-table,
.table-scroll,
.profile-section {
  border-color: var(--border) !important;
}

.card,
fieldset,
.admin-content-card,
.auth-card-small,
.builder-form,
.profile-section {
  background: var(--card) !important;
}

.admin-data-table th,
table th {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-mid) 100%) !important;
  color: #fff !important;
  border-color: #0a2e52 !important;
}

.admin-data-table td,
table td {
  border-color: #c9d6e6 !important;
}

.container a {
  color: var(--brand);
}

/* Only text links should shift color on hover */
.container p a:hover,
.container li a:hover,
.container td a:hover,
.container small a:hover,
.container .error-msg a:hover,
.container .success-msg a:hover {
  color: var(--brand-mid) !important;
}

/* Keep contrast for button-style links */
.container a.button-link:hover,
.container a.doc-view-link:hover,
.container a.excel-link:hover,
.container a.admin-qr-open-link:hover,
.container a.pay-qr-link:hover,
.container .app-view-actions a:hover,
.container a[style*="background"]:hover {
  color: #fff !important;
}

.header a:hover,
.footer a:hover,
.app-view-header a:hover {
  color: #fff !important;
  opacity: 0.9;
}

button,
.button-link,
.btn,
input[type="submit"] {
  border-color: transparent !important;
}

button,
input[type="submit"] {
  background: var(--brand) !important;
  color: #fff !important;
}

button.secondary {
  background: #e9f1fb !important;
  color: #16324d !important;
  border: 1px solid #c4d6ea !important;
}

input,
select,
textarea {
  border-color: #c7d5e6 !important;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-mid) !important;
  box-shadow: 0 0 0 3px rgba(13, 59, 102, 0.12) !important;
}

/* ============================================================
   FINAL SIDEBAR MENU OVERRIDES (ADMIN + USER MENU)
   Prevent global link colors from reducing sidebar contrast.
   ============================================================ */
.admin-menu,
.admin-shell .admin-menu {
  background: linear-gradient(180deg, var(--brand) 0%, #0b2e50 100%) !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
}

.admin-menu h3,
.admin-menu .menu-group-title {
  color: #e7f2ff !important;
}

.admin-menu a,
.admin-menu .admin-nav a {
  color: #f3f8ff !important;
}

.admin-menu a:hover,
.admin-menu .admin-nav a:hover {
  color: #ffffff !important;
  background: rgba(255,255,255,0.16) !important;
}

.admin-menu a.active,
.admin-menu .admin-nav a.active {
  color: #112b45 !important;
  background: var(--accent) !important;
}

/* ============================================================
   TARGETED HOVER FIXES (VIEW-APPLICATION + REGISTRATION)
   ============================================================ */
.app-view-header a,
.app-view-actions a {
  color: #ffffff !important;
}

.app-view-header a:hover,
.app-view-actions a:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.24) !important;
}

.builder-page .builder-form a,
.builder-page .builder-form p a,
.builder-page .builder-form small a {
  color: var(--brand) !important;
}

.builder-page .builder-form a:hover,
.builder-page .builder-form p a:hover,
.builder-page .builder-form small a:hover {
  color: var(--brand-mid) !important;
  text-decoration: underline;
}

.builder-page .builder-form button:hover,
.builder-page .builder-form .submit-registration-btn:hover {
  filter: brightness(0.94);
}

.verify-cert-frame{width:100%;height:70vh;border:1px solid #d1d5db;border-radius:8px;background:#fff;}

.verify-cert-layout{display:grid;grid-template-columns:minmax(280px,340px) 1fr;gap:16px;align-items:start;}
.verify-cert-form{display:flex;flex-direction:column;gap:10px;align-items:stretch;}
.verify-cert-input-wrap{display:flex;flex-direction:column;gap:6px;}
.verify-cert-preview-panel{min-height:520px;}
.verify-cert-placeholder{min-height:520px;display:flex;align-items:center;justify-content:center;border:1px solid #d1d5db;border-radius:8px;color:#6b7280;background:#fafafa;padding:16px;text-align:center;}
.verify-cert-frame{width:100%;min-height:520px;height:70vh;border:1px solid #d1d5db;border-radius:8px;background:#fff;}
@media (max-width: 900px){.verify-cert-layout{grid-template-columns:1fr;}.verify-cert-preview-panel,.verify-cert-placeholder,.verify-cert-frame{min-height:420px;height:60vh;}}

.verify-cert-shell{max-width:1240px;margin:24px auto;padding:0 16px;}
.verify-cert-card{width:100%;}
.verify-cert-layout{display:grid;grid-template-columns:1fr;gap:16px;align-items:start;}
.verify-cert-layout.has-preview{grid-template-columns:minmax(320px,380px) minmax(0,1fr);}
.verify-cert-form{display:flex;flex-direction:column;gap:10px;align-items:stretch;}
.verify-cert-input-wrap{display:flex;flex-direction:column;gap:6px;}
.verify-cert-preview-panel{min-width:0;}
.verify-cert-frame{display:block;width:100%;height:72vh;min-height:560px;border:1px solid #d1d5db;border-radius:8px;background:#fff;}
@media (max-width:900px){.verify-cert-shell{padding:0 12px;}.verify-cert-layout.has-preview{grid-template-columns:1fr;}.verify-cert-frame{height:60vh;min-height:420px;}}

/* Global form field spacing standardization */
form {
  --field-gap-y: 14px;
  --field-gap-x: 16px;
  --field-label-gap: 6px;
}

form label {
  margin-top: 0;
  margin-bottom: var(--field-label-gap);
}

form input + label,
form select + label,
form textarea + label {
  margin-top: var(--field-gap-y);
}

form input,
form select,
form textarea {
  margin-top: 0;
  margin-bottom: 0;
}

form .grid.two {
  row-gap: var(--field-gap-y);
  column-gap: var(--field-gap-x);
}

form .form-row,
form .field-row,
form .input-row {
  margin-bottom: var(--field-gap-y);
}

form .actions,
form .form-actions,
form .form-submit-row,
form .btn-row {
  margin-top: 18px;
}

/* Address sections in registration forms */
form .address-block .inline-checkbox {
  margin: 0 0 var(--field-gap-y) 0;
}

form .address-block .address-header {
  margin-bottom: var(--field-label-gap);
}

.approve-popup-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1000;
  padding: 16px;
  overflow: auto;
}

.modal-hidden{
  display: none;
}

.approve-popup-card{
  width: min(760px, calc(100vw - 32px));
  margin: 24px auto;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.approve-popup-title{
  margin-top: 0;
}

.approve-popup-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.approve-popup-grid label{
  display: block;
  margin-bottom: 6px;
}

.approve-popup-grid input[type="text"],
.approve-popup-grid input[type="date"],
.approve-popup-grid input[type="file"]{
  width: 100%;
}

.approve-popup-full-width{
  grid-column: 1 / -1;
}

.approve-popup-actions{
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

@media (max-width: 720px){
  .approve-popup-card{
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    margin: 10px auto;
  }
  .approve-popup-grid{
    grid-template-columns: 1fr;
  }
}

