/* =========================================================
   Merged stylesheet — base app styles + admin dashboard.
   (formerly styles.css + admin.css)
   Base tokens are defined first so admin rules can consume them.
   ========================================================= */

/* =========================================================
   DOFE Complaint System — Centralized Stylesheet
   Tokens from design-system.md; primary = blue-600 (#1560bd)
   ========================================================= */

/* ---------- Raw tokens ---------- */
:root {
  /* Brand reds */
  --red-500: #ce0000;
  --red-600: #b30000;
  --red-400: #dc143c;

  /* Greens */
  --green-700: #1b5e20;
  --green-500: #388e3c;
  --green-400: #4caf50;

  /* Blues */
  --blue-600: #1560bd;
  --blue-500: #1e5fcc;
  --blue-700: #0f4a91;

  /* Earth tones */
  --gold-500: #c9a227;
  --gold-600: #b8902b;

  /* Neutrals */
  --white:    #ffffff;
  --gray-50:  #f7f7f8;
  --gray-100: #ececef;
  --gray-200: #dfe1e6;
  --gray-300: #c9ccd3;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #141518;
  --black:    #000000;
}

/* ---------- Semantic tokens (main theme = BLUE) ---------- */
:root {
  /* Brand — primary BLUE per user instruction */
  --color-primary:        var(--blue-600);
  --color-primary-hover:  var(--blue-700);
  --color-primary-soft:   #e8f0fa;
  --color-primary-ink:    var(--blue-700);

  --color-secondary:      var(--red-500);
  --color-secondary-hover: var(--red-600);
  --color-secondary-soft: #fde9e9;
  --color-secondary-ink:  var(--red-600);

  --color-accent:         var(--gold-500);
  --color-accent-hover:   var(--gold-600);
  --color-accent-soft:    #fbf3d8;
  --color-accent-ink:     #6b5210;

  --color-success:        var(--green-500);
  --color-success-soft:   #e3f1e4;
  --color-warning:        var(--gold-500);
  --color-danger:         var(--red-400);
  --color-danger-soft:    #fde9ed;

  /* Surfaces */
  --color-bg:             var(--white);
  --color-surface:        var(--white);
  --color-surface-alt:    var(--gray-50);
  --color-border:         var(--gray-200);
  --color-border-strong:  var(--gray-300);

  /* Text */
  --color-text:           var(--gray-900);
  --color-text-muted:     var(--gray-500);
  --color-text-soft:      var(--gray-500);
  --color-text-inverse:   var(--white);

  /* Structural — header is BLUE per user instruction */
  --color-header-bg:      var(--color-primary);
  --color-header-text:    var(--white);
  --color-footer-bg:      var(--gray-900);
  --color-footer-text:    var(--gray-100);

  /* Spacing */
  --space-1: 0.25rem; --space-2: 0.5rem;  --space-3: 0.75rem;
  --space-4: 1rem;    --space-6: 1.5rem;  --space-8: 2rem;
  --space-12: 3rem;   --space-16: 4rem;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.15);

  /* Typography */
  --font-sans: "Mukta", "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-sm: 0.875rem; --text-base: 1rem; --text-lg: 1.125rem;
  --text-xl: 1.5rem;   --text-2xl: 2rem;  --text-3xl: 2.25rem;
  --leading: 1.6;

  /* Layout */
  --container: 1200px;
  --header-h: 64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-base);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

p { margin: 0; }
a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover { color: var(--color-primary-hover); text-decoration: underline; }

button { font-family: inherit; }

/* Keep page-level back navigation in a consistent top-right position. */
.page-back-button {
  display: table;
  margin-left: auto;
  order: 999;
}

.page-title > div:only-child:has(.page-back-button) {
  width: 100%;
}

/* ---------- App Shell ---------- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: var(--color-header-bg);
  color: var(--color-header-text);
  border-bottom: 1px solid var(--color-border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.app-header .brand-text strong,
.app-header .brand-text span {
  color: var(--color-header-text);
}

.app-header .brand-text span {
  opacity: 0.85;
}

.app-header .user-pill {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  color: var(--color-header-text);
}

.app-header .user-pill .user-avatar {
  background: white;
  color: var(--color-primary);
}

.app-header .btn-ghost {
  color: var(--color-header-text);
}

.app-header .btn-ghost:hover {
  background: rgba(255,255,255,0.15);
  color: var(--color-header-text);
}

.app-header .brand-mark {
  background: white;
  border-color: rgba(255,255,255,0.4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 3px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 15px;
  color: var(--color-text);
}

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

.brand-text .brand-gov { font-size: 11px; }
.brand-text .brand-dept { font-size: 12px; font-weight: 600; color: var(--color-text); }
.brand-text .brand-sys { font-size: 14px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 14px;
  color: var(--color-header-text);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--white);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.app-main {
  flex: 1;
  padding: 32px;
}

.app-footer {
  border-top: 1px solid var(--color-border);
  padding: 16px 32px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
  background: var(--color-surface);
}

/* ---------- Auth Pages (centered card) ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-aside {
  background: var(--color-primary);
  color: white;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

/* Soft decorative glow behind the brand column */
.auth-aside {
  justify-content: center;
  overflow: hidden;
}
.auth-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(closest-side at 50% 12%, oklch(1 0 0 / 0.14), transparent 70%),
    radial-gradient(closest-side at 85% 95%, oklch(1 0 0 / 0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.auth-aside-content {
  position: relative;
  z-index: 1;
}

/* Centered brand hierarchy on the auth aside */
.auth-brand-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Logo badge — white disc with a soft ring/glow */
.auth-brand-stack .brand-badge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 1px oklch(1 0 0 / 0.35),
    0 0 0 10px oklch(1 0 0 / 0.10),
    0 18px 40px oklch(0 0 0 / 0.25);
  margin-bottom: 22px;
}
.auth-brand-stack .brand-badge img {
  width: 74%;
  height: 74%;
  object-fit: contain;
  display: block;
}

.auth-brand-stack .brand-org {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.auth-brand-stack .brand-gov {
  color: oklch(1 0 0 / 0.8);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.auth-brand-stack .brand-ministry {
  color: oklch(1 0 0 / 0.92);
  font-size: 15px;
  font-weight: 500;
}
.auth-brand-stack .brand-dept {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

/* Gold accent divider */
.auth-brand-stack .brand-divider {
  width: 56px;
  height: 3px;
  border-radius: 999px;
  margin: 18px 0;
  background: linear-gradient(90deg, var(--color-accent), oklch(1 0 0 / 0.6));
}

.auth-brand-stack .brand-sys {
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.3px;
  max-width: 20ch;
}

.auth-aside h1 {
  font-size: 26px;
  color: #fff;
  margin-top: 26px;
  letter-spacing: -0.4px;
  max-width: 22ch;
}

.auth-aside .lede {
  margin-top: 14px;
  color: oklch(1 0 0 / 0.82);
  font-size: 15px;
  line-height: 1.7;
  max-width: 44ch;
}

.auth-aside-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  z-index: 1;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: oklch(1 0 0 / 0.7);
}

.auth-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--color-bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card h2 {
  font-size: 26px;
  margin-bottom: 4px;
}

.auth-card .auth-sub {
  color: var(--color-text-muted);
  margin-bottom: 28px;
  font-size: 14px;
}

.auth-foot-link {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
}

@media (max-width: 880px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { padding: 40px 28px; min-height: auto; }
  .auth-brand-stack .brand-badge { width: 78px; height: 78px; margin-bottom: 18px; }
  .auth-brand-stack .brand-sys { font-size: 21px; }
  .auth-aside h1 { font-size: 22px; margin-top: 20px; }
  .auth-aside-foot { display: none; }
}

/* =========================================================
   Login page — brand column (left) + login form (right).
   Best-practice type scale; scoped to .login-* / .lb-* / .lf-*.
   ========================================================= */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(55rem 38rem at -8% -12%, var(--color-primary-soft), transparent 60%),
    radial-gradient(45rem 38rem at 108% 112%, #fbeef0, transparent 55%),
    var(--color-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vh, 34px) clamp(12px, 3vw, 34px);
}
.login-card {
  width: 100%;
  max-width: 1080px;
  margin: auto;                   /* centers; page scrolls if taller than screen (no clipping) */
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 28px 70px oklch(0 0 0 / 0.10);
}

/* ---- Left: brand column (fluid: scales with viewport height) ---- */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 2px;
  padding: clamp(24px, 5vh, 56px) clamp(24px, 4vw, 52px);
  background: linear-gradient(180deg, #fafbfc 0%, #f4f6f9 100%);
  border-right: 1px solid var(--color-border);
  overflow: hidden;
}
.login-brand .lb-emblem {
  width: clamp(58px, 12vh, 108px);
  height: clamp(58px, 12vh, 108px);
  object-fit: contain;
  margin-bottom: clamp(12px, 2.4vh, 24px);
}
.login-brand .lb-gov {
  font-size: clamp(12px, 1.5vh, 15px);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.login-brand .lb-ministry {
  font-size: clamp(14px, 1.8vh, 17px);
  font-weight: 500;
  color: var(--color-text);
  margin-top: 5px;
}
.login-brand .lb-dept {
  font-size: clamp(16px, 2.3vh, 21px);
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 5px;
}
.login-brand .lb-divider {
  width: clamp(48px, 6vh, 64px);
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
  margin: clamp(12px, 2.4vh, 24px) 0;
}
.login-brand .lb-system {
  font-size: clamp(19px, 2.9vh, 27px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.3px;
  color: var(--color-text);
  max-width: 20ch;
}
.login-brand .lb-tagline {
  font-size: clamp(15px, 2.1vh, 20px);
  font-weight: 600;
  color: var(--color-primary-ink, var(--color-primary));
  margin-top: clamp(12px, 2vh, 20px);
}
.login-brand .lb-desc {
  font-size: clamp(13px, 1.7vh, 16px);
  line-height: 1.7;
  color: var(--color-text-muted);
  max-width: 40ch;
  margin: clamp(10px, 1.6vh, 16px) 0 0;
}

/* ---- Right: login form (fluid) ---- */
.login-form-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vh, 56px) clamp(24px, 4vw, 56px);
  overflow: hidden;
}
.login-form-inner { width: 100%; max-width: 400px; }
.lf-title {
  font-size: clamp(22px, 3.2vh, 30px);
  font-weight: 800;
  color: var(--color-text);
  margin: 0 0 6px;
}
.lf-sub {
  font-size: clamp(13.5px, 1.8vh, 15.5px);
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0 0 clamp(18px, 3vh, 30px);
}
.lf-field { display: flex; flex-direction: column; gap: clamp(5px, 1vh, 8px); margin-bottom: clamp(12px, 2.2vh, 20px); }
.lf-field label { font-size: clamp(13px, 1.7vh, 15px); font-weight: 600; color: var(--color-text); }
.lf-hint { font-size: 12px; color: var(--color-text-muted); }
.lf-field input {
  height: clamp(44px, 6.2vh, 52px);
  width: 100%;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 0 16px;
  font-size: clamp(14px, 1.9vh, 16px);
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lf-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.lf-field input.has-error { border-color: var(--color-danger); background: var(--color-danger-soft); }

/* password reveal */
.input-eye { position: relative; }
.input-eye input { padding-right: 52px; }
.eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 8px;
}
.eye-btn svg { width: 20px; height: 20px; }
.eye-btn:hover { color: var(--color-primary); background: var(--color-primary-soft); }
.eye-btn.is-on { color: var(--color-primary); }

.lf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: clamp(4px, 1vh, 6px) 0 clamp(16px, 3vh, 28px);
  font-size: clamp(13px, 1.7vh, 15px);
}
.lf-row .checkbox { font-size: clamp(13px, 1.7vh, 15px); color: var(--color-text); }
.lf-link { font-size: clamp(13px, 1.7vh, 15px); color: var(--color-primary); text-decoration: none; }
.lf-link:hover { text-decoration: underline; }

.lf-submit {
  width: 100%;
  height: clamp(46px, 6.4vh, 54px);
  font-size: clamp(15px, 2vh, 17px);
  font-weight: 700;
}
.lf-signup {
  margin: clamp(14px, 2.4vh, 24px) 0 0;
  text-align: center;
  font-size: clamp(13.5px, 1.8vh, 15.5px);
  color: var(--color-text-muted);
}

/* Tablet & below: stack the brand over the form in one column */
@media (max-width: 900px) {
  .login-page { align-items: flex-start; }
  .login-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    max-width: 480px;
  }
  .login-brand {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .login-form-inner { max-width: 100%; margin: 0 auto; }
}

/* Small phones: keep the brand compact and let the remember/forgot row wrap */
@media (max-width: 480px) {
  .login-brand .lb-desc { display: none; }
  .lf-row { flex-wrap: wrap; gap: 6px 12px; }
}

/* Very short viewports (landscape phones): trim optional lines */
@media (max-height: 560px) {
  .login-brand .lb-desc,
  .lf-sub { display: none; }
  .login-brand .lb-divider { margin: 10px 0; }
}

@media (max-width: 880px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { padding: 40px 28px; min-height: auto; }
  .auth-brand-stack .brand-badge { width: 78px; height: 78px; margin-bottom: 18px; }
  .auth-brand-stack .brand-sys { font-size: 21px; }
  .auth-aside h1 { font-size: 22px; margin-top: 20px; }
  .auth-aside-foot { display: none; }
}

/* ---------- Form fundamentals ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-column: span 12;
}

.field.col-6 { grid-column: span 6; }
.field.col-4 { grid-column: span 4; }
.field.col-3 { grid-column: span 3; }
.field.col-8 { grid-column: span 8; }

@media (max-width: 720px) {
  .field.col-6,
  .field.col-4,
  .field.col-3,
  .field.col-8 { grid-column: span 12; }
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.field .req {
  color: var(--color-danger);
  margin-left: 2px;
}

.field .hint {
  display: none;
}

.field .error-text {
  font-size: 12px;
  color: var(--color-danger);
  display: none;
}

.field.has-error .error-text { display: block; }

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
}

.input-error {
  border-color: var(--color-danger) !important;
  background: var(--color-danger-soft) !important;
}

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

.checkbox-grid .checkbox {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--color-surface);
}

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

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

input[readonly] {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.checkbox,
.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.checkbox input,
.radio input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-group label {
  flex: 1;
  min-width: 140px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  background: var(--color-surface);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.radio-group label:hover {
  border-color: var(--color-primary);
}

.radio-group label.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary-ink);
}

.multi-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  min-height: 44px;
}

.multi-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.multi-chip:hover { border-color: var(--color-primary); }

.multi-chip.is-selected {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-accent-soft);
}

.multi-chip.is-selected::after {
  content: "✓";
  font-size: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-text-inverse);
  text-decoration: none;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-surface-alt);
  color: var(--color-text);
  text-decoration: none;
}

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

.btn-danger:hover:not(:disabled) {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
  text-decoration: none;
}

.btn-block { width: 100%; }

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ndp-ghost-start { color: transparent !important; }

.consent-row {
  margin: 20px 0 4px;
  padding: 14px 18px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md, 8px);
}
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #166534;
  font-weight: 500;
  line-height: 1.5;
}
.consent-label input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #16a34a;
}

.btn-remove {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: #fee2e2;
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-remove:hover {
  background: #dc2626;
  color: #fff;
}

/* ---------- Card / Panel ---------- */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border);
}

.panel-header h2 {
  font-size: 18px;
}

.panel-body { padding: 24px; }

/* ---------- Accordion ---------- */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accordion-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.accordion-section.is-open {
  border-color: var(--color-primary);
  overflow: visible;
  position: relative;
  z-index: 1;
}

.accordion-section.is-open:focus-within {
  z-index: 20;
}

.accordion-section.has-section-error {
  border-color: var(--color-danger, #dc2626);
}
.accordion-section.has-section-error .accordion-trigger {
  background: color-mix(in srgb, var(--color-danger, #dc2626) 5%, transparent);
}
.accordion-section.has-section-error .accordion-title::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-danger, #dc2626);
  margin-left: 10px;
  flex-shrink: 0;
  animation: pulse-dot 1.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  text-align: left;
}

.accordion-trigger:hover {
  background: var(--color-surface-alt);
}

.accordion-num {
  display: none;
}

.accordion-title {
  flex: 1;
  display: flex;
  align-items: center;
}

.accordion-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  transition: all 0.2s;
}

.accordion-section.is-open .accordion-toggle {
  background: var(--color-primary);
  color: white;
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 24px;
  border-top: 0 solid transparent;
  transition:
    max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    border-top-color 0.32s linear;
}

.accordion-section.is-open .accordion-body {
  overflow: visible;
  padding: 24px;
  border-top: 1px solid var(--color-border);
}

.accordion-body > * + * { margin-top: 0; }

.section-help {
  background: var(--color-primary-soft);
  border-left: 3px solid var(--color-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text);
  margin-bottom: 20px;
}

/* ---------- Repeater ---------- */
.repeater {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.repeater-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-alt);
  padding: 24px;
  position: relative;
}

.repeater-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.repeater-item-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text);
}

.repeater-add {
  align-self: flex-start;
  margin-top: 20px;
}

/* ---------- Table ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  background: var(--color-surface-alt);
  font-weight: 700;
  font-size: 13px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.data-table tbody tr:hover {
  background: var(--color-surface-alt);
}

/* Claim amount (दाबी रकम) table — grouped columns with visible vertical borders */
#claimTable th,
#claimTable td {
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}
/* Centre-align headers incl. the रकम जम्मा गर्ने / रकम प्राप्त गर्ने group titles */
#claimTable thead th {
  text-align: center;
}

.datatable-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--color-border);
  background: #fafafa;
  flex-wrap: wrap;
}
.datatable-search { min-width: min(220px, 100%); }
.datatable-search .form-control {
  width: 100%;
  font-size: 13px;
  padding: 6px 10px;
  background: #fff;
}
.datatable-length {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}
.datatable-length .form-control {
  width: auto;
  min-width: 70px;
  padding: 5px 8px;
  font-size: 12px;
}
.datatable-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.datatable-info {
  font-size: 12.5px;
  color: var(--color-text-muted);
}
.datatable-pages {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.datatable-sort {
  cursor: pointer;
  user-select: none;
  position: relative;
}
.datatable-sort::after {
  content: "↕";
  margin-left: 6px;
  font-size: 10px;
  color: var(--color-text-muted);
}
.datatable-sort[data-sort="asc"]::after { content: "↑"; color: var(--color-primary); }
.datatable-sort[data-sort="desc"]::after { content: "↓"; color: var(--color-primary); }

.claim-row td input {
  font-size: 13px;
  padding: 8px 10px;
}

.claim-total {
  background: var(--color-primary-soft) !important;
  font-weight: 700;
  color: var(--color-primary-ink);
}

/* Document table row cells */
#documentsTable td .error-text {
  font-size: 12px;
  color: var(--color-danger);
  display: none;
}
#documentsTable td.has-error .error-text { display: block; }
#documentsTable td.has-error select,
#documentsTable td.has-error input {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
}
#documentsTable td select,
#documentsTable td input[type="file"] {
  font-size: 13px;
  padding: 8px 10px;
  width: 100%;
}

/* ---------- Stat cards (Dashboard) ---------- */
.page-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title h1 {
  font-size: 28px;
  letter-spacing: -0.4px;
}

.page-title .page-sub {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 8px;
  line-height: 1;
}

.stat-card .stat-meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-text-soft);
}

.cta-card {
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.cta-card h2 {
  color: white;
  font-size: 22px;
  margin-bottom: 6px;
}

.cta-card p {
  color: rgba(255,255,255,0.85);
  max-width: 56ch;
}

.cta-card .btn {
  background: white;
  color: var(--color-primary);
  border-color: white;
}

.cta-card .btn:hover {
  background: var(--gray-50);
  color: var(--color-primary-hover);
}

/* ---------- Checklist ---------- */
.checklist-wrap {
  max-width: 720px;
  margin: 0 auto;
}

.checklist-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 14px;
}

.checklist-question {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.checklist-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.checklist-question p {
  font-weight: 600;
  font-size: 15px;
}

.checklist-options {
  display: flex;
  gap: 10px;
  margin-left: 44px;
  flex-wrap: wrap;
}

.checklist-options label {
  flex: 1;
  min-width: 140px;
}

.progress-bar {
  height: 6px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-primary);
  width: 0;
  transition: width 0.3s ease;
}

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success {
  background: var(--color-success-soft);
  color: oklch(0.32 0.10 150);
  border: 1px solid oklch(0.78 0.10 150);
}

.alert-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border: 1px solid oklch(0.78 0.14 25);
}

.alert-info {
  background: var(--color-primary-soft);
  color: var(--color-primary-ink);
  border: 1px solid oklch(0.82 0.06 230);
}

.alert-icon { font-weight: 700; }

/* ---------- Institutional complaint form compatibility ---------- */
.alert-box {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-box:not(:empty) {
  display: block;
}

.alert-error {
  background: var(--color-danger-soft);
  border: 1px solid oklch(0.78 0.14 25);
  color: var(--color-danger);
}

.form-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.form-section:first-of-type,
.form-section:hover {
  border-color: var(--color-primary);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 24px;
  background: transparent;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.section-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.section-body {
  padding: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-bottom: 16px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row.cols-2 > .form-group { grid-column: span 6; }
.form-row.cols-3 > .form-group { grid-column: span 4; }
.form-row.cols-4 > .form-group { grid-column: span 3; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.form-control,
.form-select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.entry-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-alt);
  margin-bottom: 16px;
  overflow: hidden;
}

.entry-block-header {
  background: var(--color-primary-soft);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-primary-ink);
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
}

.entry-body {
  padding: 24px;
}

.type-toggle {
  display: inline-flex;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--color-surface);
}

.type-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-toggle label {
  padding: 8px 14px;
  border-right: 1px solid var(--color-border-strong);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.type-toggle label:last-child {
  border-right: 0;
}

.type-toggle input:checked + label {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.address-subsection {
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 14px;
  background: var(--color-surface-alt);
}

.address-subsection-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary-ink);
  margin-bottom: 12px;
}

.nature-list,
.doc-rows-container {
  display: grid;
  gap: 10px;
}

.complaint-detail-textarea {
  min-height: 140px;
}

.info-text {
  background: var(--color-primary-soft);
  border: 1px solid oklch(0.82 0.06 230);
  border-radius: var(--radius-md);
  color: var(--color-primary-ink);
  font-size: 14px;
  padding: 12px 14px;
}

.add-entry-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
}

.add-entry-btn:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

@media (max-width: 880px) {
  .form-row.cols-2 > .form-group,
  .form-row.cols-3 > .form-group,
  .form-row.cols-4 > .form-group {
    grid-column: span 12;
  }
}

/* ---------- Form actions bar ---------- */
.form-actions {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 24px;
  box-shadow: var(--shadow-sm);
}

.form-actions-spacer { flex: 1; min-width: 8px; }

.btn-action {
  gap: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
}

.btn-action svg { flex-shrink: 0; opacity: 0.9; }

.btn-action-primary {
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(21, 96, 189, 0.25);
}

.btn-action-primary svg { opacity: 1; }

@media (max-width: 720px) {
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .form-actions-spacer { display: none; }
  .btn-action { width: 100%; justify-content: center; }
}

.form-actions .left {
  margin-right: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Success page ---------- */
.success-wrap {
  max-width: 560px;
  margin: 80px auto;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-success-soft);
  color: var(--color-success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 20px;
}

.ref-box {
  display: inline-block;
  padding: 12px 24px;
  background: var(--color-primary-soft);
  color: var(--color-primary-ink);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  margin: 16px 0 24px;
  letter-spacing: 1px;
  border: 1px solid var(--color-border);
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(0.2 0.01 270 / 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10000;
}

.modal-backdrop.is-open { display: flex; }

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal h3 { font-size: 18px; margin-bottom: 8px; }
.modal p { color: var(--color-text-muted); margin-bottom: 20px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---- Nepali Date Picker (sajanmaharjan/nepali-date-picker v5) ---- */
.ndp-picker-wrap { position: relative; display: block; }

.ndp-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  font-size: 14px;
  background: var(--color-bg, #fff);
  color: var(--color-text, #111827);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
  cursor: pointer;
}
.ndp-input:focus, .ndp-input:hover { border-color: var(--color-primary, #1560bd); }

.ndp-readonly { background: var(--color-surface, #f9fafb) !important; cursor: default; }

/* ── Preview modal (redesigned) ─────────────────────────────────────────── */
.pv-open { overflow: hidden; }

.pv-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: #f3f4f8;
  display: flex; align-items: stretch; justify-content: stretch;
}

.pv-shell {
  width: 100%; height: 100vh;
  display: flex; flex-direction: column;
  background: #f3f4f8;
}

/* Header bar */
.pv-header {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pv-header-inner { display: flex; align-items: center; gap: 14px; }
.pv-header-icon {
  width: 42px; height: 42px;
  background: #eef2ff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #4f46e5;
  flex-shrink: 0;
}
.pv-header-title { font-size: 18px; font-weight: 700; color: #111827; line-height: 1.3; }
.pv-header-sub   { font-size: 13px; color: #6b7280; margin-top: 2px; }
.pv-header-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* Scrollable body */
.pv-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.pv-footer {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 14px 24px;
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.06);
}

.pv-footer-actions {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Form wrapper */
.pv-form {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Section card */
.pv-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.pv-section-head {
  background: #e8f0fe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 14px;
  padding: 9px 14px;
  border-bottom: 1px solid #c7d8fc;
  letter-spacing: 0.01em;
}
.pv-section-body {
  padding: 10px 14px;
}

.pv-section-body .form-grid,
.pv-card-body.form-grid {
  gap: 8px 14px;
}

/* Sub-heading inside a section (for address blocks) */
.pv-sub-head {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  padding: 8px 0 2px;
  border-top: 1px dashed #e5e7eb;
  margin-top: 2px;
}
.pv-sub-head:first-child { border-top: none; margin-top: 0; padding-top: 0; }

/* Individual field */
.pv-field { padding: 2px 0; }
.pv-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.pv-value {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  word-break: break-word;
}
.pv-value.pv-multiline { white-space: pre-wrap; line-height: 1.45; }
.pv-check        { color: #6b7280; font-size: 13px; }
.pv-check--yes   { color: #16a34a; font-weight: 600; }

/* Column spans for pv-* children of form-grid */
.form-grid > .pv-card,
.form-grid > .pv-sub-head,
.form-grid > .pv-table-wrap,
.form-grid > .pv-field     { grid-column: span 12; }

.form-grid > .pv-field.col-6  { grid-column: span 6; }
.form-grid > .pv-field.col-4  { grid-column: span 4; }
.form-grid > .pv-field.col-3  { grid-column: span 3; }
.form-grid > .pv-field.col-8  { grid-column: span 8; }

@media (max-width: 720px) {
  .form-grid > .pv-field.col-6,
  .form-grid > .pv-field.col-4,
  .form-grid > .pv-field.col-3,
  .form-grid > .pv-field.col-8 { grid-column: span 12; }
}

/* Dividers between fields inside the grid */
.pv-section-body .form-grid > .pv-field + .pv-field {
  border-top: none;
}

/* Person / entity card inside a section */
.pv-card {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.pv-card:last-child { margin-bottom: 0; }
.pv-card-head {
  background: #f1f5f9;
  color: #374151;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 12px;
  border-bottom: 1px solid #e5e7eb;
}
.pv-card-body { padding: 8px 12px; }

/* Table inside preview */
.pv-table-wrap { overflow-x: auto; }
.pv-table { min-width: 760px; }

/* Responsive */
@media (max-width: 720px) {
  .pv-header        { padding: 12px 16px; flex-direction: column; align-items: flex-start; }
  .pv-header-actions { width: 100%; }
  .pv-header-actions .btn { flex: 1; justify-content: center; }
  .pv-body          { padding: 12px; }
  .pv-footer        { padding: 12px; }
  .pv-footer-actions { flex-direction: column; align-items: stretch; }
  .pv-footer-actions .form-actions-spacer { display: none; }
  .pv-footer-actions .btn { width: 100%; justify-content: center; }
}

/* ---- Office selection modal ---- */
.ndp-office-modal { max-width: 520px; max-height: 70vh; display: flex; flex-direction: column; }
.ndp-office-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.ndp-office-item {
  padding: 12px 16px;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ndp-office-item:hover { border-color: var(--color-primary, #1560bd); background: color-mix(in srgb, var(--color-primary, #1560bd) 6%, transparent); }
.ndp-office-item.selected { border-color: var(--color-primary, #1560bd); background: color-mix(in srgb, var(--color-primary, #1560bd) 10%, transparent); }
.ndp-office-name { font-weight: 600; font-size: 15px; display: block; }
.ndp-office-item small { color: var(--color-text-muted); font-size: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-text);
  color: var(--color-bg);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  pointer-events: none;
  z-index: 2000;
  max-width: 360px;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--success { background: #16a34a; color: #fff; }
.toast--error   { background: #dc2626; color: #fff; }
.toast--warning { background: #d97706; color: #fff; }

/* ---------- Utility ---------- */
.text-muted { color: var(--color-text-muted); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-gap { gap: 12px; }
.section-divider {
  height: 1px;
  background: var(--color-border);
  margin: 16px 0;
}

.field-grid-title {
  grid-column: span 12;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-top: 4px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--color-border);
}

/* ---------- Highlighted Add Complaint CTA ---------- */
.cta-card-highlight {
  position: relative;
}

.cta-content { flex: 1; }

.cta-badge {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.btn-cta {
  background: white;
  color: var(--color-primary);
  border: 1px solid white;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-cta:hover {
  background: var(--gray-50);
  color: var(--color-primary-hover);
  text-decoration: none;
}

.cta-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

/* ---------- Dashboard menu (complaint types) ---------- */
.menu-section {
  margin-bottom: 28px;
}

.menu-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.menu-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: var(--color-text);
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.menu-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--color-text);
}

.menu-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.menu-card h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.menu-card p {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.55;
  flex: 1;
}

.menu-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
}

.menu-card .menu-card-arrow {
  transition: transform 0.15s;
}

.menu-card:hover .menu-card-arrow {
  transform: translateX(4px);
}

.menu-card-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px 12px 14px;
  background: var(--color-primary);
  color: white;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  z-index: 100;
  transition: background 0.15s;
  box-shadow: var(--shadow-md);
}

.fab:hover {
  background: var(--color-primary-hover);
  text-decoration: none;
  color: white;
}

.fab-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: white;
  color: var(--color-primary);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

/* ---------- Complaint Date row (top of form) ---------- */
.complaint-date-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 20px;
  font-size: 14px;
  color: var(--color-text);
}

.complaint-date-row label {
  font-weight: 600;
  color: var(--color-text);
}

.complaint-date-row input[type="date"] {
  width: auto;
  min-width: 170px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
}

/* =========================================================
   Responsive — consistent behaviour across every page
   Breakpoints: 768px (tablet/phone) · 480px (small phone)
   ========================================================= */

/* Make every data table scroll horizontally instead of crushing */
.panel-body,
#complaintsList {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  /* Layout padding */
  .app-header { padding: 12px 16px; gap: 12px; }
  .app-main   { padding: 20px 16px; }
  .app-footer { padding: 14px 16px; }

  /* Header: hide system name + user name on mobile (clean, minimal) */
  .brand { gap: 10px; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .app-header .brand-text { display: none; }
  .header-actions { gap: 8px; }
  .user-pill { padding: 4px; gap: 0; }
  .user-pill > span { display: none; }

  /* Headings */
  .page-title { margin-bottom: 18px; }
  .page-title h1 { font-size: 22px; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }

  /* Accordion / panel density */
  .accordion-trigger { padding: 16px 18px; font-size: 15px; }
  .accordion-section.is-open .accordion-body,
  .accordion-body { padding-left: 18px; padding-right: 18px; }
  .accordion-section.is-open .accordion-body { padding-top: 18px; padding-bottom: 18px; }
  .panel-header { padding: 14px 16px; }
  .panel-body { padding: 16px; }

  /* Forms */
  .form-grid { gap: 14px; }
  .repeater-item { padding: 16px; }
  .repeater-item-head { margin-bottom: 16px; }
  .section-help { padding: 10px 14px; font-size: 12.5px; }

  /* Data tables: slightly tighter, keep readable while scrolling */
  .data-table th,
  .data-table td { padding: 8px 10px; }
  .data-table { font-size: 13px; }
  #complaintsList .data-table { min-width: 560px; }

  /* Complaint date row wraps */
  .complaint-date-row { flex-wrap: wrap; gap: 8px; }
  .complaint-date-row input[type="date"] { min-width: 150px; }

  /* FAB more compact */
  .fab { bottom: 18px; right: 16px; padding: 10px 16px 10px 12px; font-size: 13px; }
  .fab-plus { width: 22px; height: 22px; font-size: 16px; }

  /* CTA / menu cards */
  .cta-card { flex-direction: column; align-items: flex-start; padding: 22px; }
  .menu-card { padding: 20px; }

  /* Success page */
  .success-wrap { margin: 40px auto; padding: 32px 20px; }
  .success-icon { width: 64px; height: 64px; font-size: 32px; }
}

@media (max-width: 480px) {
  /* Hide the secondary English brand line to save room */
  .app-header .brand-text span { display: none; }

  .app-main { padding: 16px 12px; }
  .page-title h1 { font-size: 20px; }
  .page-title .page-sub { font-size: 13px; }

  /* Auth pages */
  .auth-aside { padding: 24px 20px; }
  .auth-pane { padding: 28px 18px; }
  .auth-card h2 { font-size: 22px; }

  /* Stack action buttons full width */
  .page-title > div:last-child .btn { width: 100%; }

  /* Radio cards stack */
  .radio-group label { min-width: 100%; }

  /* Tighter accordion toggle */
  .accordion-trigger { padding: 14px 14px; font-size: 14px; }
  .accordion-toggle { width: 24px; height: 24px; font-size: 16px; }
}

/* =========================================================
   ADMIN DASHBOARD STYLES (merged from admin.css)
   ========================================================= */

/* =========================================================
   Admin Dashboard — layout & components
   Reuses tokens/buttons/inputs/modal from styles.css
   Aesthetic: flat, white surfaces, subtle borders, sentence case
   ========================================================= */

:root {
  --admin-sidebar-w: 224px;
  --admin-bg: #f6f7f9;
  --neutral-soft: #eef0f3;
  --neutral-ink: #475467;
  --info-soft: #e8f0fa;
  --info-ink: #1560bd;
  --warn-soft: #fdf3d8;
  --warn-ink: #8a6d10;
  --success-soft: #e3f1e4;
  --success-ink: #2f7a34;
  --danger-soft: #fde7ea;
  --danger-ink: #c0203a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.admin {
  font-family: var(--font-sans);
  background: var(--admin-bg);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.admin .btn { font-size: 15px; }
body.admin .btn-sm { font-size: 14px; }
body.admin .data-table { font-size: 15px; }
body.admin .data-table th { font-size: 13px; }
body.admin .data-table th,
body.admin .data-table td { padding: 12px 14px; }
body.admin input,
body.admin select,
body.admin textarea { font-size: 16px; }

.admin-shell { display: flex; min-height: 100vh; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  width: var(--admin-sidebar-w);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--color-border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 60;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-border);
}
.sidebar-brand img { width: 34px; height: 34px; object-fit: contain; }
.sidebar-brand .sb-gov { font-size: 11.5px; color: var(--color-text-muted); line-height: 1.3; }
.sidebar-brand .sb-title { font-size: 15px; font-weight: 700; line-height: 1.25; }
.sidebar-brand .sb-sub { font-size: 12px; color: var(--color-text-muted); }

.sidebar-nav { padding: 10px 10px 24px; flex: 1; }
.nav-group-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-muted);
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--neutral-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: var(--neutral-soft); color: var(--color-text); }
.nav-item .nav-ico { width: 18px; height: 18px; flex-shrink: 0; color: currentColor; }
.nav-item .nav-text { flex: 1; }
.nav-item .nav-badge {
  min-width: 22px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--neutral-soft);
  color: var(--neutral-ink);
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-item.is-active {
  background: var(--info-soft);
  color: var(--info-ink);
  font-weight: 600;
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -10px; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--color-primary);
}
.nav-item.is-active .nav-badge {
  background: var(--color-primary);
  color: #fff;
}

/* submenu (Official / Normal users) */
.nav-parent-wrap { display: flex; flex-direction: column; }
.nav-parent .nav-chevron { margin-left: auto; width: 14px; height: 14px; transition: transform 0.15s; }
.nav-parent.is-expanded .nav-chevron { transform: rotate(90deg); }
.nav-sub { display: none; flex-direction: column; gap: 2px; margin: 2px 0 4px; }
.nav-sub.is-expanded { display: flex; }
.nav-item.is-child { padding-left: 40px; font-size: 14.5px; font-weight: 500; }

/* ---------------- Main ---------------- */
.admin-main {
  flex: 1;
  margin-left: var(--admin-sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar h1 { font-size: 21px; font-weight: 700; margin: 0; }
.topbar .topbar-sub { font-size: 14px; color: var(--color-text-muted); }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.role-switch { display: flex; align-items: center; gap: 8px; }
.role-switch label { font-size: 14px; color: var(--color-text-muted); }
.role-switch select {
  width: auto;
  padding: 7px 28px 7px 12px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
}
.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--info-soft);
  color: var(--info-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}

/* ── User menu (topbar) ──────────────────────────────────────────────────── */
.user-menu-wrap { position: relative; }

.user-menu-btn {
  display: flex; align-items: center; gap: 9px;
  background: none; border: 1px solid transparent;
  border-radius: 8px; padding: 4px 8px 4px 4px;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.user-menu-btn:hover { background: #f1f5f9; border-color: #e2e8f0; }

.user-menu-info {
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25;
}
.user-menu-name { font-size: 13px; font-weight: 600; color: #1e293b; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.user-menu-role { font-size: 11px; color: #64748b; }

.user-menu-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 280px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  z-index: 200;
  overflow: hidden;
}

/* Alpine transition classes */
.utm-enter        { transition: opacity .15s, transform .15s; }
.utm-enter-start  { opacity: 0; transform: translateY(-6px); }
.utm-enter-end    { opacity: 1; transform: translateY(0); }
.utm-leave        { transition: opacity .1s, transform .1s; }
.utm-leave-start  { opacity: 1; transform: translateY(0); }
.utm-leave-end    { opacity: 0; transform: translateY(-6px); }

.umd-profile {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px;
}
.umd-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: var(--info-soft); color: var(--info-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
}
.umd-name  { font-size: 14px; font-weight: 700; color: #111827; line-height: 1.3; }
.umd-email { font-size: 12px; color: #6b7280; margin-top: 2px; word-break: break-all; }
.umd-role-badge {
  display: inline-block; margin-top: 6px;
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 20px; letter-spacing: 0.02em;
}
.umd-role-admin { background: #eef2ff; color: #4338ca; }
.umd-role-staff { background: #ecfdf5; color: #059669; }

.umd-divider { height: 1px; background: #f1f5f9; margin: 0; }

.umd-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 16px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 500; color: #374151;
  text-decoration: none; transition: background .12s;
}
.umd-item:hover { background: #f8fafc; }
.umd-item-danger { color: #dc2626; }
.umd-item-danger:hover { background: #fff5f5; }

.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border: 1px solid var(--color-border);
  background: #fff; border-radius: var(--radius-md);
  cursor: pointer;
}

.view { padding: 24px; }
.view-section { margin-bottom: 26px; }
.section-title {
  font-size: 16px; font-weight: 700;
  margin: 0 0 14px;
}
.section-title .muted { font-weight: 500; color: var(--color-text-muted); font-size: 14px; }

/* ---------------- Cards ---------------- */
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.metric {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.metric .m-label { font-size: 14px; color: var(--color-text-muted); font-weight: 500; }
.metric .m-value { font-size: 32px; font-weight: 700; margin-top: 6px; line-height: 1; }
.metric .m-meta { font-size: 14px; color: var(--color-text-muted); margin-top: 8px; }
.metric.is-alert {
  background: var(--danger-soft);
  border-color: #f3c2cc;
}
.metric.is-alert .m-value, .metric.is-alert .m-label { color: var(--danger-ink); }
.metric .m-ico {
  float: right;
  width: 30px; height: 30px;
  border-radius: var(--radius-md);
  background: var(--neutral-soft);
  color: var(--neutral-ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.metric.is-alert .m-ico { background: #f6cdd5; color: var(--danger-ink); }

/* analytics layout */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.analytics-grid .col-span-2 { grid-column: 1 / -1; }

/* ---------------- Charts (CSS) ---------------- */
.barchart { display: flex; flex-direction: column; gap: 10px; }
.barrow { display: grid; grid-template-columns: 160px 1fr 42px; align-items: center; gap: 10px; }
.barrow .bar-label { font-size: 14px; color: var(--neutral-ink); }
.bar-track { display: block; height: 12px; background: var(--neutral-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--color-primary); border-radius: 999px; transition: width 0.5s ease; }
.bar-fill.alt { background: #5a93dd; }
.barrow .bar-val { font-size: 14px; font-weight: 700; text-align: right; }

.columnchart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 200px;
  padding-top: 10px;
}
.col-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.col-bar {
  width: 70%;
  max-width: 46px;
  background: var(--info-soft);
  border: 1px solid #cfe0f4;
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: height 0.5s ease;
}
.col-bar::after {
  content: attr(data-v);
  position: absolute; top: -18px; left: 0; right: 0;
  text-align: center; font-size: 12.5px; font-weight: 700; color: var(--neutral-ink);
}
.col-label { font-size: 12.5px; color: var(--color-text-muted); }

/* =========================================================
   Revamped dashboard: filters, stat boxes, dept cards,
   vertical bar charts (Nepali month + nature).
   ========================================================= */

.dash-empty { color: var(--color-text-muted); font-size: 13px; margin-top: 12px; }

/* ---- Filter bar ---- */
.dash-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.dash-filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 180px; flex: 1 1 180px; }
.dash-filter-field label { font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.dash-filter-field select,
.dash-filter-field input {
  height: 40px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 0 12px;
  background: #fff;
  font-size: 14px;
  color: var(--color-text);
}
.dash-filter-field select:focus,
.dash-filter-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.dash-filter-actions { display: flex; gap: 8px; align-items: center; padding-bottom: 2px; }
.dash-date-slot .ndp-picker-wrap { width: 100%; }
.dash-date-slot .ndp-input {
  height: 40px;
  width: 100%;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 0 12px;
  background: #fff;
  font-size: 14px;
  color: var(--color-text);
}

/* ---- A. Stat boxes — simple, flat, no shadow ---- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--sc, var(--color-primary));
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.stat-card .sc-label { font-size: 14px; font-weight: 600; color: var(--color-text-muted); }
.stat-card .sc-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  margin-top: 10px;
  color: var(--sc, var(--color-primary));
}

/* ---- Chart header with FY / year selector ---- */
.section-title.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.chart-year { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.chart-year span { font-size: 13px; color: var(--color-text-muted); }
.chart-year select {
  height: 34px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 0 10px;
  font-size: 14px;
  font-weight: 600;
  background: #fff;
  color: var(--color-text);
}

/* ---- B. Department cards ---- */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.dept-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.dept-card .dc-index {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--dc, var(--color-primary));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.dept-card .dc-body { min-width: 0; flex: 1; }
.dept-card .dc-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dept-card .dc-count { font-size: 20px; font-weight: 800; color: var(--dc, var(--color-primary)); line-height: 1.1; }

/* ---- C & D. Vertical bar charts ---- */
.vbar-scroll {
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.vbar-scroll::-webkit-scrollbar { height: 8px; }
.vbar-scroll::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 999px; }
.vbar-chart {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 240px;
  /* Each column keeps a comfortable min width; a slider appears when they
     overflow the card horizontally. */
  min-width: calc(var(--vbar-count, 12) * 52px);
}
.vbar-col {
  flex: 1 1 44px;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}
.vbar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
}
.vbar-fill {
  width: 60%;
  max-width: 40px;
  min-height: 4px;
  background: var(--vc, var(--color-primary));
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: height 0.5s ease;
}
.vbar-fill .vbar-val {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}
.vbar-label {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.25;
  white-space: nowrap;
}
.vbar-label .vbar-sub { font-size: 11px; opacity: 0.8; }
.vbar-label--nature {
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
}

/* ---------------- Status pipeline ---------------- */
.pipeline {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  overflow: hidden;
}
.pipe-step {
  flex: 1;
  min-width: 120px;
  padding: 14px 16px;
  border-right: 1px solid var(--color-border);
  position: relative;
}
.pipe-step:last-child { border-right: none; }
.pipe-step .ps-count { font-size: 25px; font-weight: 700; }
.pipe-step .ps-label { font-size: 14px; color: var(--color-text-muted); margin-top: 2px; }
.pipe-step .ps-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }

/* ---------------- Pills & SLA ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.pill.neutral { background: var(--neutral-soft); color: var(--neutral-ink); }
.pill.info { background: var(--info-soft); color: var(--info-ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill.success { background: var(--success-soft); color: var(--success-ink); }
.pill.danger { background: var(--danger-soft); color: var(--danger-ink); }

.sla { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.sla .sla-dot { width: 8px; height: 8px; border-radius: 50%; }
.sla.ontime { color: var(--success-ink); }
.sla.ontime .sla-dot { background: var(--success-ink); }
.sla.due { color: var(--warn-ink); }
.sla.due .sla-dot { background: var(--warn-ink); }
.sla.overdue { color: var(--danger-ink); }
.sla.overdue .sla-dot { background: var(--danger-ink); }
.sla.na { color: var(--color-text-muted); }
.sla.na .sla-dot { background: var(--color-border-strong); }

.type-tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  border: 1px solid var(--color-border-strong);
}
.type-tag.ujuri { background: var(--info-soft); color: var(--info-ink); border-color: #cfe0f4; }
.type-tag.muddha { background: #f3eafc; color: #6b3fa0; border-color: #e0cdf3; }

/* ---------------- Toolbar ---------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
}
.toolbar .search {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}
.toolbar .search input {
  padding: 7px 10px 7px 32px;
  font-size: 13px;
  border-color: var(--color-border);
  background: var(--color-surface-alt);
}
.toolbar .search input:focus { background: #fff; }
.toolbar .search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--color-text-muted);
}
.toolbar select {
  width: auto; min-width: 120px;
  padding: 7px 28px 7px 10px;
  font-size: 13px;
  background: var(--color-surface-alt);
  border-color: var(--color-border);
}
.toolbar select:focus { background: #fff; }
.toolbar .spacer { flex: 1; }

/* segmented control */
.segmented {
  display: inline-flex;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.segmented button,
.segmented a {
  border: none;
  background: #fff;
  padding: 8px 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--neutral-ink);
  cursor: pointer;
  border-right: 1px solid var(--color-border-strong);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.segmented button:last-child,
.segmented a:last-child { border-right: none; }
.segmented button.is-active,
.segmented a.is-active { background: var(--color-primary); color: #fff; }

/* ---------------- Table ---------------- */
.table-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.atable { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 760px; }
.atable th, .atable td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.atable thead th {
  background: #fafbfc;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-text-muted);
}
.atable tbody tr:hover { background: #fafbfc; }
.atable td.num, .atable th.num { text-align: right; }
.atable .id-cell { font-family: var(--font-mono); font-weight: 600; font-size: 13.5px; }
.atable input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--color-primary); cursor: pointer; }

.row-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--neutral-ink);
  transition: all 0.12s;
}
.icon-btn:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--info-soft); }
.icon-btn svg { width: 15px; height: 15px; }

/* bulk bar */
.bulkbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--info-soft);
  border-bottom: 1px solid #cfe0f4;
  font-size: 15px;
}
.bulkbar.show { display: flex; }

/* pagination */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  flex-wrap: wrap;
}
.pager .p-info { font-size: 14px; color: var(--color-text-muted); }
.pager .p-controls { display: flex; gap: 6px; align-items: center; }
.page-btn {
  min-width: 32px; height: 32px;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: var(--radius-md);
  cursor: pointer;
  font: inherit; font-size: 15px;
  color: var(--neutral-ink);
}
.page-btn:hover:not(:disabled) { border-color: var(--color-primary); color: var(--color-primary); }
.page-btn.is-active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.page-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* empty state */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
  font-size: 15px;
}
.legacy-import-panel { display: none; }
.legacy-import-panel.is-open { display: block; }

/* ---------------- Triage list ---------------- */
.triage { display: flex; flex-direction: column; }
.triage-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--color-border);
}
.triage-item:last-child { border-bottom: none; }
.triage-item .ti-id { font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; width: 92px; flex-shrink: 0; }
.triage-item .ti-main { flex: 1; min-width: 0; }
.triage-item .ti-name { font-weight: 600; }
.triage-item .ti-sub { font-size: 14px; color: var(--color-text-muted); }
.triage-item .ti-late { color: var(--danger-ink); font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ---------------- Settings grid ---------------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.tile {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.tile:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.tile .tile-ico {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--info-soft); color: var(--info-ink);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.tile .tile-name { font-weight: 700; font-size: 16px; }
.tile .tile-desc { font-size: 14px; color: var(--color-text-muted); margin-top: 4px; }

/* reports */
.report-list { display: flex; flex-direction: column; }
.report-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 4px; border-bottom: 1px solid var(--color-border);
}
.report-row:last-child { border-bottom: none; }
.report-row .rr-ico {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  background: var(--neutral-soft); color: var(--neutral-ink);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.report-row .rr-main { flex: 1; }
.report-row .rr-name { font-weight: 600; }
.report-row .rr-desc { font-size: 14px; color: var(--color-text-muted); }

/* ---------------- Dialog (admin) ---------------- */
.dlg-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 21, 24, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 10000;
}
.dlg {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.dlg.wide { max-width: 760px; }
.dlg-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}
.dlg-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.dlg-close {
  width: 30px; height: 30px; border: none; background: transparent;
  font-size: 22px; line-height: 1; color: var(--color-text-muted); cursor: pointer;
  border-radius: var(--radius-md);
}
.dlg-close:hover { background: var(--neutral-soft); color: var(--color-text); }
.dlg-body { padding: 20px; overflow-y: auto; }
.dlg-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--color-border);
}

/* detail rows */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.detail-grid .full { grid-column: 1 / -1; }
.detail-item .di-label { font-size: 13px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.detail-item .di-value { font-weight: 600; margin-top: 2px; }

/* stepper (import) */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 20px; }
.step {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--color-text-muted); font-weight: 600;
}
.step .step-num {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--color-border-strong);
  display: flex; align-items: center; justify-content: center; font-size: 13.5px;
}
.step.is-active { color: var(--color-primary); }
.step.is-active .step-num { border-color: var(--color-primary); background: var(--info-soft); color: var(--color-primary); }
.step.is-done .step-num { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.step-line { flex: 1; height: 1.5px; background: var(--color-border-strong); margin: 0 10px; min-width: 18px; }
.step-line.is-done { background: var(--color-primary); }

.dropzone {
  border: 1.5px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  color: var(--color-text-muted);
  cursor: pointer;
}
.dropzone:hover { border-color: var(--color-primary); background: var(--admin-bg); }
.dropzone strong { color: var(--color-text); }

.map-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.map-row .map-field { font-size: 15px; font-weight: 600; }
.map-row .map-field .req { color: var(--color-danger); }

.info-banner {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--info-soft);
  border: 1px solid #cfe0f4;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 15px;
  color: var(--info-ink);
  margin-bottom: 14px;
}
.info-banner .ib-ico { flex-shrink: 0; }
.info-banner .ib-time { color: var(--neutral-ink); font-weight: 600; }

/* form fields inside dialogs reuse .field/.form-grid from styles.css */
.dlg .form-grid { gap: 14px; }

/* page header within views */
.view-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.view-head .vh-title { font-size: 19px; font-weight: 700; }
.view-head .vh-sub { font-size: 14px; color: var(--color-text-muted); }

/* sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 55;
}

/* full-screen form overlay (new-complaint surface) */
.form-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.form-overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  font-weight: 700;
  flex-shrink: 0;
}
.form-overlay iframe {
  flex: 1;
  width: 100%;
  border: none;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
  .analytics-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.22s ease; }
  .admin-shell.nav-open .sidebar { transform: translateX(0); }
  .admin-shell.nav-open .sidebar-overlay { display: block; }
  .admin-main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .detail-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .view { padding: 16px; }
  .role-switch label { display: none; }
}
@media (max-width: 520px) {
  .map-row { grid-template-columns: 1fr; gap: 4px; margin-bottom: 14px; }
  .topbar h1 { font-size: 18px; }
  .toolbar .search { max-width: none; }
}

/* ---- Admin Badges ---- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-success { background: var(--color-success-soft, #d1fae5); color: var(--color-success, #065f46); border: 1px solid color-mix(in srgb, var(--color-success, #065f46) 30%, transparent); }
.badge-warning { background: var(--color-accent-soft, #fef3c7); color: var(--color-accent-ink, #92400e); border: 1px solid color-mix(in srgb, var(--color-accent, #d97706) 35%, transparent); }
.badge-danger  { background: #fce7ef; color: var(--danger-ink, #be123c); border: 1px solid color-mix(in srgb, var(--danger-ink, #be123c) 30%, transparent); }
.badge-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid color-mix(in srgb, #1d4ed8 30%, transparent); }
.badge-secondary { background: var(--neutral-soft, #f3f4f6); color: var(--color-text-muted, #6b7280); border: 1px solid var(--border-color, #e5e7eb); }

/* ---- Admin toolbar / search bar ---- */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
}
.admin-toolbar .search-input {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--color-surface-alt);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s;
}
.admin-toolbar .search-input:focus { border-color: var(--color-primary); background: #fff; }
.admin-toolbar select {
  padding: 7px 28px 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--color-surface-alt);
  color: var(--color-text);
  transition: border-color 0.15s;
}
.admin-toolbar select:focus { border-color: var(--color-primary); background: #fff; }

/* ---- Admin form layout ---- */
.admin-form {
  width: 100%;
  max-width: none;
}
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--color-text, #111827); }
.form-group .form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  font-size: 16px;
  background: var(--color-bg, #fff);
  color: var(--color-text, #111827);
  outline: none;
  transition: border-color 0.15s;
}
.form-group .form-control:focus { border-color: var(--color-primary, #1560bd); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #1560bd) 15%, transparent); }
.form-group .form-error { color: var(--danger-ink, #be123c); font-size: 14px; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 24px; }

/* ---- Detail grid (grievance show) ---- */
.detail-section { margin-bottom: 24px; }
.detail-section-title { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color, #e5e7eb); }
.detail-row { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; margin-bottom: 10px; font-size: 16px; }
.detail-label { color: var(--color-text-muted); font-weight: 500; }
.detail-value { color: var(--color-text); font-weight: 600; }

/* ---- Notification Bell ---- */
.notif-bell-wrap {
  position: relative;
}
.notif-bell-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.notif-bell-btn:hover { background: var(--color-surface-alt); color: var(--color-text); }
.notif-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger-ink, #e53e3e);
  color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  border: 2px solid #fff;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 200;
  overflow: hidden;
}
.notif-dropdown-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}
.notif-dropdown-title { font-size: 14px; font-weight: 700; color: var(--color-text); }
.notif-mark-all {
  font-size: 12px; color: var(--color-primary);
  background: none; border: none; cursor: pointer; padding: 0;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  transition: background 0.12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--color-surface-alt); }
.notif-item-dot {
  flex-shrink: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--info-ink, #3182ce);
  margin-top: 5px;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
  font-size: 13px; font-weight: 600;
  color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-sub {
  font-size: 12px; color: var(--color-text-muted);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-time {
  font-size: 11px; color: var(--color-text-muted);
  margin-top: 4px;
}
.notif-dropdown-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--color-border);
  text-align: center;
}
.notif-view-all {
  font-size: 13px; font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}
.notif-view-all:hover { text-decoration: underline; }

/* ---- Notifications page ---- */
.notif-page-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  transition: background 0.12s;
}
.notif-page-item:last-child { border-bottom: none; }
.notif-page-item:hover { background: var(--color-surface-alt); }
.notif-page-item.is-unread { background: var(--info-soft); }
.notif-page-dot {
  flex-shrink: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--info-ink, #3182ce);
  margin-top: 6px;
}
.notif-page-dot.is-read { background: var(--color-border); }
.notif-page-title { font-size: 14px; font-weight: 600; color: var(--color-text); }
.notif-page-body { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.notif-page-time { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }

/* ---- Compact table ---- */
.table-compact thead th { padding-top: 5px; padding-bottom: 5px; font-size: 11.5px; }
.table-compact tbody td { padding-top: 4px; padding-bottom: 4px; font-size: 12px; }
.table-compact .pill { font-size: 10px; padding: 2px 7px; }

/* ---- Report clickable rows ---- */
.report-clickable-row { cursor: pointer; }
.report-clickable-row:hover { background: var(--color-primary-soft) !important; }
.report-clickable-row:hover svg { color: var(--color-primary); }

/* ---- Report section header ---- */
.report-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}
.report-head-title { font-size: 14px; font-weight: 700; color: var(--color-text); }
.report-head-sub   { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }

/* ---- Multi-file upload preview grid ---- */
.upload-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.upload-preview-item {
  position: relative;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.upload-preview-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
  flex-shrink: 0;
}
.upload-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
}
.upload-preview-icon {
  font-size: 28px;
  line-height: 1;
}
.upload-preview-name {
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: center;
  word-break: break-all;
  max-width: 72px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.upload-preview-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger-ink, #e53e3e);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1;
}
.upload-preview-remove:hover {
  background: var(--danger-border, #c53030);
}

/* =========================================================
   Status Hierarchy builder (admin/settings/status-hierarchy)
   ========================================================= */
.sh-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sh-dept { display: flex; align-items: center; gap: 8px; }
.sh-dept label { font-size: 12px; color: var(--color-text-muted); font-weight: 600; }
.sh-dept select { width: auto; min-width: 180px; padding: 8px 30px 8px 12px; font-size: 13px; font-weight: 600; }

.sh-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}

.sh-palette { position: sticky; top: 76px; }
.sh-hint { font-size: 12px; color: var(--color-text-muted); margin: 0 0 12px; line-height: 1.5; }
.sh-palette-list { display: flex; flex-direction: column; gap: 8px; }

.sh-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: grab;
  user-select: none;
  font-size: 12.5px;
}
.sh-chip:active { cursor: grabbing; }
.sh-chip.is-dragging { opacity: 0.45; }
.sh-grip {
  width: 9px; height: 11px; flex-shrink: 0;
  background-image: radial-gradient(currentColor 1px, transparent 1.4px);
  background-size: 4.5px 4px;
  opacity: 0.55;
  display: inline-block;
}
.sh-chip::before { display: none; }
.sh-chip.in-node { padding-right: 5px; }
.sh-chip-x {
  border: none; background: transparent; cursor: pointer;
  color: currentColor; font-size: 16px; line-height: 1;
  padding: 0 2px; border-radius: 4px; opacity: 0.7;
  margin-left: 2px;
}
.sh-chip-x:hover { opacity: 1; background: rgba(0,0,0,0.08); }

.sh-canvas {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.sh-canvas-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.sh-meta { font-size: 12.5px; color: var(--color-text-muted); font-weight: 600; }
.sh-tree { display: flex; flex-direction: column; gap: 12px; }

.sh-node {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fafbfc;
}
.sh-node[data-level="0"] { background: #fff; }
.sh-node-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
}
.sh-node-badge {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 6px;
  background: var(--info-soft); color: var(--info-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.sh-node-name {
  flex: 1; min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 5px 8px; border-radius: var(--radius-sm);
  color: var(--color-text);
}
.sh-node-name:hover { border-color: var(--color-border); }
.sh-node-name:focus { border-color: var(--color-primary); background: #fff; outline: none; }
.sh-node-actions { display: flex; gap: 4px; flex-shrink: 0; }

.sh-dropzone {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  min-height: 52px;
  padding: 10px;
  border: 1.5px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  margin: 10px;
  transition: border-color 0.12s, background 0.12s;
}
.sh-dropzone.is-over {
  border-color: var(--color-primary);
  background: var(--info-soft);
}
.sh-drop-empty { font-size: 12px; color: var(--color-text-muted); font-style: italic; }

.sh-children {
  margin: 0 10px 10px 26px;
  padding-left: 14px;
  border-left: 2px solid var(--color-border);
  display: flex; flex-direction: column; gap: 10px;
}
.sh-empty { margin: 10px; text-align: center; padding: 32px 20px; color: var(--color-text-muted); font-size: 13px; }

@media (max-width: 860px) {
  .sh-layout { grid-template-columns: 1fr; }
  .sh-palette { position: static; }
  .sh-palette-list { flex-direction: row; flex-wrap: wrap; }
  .sh-head-actions { width: 100%; }
  .sh-dept select { flex: 1; }
}
