/* ==========================================================================
   PMC Portal — Design System (v1)
   Loaded AFTER legacy app.css / app-overrides.css. It:
   1. re-maps the legacy design tokens to the new palette so unconverted
      page-specific components inherit the new look;
   2. defines the new shell (.pmc-*) and the shared components
      (buttons, forms, tables, badges, alerts, cards, modals, pagination).
   ========================================================================== */

:root {
  /* ---- New tokens ---- */
  --pmc-primary: #1f4fb4;
  --pmc-primary-hover: #183f92;
  --pmc-primary-soft: #e8efff;
  --pmc-ink: #0f172a;
  --pmc-ink-2: #1e293b;
  --pmc-text: #1e293b;
  --pmc-muted: #64748b;
  --pmc-line: #e2e8f0;
  --pmc-line-strong: #cbd5e1;
  --pmc-bg: #f4f6fb;
  --pmc-surface: #ffffff;
  --pmc-success: #0f7a4d;
  --pmc-success-soft: #e6f6ee;
  --pmc-warning: #a15c07;
  --pmc-warning-soft: #fff4e0;
  --pmc-danger: #b42318;
  --pmc-danger-soft: #fdecea;
  --pmc-info: #0b64a8;
  --pmc-info-soft: #e5f2fb;
  --pmc-radius: 0px;
  --pmc-radius-sm: 0px;
  --pmc-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --pmc-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.05);
  --pmc-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.18);
  --pmc-focus: 0 0 0 3px rgba(31, 79, 180, 0.28);
  --pmc-font: "Inter", "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* ---- Legacy token remap ---- */
  --font-heading: var(--pmc-font);
  --font-body: var(--pmc-font);
  --color-primary: var(--pmc-primary);
  --color-citizen: var(--pmc-primary);
  --color-admin: var(--pmc-primary);
  --color-transporter: var(--pmc-primary);
  --color-govt: var(--pmc-primary);
  --color-accent: #2f6fe0;
  --bg-darker: var(--pmc-bg);
  --bg-main: var(--pmc-bg);
  --bg-card: var(--pmc-surface);
  --border-color: var(--pmc-line);
  --text-primary: var(--pmc-text);
  --text-muted: var(--pmc-muted);
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --shadow-sm: var(--pmc-shadow-sm);
  --shadow-md: var(--pmc-shadow);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--pmc-font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--pmc-text);
  background: var(--pmc-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pmc-primary); }
a:hover { color: var(--pmc-primary-hover); }

:focus-visible { outline: none; box-shadow: var(--pmc-focus); }

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

.pmc-skip {
  position: absolute; left: 12px; top: -48px; z-index: 3000;
  background: var(--pmc-ink); color: #fff !important; padding: 10px 16px;
  border-radius: var(--pmc-radius-sm); font-weight: 600; transition: top 0.15s;
}
.pmc-skip:focus { top: 12px; }

/* ==========================================================================
   SHELL
   ========================================================================== */
body.pmc-body { display: block; height: auto; overflow: hidden; }

.pmc-shell {
  display: flex; width: 100%; height: 100vh; height: 100dvh; background: var(--pmc-bg);
}

/* ---- Sidebar ---- */
.pmc-sidebar {
  width: 264px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--pmc-ink); color: #cbd5e1; height: 100%;
  z-index: 1400; transition: transform 0.22s ease;
}
.pmc-brand {
  display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.pmc-brand-logo {
  width: 42px; height: 42px; border-radius: 10px; background: #fff; padding: 4px;
  object-fit: contain; flex-shrink: 0;
}
.pmc-brand-text { min-width: 0; flex: 1; }
.pmc-brand-name { font-size: 16px; font-weight: 700; color: #fff; line-height: 1.2; margin: 0; }
.pmc-brand-role {
  margin: 3px 0 0; font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: #8fb0f5;
}
.pmc-sidebar-close {
  display: none; background: none; border: 0; color: #cbd5e1; cursor: pointer;
  padding: 6px; border-radius: 8px;
}
.pmc-sidebar-close:hover { background: rgba(255, 255, 255, 0.08); }

.pmc-nav {
  flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.pmc-nav-title {
  padding: 8px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: #64748b;
}
.pmc-nav .nav-item, .pmc-nav .nav-sub-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 8px; color: #cbd5e1; font-size: 14px; font-weight: 500;
  text-decoration: none; border: 0; background: none; width: 100%;
  cursor: pointer; text-align: left; transition: background 0.15s, color 0.15s;
}
.pmc-nav .nav-item .material-symbols-outlined,
.pmc-nav .nav-sub-item .material-symbols-outlined { font-size: 20px; opacity: 0.85; }
.pmc-nav .nav-item:hover, .pmc-nav .nav-sub-item:hover {
  background: rgba(255, 255, 255, 0.07); color: #fff;
}
.pmc-nav .nav-item.active, .pmc-nav .nav-sub-item.active {
  background: var(--pmc-primary); color: #fff; box-shadow: inset 3px 0 0 #9db9f5;
}
.pmc-nav .nav-item.active .material-symbols-outlined { opacity: 1; }
.pmc-nav .nav-label { flex: 1; display: flex; align-items: center; gap: 8px; }
.pmc-nav .nav-dot { display: none; }
.pmc-nav .nav-count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #dc2626; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.pmc-nav .nav-chevron { margin-left: auto; transition: transform 0.18s; }
.pmc-nav .nav-collapse.is-open .nav-chevron { transform: rotate(90deg); }
.pmc-nav .nav-collapse-panel { display: none; }
.pmc-nav .nav-collapse.is-open .nav-collapse-panel { display: block; }
.pmc-nav .nav-sub { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 4px 20px; }
.pmc-nav .nav-sub-item { padding: 8px 12px; font-size: 13.5px; }
.pmc-nav .nav-collapse.is-current > .nav-collapse-trigger { color: #fff; }

.pmc-sidebar-foot {
  padding: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; flex-direction: column; gap: 12px;
}
.pmc-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pmc-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--pmc-primary); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.pmc-user-name { margin: 0; font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmc-user-role { margin: 0; font-size: 12px; color: #94a3b8; }
.pmc-signout {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px;
  border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.18); color: #e2e8f0 !important;
  font-size: 13.5px; font-weight: 600; text-decoration: none; transition: background 0.15s;
}
.pmc-signout:hover { background: rgba(255, 255, 255, 0.08); }

/* ---- Main column ---- */
.pmc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; overflow: hidden; }

.pmc-topbar {
  flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 12px 28px;
  min-height: 68px; background: var(--pmc-surface); border-bottom: 1px solid var(--pmc-line);
}
.pmc-menu-btn {
  display: none; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--pmc-line-strong);
  background: #fff; color: var(--pmc-ink); cursor: pointer; align-items: center; justify-content: center;
}
.pmc-topbar-title { flex: 1; min-width: 0; }
.pmc-topbar-title h1 { margin: 0; font-size: 20px; font-weight: 700; color: var(--pmc-ink); line-height: 1.25; }
.pmc-topbar-title p { margin: 2px 0 0; font-size: 13px; color: var(--pmc-muted); }
.pmc-topbar-actions { display: flex; align-items: center; gap: 12px; }
.pmc-clock {
  font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; color: var(--pmc-muted);
  padding: 6px 10px; background: var(--pmc-bg); border-radius: 8px;
}
.pmc-icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--pmc-line-strong);
  background: #fff; color: var(--pmc-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.pmc-icon-btn:hover { background: var(--pmc-bg); }
.pmc-icon-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff;
}

.pmc-content { flex: 1; min-height: 0; overflow-y: auto; padding: 28px; }
.pmc-content-inner { width: 100%; max-width: none; margin: 0; }
.pmc-footer {
  flex-shrink: 0; padding: 10px 28px; font-size: 12px; color: var(--pmc-muted);
  border-top: 1px solid var(--pmc-line); background: var(--pmc-surface);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

.pmc-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 1300; }
.pmc-backdrop[hidden] { display: none; }
#notif-backdrop { z-index: 1500; }

/* ---- Notification drawer ---- */
.pmc-notif-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); z-index: 1600;
  background: #fff; box-shadow: var(--pmc-shadow-lg); display: flex; flex-direction: column;
  overflow-y: auto;
}
.pmc-notif-drawer[hidden] { display: none; }
.pmc-notif-head {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 20px;
  border-bottom: 1px solid var(--pmc-line); position: sticky; top: 0; background: #fff;
}
.pmc-notif-head strong { font-size: 16px; color: var(--pmc-ink); }
.pmc-notif-item { padding: 14px 20px; border-bottom: 1px solid var(--pmc-line); }
.pmc-notif-item a { text-decoration: none; color: inherit; display: block; }
.pmc-notif-item strong { display: block; font-size: 14px; color: var(--pmc-ink); }
.pmc-notif-item p { margin: 2px 0 0; font-size: 13px; color: var(--pmc-muted); }
.pmc-notif-item small { color: var(--pmc-muted); font-size: 12px; }
.pmc-notif-item.is-unread { background: var(--pmc-primary-soft); border-left: 3px solid var(--pmc-primary); }
.pmc-notif-empty { padding: 28px 20px; color: var(--pmc-muted); text-align: center; }

/* ---- Modal ---- */
.pmc-modal {
  position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px;
  background: rgba(15, 23, 42, 0.55);
}
.pmc-modal[hidden] { display: none; }
.pmc-modal-dialog {
  width: min(460px, 100%); background: #fff; border-radius: 14px; padding: 24px;
  box-shadow: var(--pmc-shadow-lg);
}
.pmc-modal-dialog h3 { margin: 0 0 6px; font-size: 18px; color: var(--pmc-ink); }
.pmc-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.temp-password-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 4px;
  padding: 12px 14px; background: var(--pmc-bg); border: 1px dashed var(--pmc-line-strong); border-radius: 8px;
}
.temp-password-box code { font-size: 16px; font-weight: 600; letter-spacing: 0.04em; color: var(--pmc-ink); word-break: break-all; }

/* Legacy modal classes still used on some pages */
body .modal-backdrop, body .modal-overlay { background: rgba(15, 23, 42, 0.55); }
body .modal-card, body .modal-content { border-radius: 14px; box-shadow: var(--pmc-shadow-lg); }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
body .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; font-family: inherit; font-size: 14px; font-weight: 600;
  line-height: 1.2; border-radius: var(--pmc-radius-sm); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; letter-spacing: 0; box-shadow: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  transform: none; white-space: nowrap;
}
body .btn .material-symbols-outlined { font-size: 18px; }
body .btn:hover { transform: none; }

/* Secondary (default) */
body :is(a, button).btn:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-warning):not(.btn-citizen),
body .btn.btn-secondary {
  background: #fff; border: 1px solid var(--pmc-line-strong); color: var(--pmc-ink-2);
}
body :is(a, button).btn:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-warning):not(.btn-citizen):hover,
body .btn.btn-secondary:hover {
  background: var(--pmc-primary-soft); border-color: var(--pmc-primary); color: var(--pmc-primary);
}
/* Primary */
body .btn.btn-primary, body .btn.btn-citizen, body .btn.btn-filled {
  background: var(--pmc-primary); border-color: var(--pmc-primary); color: #fff; box-shadow: var(--pmc-shadow-sm);
}
body .btn.btn-primary:hover, body .btn.btn-citizen:hover, body .btn.btn-filled:hover {
  background: var(--pmc-primary-hover); border-color: var(--pmc-primary-hover); color: #fff;
}
/* Success / warning */
body .btn.btn-success { background: var(--pmc-success); border-color: var(--pmc-success); color: #fff; }
body .btn.btn-success:hover { filter: brightness(0.92); color: #fff; }
body .btn.btn-warning { background: var(--pmc-warning-soft); border-color: #f2c887; color: var(--pmc-warning); }
body .btn.btn-warning:hover { background: #ffe9c2; color: var(--pmc-warning); }
/* Danger */
body .btn.btn-danger { background: #fff; border-color: #f1b3ad; color: var(--pmc-danger); }
body .btn.btn-danger:hover { background: var(--pmc-danger); border-color: var(--pmc-danger); color: #fff; }
/* Tonal / ghost */
body .btn.btn-tonal { background: var(--pmc-primary-soft); border-color: transparent; color: var(--pmc-primary); }
body .btn.btn-tonal:hover { background: #d6e3ff; color: var(--pmc-primary-hover); }
body .btn.btn-ghost { background: transparent; border-color: transparent; color: var(--pmc-primary); }
body .btn.btn-ghost:hover { background: var(--pmc-primary-soft); }

body .btn.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; border-radius: 7px; gap: 6px; }
body .btn.btn-sm .material-symbols-outlined { font-size: 16px; }
body .btn.btn-block { width: 100%; }
body .btn:disabled, body .btn[disabled], body .btn.is-loading { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
body .btn:focus-visible { box-shadow: var(--pmc-focus); }

.btn-logout { border-radius: 8px; }

/* ==========================================================================
   FORMS
   ========================================================================== */
body .form-group { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
body .form-group > label, body .filter-field > label, body label.form-label {
  font-size: 13px; font-weight: 600; color: var(--pmc-ink-2); margin: 0; letter-spacing: 0;
  text-transform: none;
}
body .form-group > label.required::after, body label.required::after { color: var(--pmc-danger); }

body .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
body .form-group select, body .form-group textarea,
body .filter-field input:not([type="checkbox"]):not([type="radio"]), body .filter-field select,
body .form-control {
  width: 100%; min-height: 42px; padding: 9px 12px; font-family: inherit; font-size: 14.5px;
  color: var(--pmc-text); background: #fff; border: 1px solid var(--pmc-line-strong);
  border-radius: var(--pmc-radius-sm); box-shadow: var(--pmc-shadow-sm); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
body .form-group textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
body .form-group input::placeholder, body .form-group textarea::placeholder { color: #94a3b8; }
body .form-group input:hover, body .form-group select:hover, body .form-group textarea:hover { border-color: #94a3b8; }
body .form-group input:focus, body .form-group select:focus, body .form-group textarea:focus,
body .filter-field input:focus, body .filter-field select:focus, body .form-control:focus {
  border-color: var(--pmc-primary); box-shadow: var(--pmc-focus);
}
body .form-group input:disabled, body .form-group select:disabled, body .form-group textarea:disabled,
body .form-group input[readonly] { background: #f1f5f9; color: var(--pmc-muted); cursor: not-allowed; }
body .form-group select, body .filter-field select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
body .form-group input[type="checkbox"], body .form-group input[type="radio"] {
  width: 18px; height: 18px; accent-color: var(--pmc-primary);
}
body .field-hint, body .form-hint { font-size: 12.5px; color: var(--pmc-muted); margin: 0; }
body .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; }
body .form-card {
  background: var(--pmc-surface); border: 1px solid var(--pmc-line); border-radius: var(--pmc-radius);
  padding: 28px; box-shadow: var(--pmc-shadow-sm);
}
body .form-narrow { max-width: 640px; }
.pmc-content .form-narrow, .pmc-content .form-wizard, .pmc-content .form-card, .pmc-content form.form-narrow { max-width: none; width: 100%; }
.form-error, .is-invalid ~ .form-error { color: var(--pmc-danger); font-size: 12.5px; }
body .form-group .is-invalid, body .form-group input.is-invalid { border-color: var(--pmc-danger); }

/* Tom Select / Flatpickr alignment */
body .ts-wrapper .ts-control {
  min-height: 42px; border: 1px solid var(--pmc-line-strong); border-radius: var(--pmc-radius-sm);
  box-shadow: var(--pmc-shadow-sm); padding: 6px 12px; background: #fff;
}
body .ts-wrapper.focus .ts-control { border-color: var(--pmc-primary); box-shadow: var(--pmc-focus); }
body .ts-dropdown { border-radius: var(--pmc-radius-sm); border-color: var(--pmc-line-strong); box-shadow: var(--pmc-shadow-lg); }
body .ts-dropdown .active { background: var(--pmc-primary-soft); color: var(--pmc-primary); }
body .flatpickr-day.selected, body .flatpickr-day.selected:hover { background: var(--pmc-primary); border-color: var(--pmc-primary); }

/* ==========================================================================
   CARDS, TOOLBARS, FILTERS
   ========================================================================== */
body .panel-card {
  background: var(--pmc-surface); border: 1px solid var(--pmc-line); border-radius: var(--pmc-radius);
  padding: 24px; box-shadow: var(--pmc-shadow-sm); margin-bottom: 20px;
}
body .panel-card h3 { font-size: 16px; font-weight: 700; color: var(--pmc-ink); margin: 0 0 4px; }
body .panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
body .panel-header h3 { margin: 0; }

body .page-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px; background: none; border: 0; padding: 0; box-shadow: none;
}
body .page-toolbar h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--pmc-ink); }
body .page-toolbar--actions-only { margin-bottom: 14px; }
body .list-meta { font-size: 13px; color: var(--pmc-muted); }

body .filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 16px; padding: 16px;
  margin-bottom: 18px; background: #f8fafc; border: 1px solid var(--pmc-line);
  border-radius: var(--pmc-radius); box-shadow: none;
}
body .filter-bar .filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 180px; flex: 1 1 180px; margin: 0; }
body .filter-bar .filter-actions { display: flex; gap: 10px; align-items: center; }

body .stats-grid, body .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
body .stat-card {
  display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--pmc-surface);
  border: 1px solid var(--pmc-line); border-radius: var(--pmc-radius); box-shadow: var(--pmc-shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}
body .stat-card:hover { box-shadow: var(--pmc-shadow); transform: none; }
body .stat-icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--pmc-primary-soft); color: var(--pmc-primary); flex-shrink: 0;
}
body .stat-card.recycler .stat-icon, body .stat-card.admin .stat-icon, body .stat-card.citizen .stat-icon,
body .stat-card.transporter .stat-icon { background: var(--pmc-primary-soft); color: var(--pmc-primary); }
body .stat-value { font-size: 26px; font-weight: 700; color: var(--pmc-ink); line-height: 1.1; }
body .stat-content > :first-child { font-size: 13px; color: var(--pmc-muted); font-weight: 500; }
body .stat-change { font-size: 12.5px; color: var(--pmc-muted); }

body .info-label, body .track-meta-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--pmc-muted); }
body .empty-state { padding: 32px 16px; text-align: center; color: var(--pmc-muted); }

/* ==========================================================================
   TABLES
   ========================================================================== */
body .table-wrap, body .table-responsive {
  width: 100%; overflow-x: auto; border: 1px solid var(--pmc-line); border-radius: var(--pmc-radius);
  background: #fff; -webkit-overflow-scrolling: touch;
}
body .data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
body .data-table thead th {
  position: sticky; top: 0; background: #f1f5f9; color: var(--pmc-ink-2); font-size: 12px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; text-align: left;
  padding: 12px 16px; border-bottom: 1px solid var(--pmc-line-strong); white-space: nowrap;
}
body .data-table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--pmc-line); vertical-align: middle; color: var(--pmc-text); }
body .data-table tbody tr:last-child td { border-bottom: 0; }
body .data-table tbody tr:hover td { background: #f8fafc; }
body .data-table tbody tr.click-row { cursor: pointer; }
body .data-table td strong { color: var(--pmc-ink); }
body .data-table td .btn + .btn, body .data-table td form { margin-left: 4px; }
body .data-table td .list-meta { margin-top: 2px; }
body .data-table td.empty-state { padding: 32px; }
body .table-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
body .row-link { color: var(--pmc-primary); font-weight: 600; text-decoration: none; }
body .row-link:hover { text-decoration: underline; }

/* Pagination */
body .pager-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px 0; flex-wrap: wrap; }
body .pager-info { font-size: 13px; color: var(--pmc-muted); }

/* ==========================================================================
   BADGES & ALERTS
   ========================================================================== */
body .badge, body .badge-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5; background: #eef2f7; color: #334155;
  border: 1px solid #dbe3ec; white-space: nowrap;
}
body .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
body .badge-pending { background: var(--pmc-warning-soft); color: var(--pmc-warning); border-color: #f2d6a3; }
body .badge-approved, body .badge-assigned { background: var(--pmc-info-soft); color: var(--pmc-info); border-color: #b9dbf2; }
body .badge-transit { background: #eef0ff; color: #4338ca; border-color: #cfd3fb; }
body .badge-completed, body .badge-recycled { background: var(--pmc-success-soft); color: var(--pmc-success); border-color: #b7e3cd; }
body .badge-rejected { background: var(--pmc-danger-soft); color: var(--pmc-danger); border-color: #f4c2bd; }
body .badge-inactive { background: #f1f5f9; color: #64748b; border-color: #dbe3ec; }
body .badge-unmatched { background: #fff1f2; color: #be123c; border-color: #fecdd3; }

body .flash, body .alert {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; margin: 0 0 16px;
  border-radius: var(--pmc-radius-sm); border: 1px solid; font-size: 14px; line-height: 1.5;
}
body .flash-error, body .alert-error, body .alert-danger { background: var(--pmc-danger-soft); border-color: #f4c2bd; color: #7a1710; }
body .flash-warning, body .alert-warning { background: var(--pmc-warning-soft); border-color: #f2d6a3; color: #6b3d04; }
body .flash-success, body .alert-success { background: var(--pmc-success-soft); border-color: #b7e3cd; color: #0a4f32; }
body .alert-info { background: var(--pmc-info-soft); border-color: #b9dbf2; color: #083f6b; }
body .flash a { font-weight: 600; word-break: break-all; }
.pmc-flash-wrap { padding: 16px 28px 0; }

/* ==========================================================================
   PUBLIC / AUTH SHELL
   ========================================================================== */
body.pmc-public { background: var(--pmc-bg); min-height: 100vh; overflow: auto; }
.pmc-auth {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
}
.pmc-auth-hero {
  position: relative; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    linear-gradient(160deg, rgba(10, 25, 64, 0.92) 0%, rgba(24, 63, 146, 0.86) 100%),
    url("../img/login-bg.webp") center / cover no-repeat;
}
.pmc-auth-hero .pmc-brand-logo { width: 56px; height: 56px; }
.pmc-auth-hero h1 { font-size: 34px; line-height: 1.2; font-weight: 700; margin: 24px 0 14px; color: #fff; max-width: 14ch; }
.pmc-auth-hero p { color: #d6e2ff; font-size: 16px; max-width: 44ch; margin: 0; }
.pmc-auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.pmc-auth-points li { display: flex; gap: 10px; align-items: center; color: #e6eeff; font-size: 14.5px; }
.pmc-auth-points .material-symbols-outlined { color: #9db9f5; font-size: 20px; }
.pmc-auth-copy { font-size: 12.5px; color: #aebfe6; }
.pmc-auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.pmc-auth-card {
  width: min(440px, 100%); background: #fff; border: 1px solid var(--pmc-line); border-radius: 16px;
  padding: 36px; box-shadow: var(--pmc-shadow);
}
.pmc-auth-card--wide { width: min(560px, 100%); }
.pmc-auth-card h2 { margin: 0 0 6px; font-size: 24px; font-weight: 700; color: var(--pmc-ink); }
.pmc-auth-card .pmc-sub { margin: 0 0 22px; color: var(--pmc-muted); font-size: 14px; }
.pmc-auth-links { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--pmc-line); text-align: center; font-size: 14px; color: var(--pmc-muted); }
.pmc-auth-links a { font-weight: 600; text-decoration: none; }
.pmc-auth-links a:hover { text-decoration: underline; }
.pmc-auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 20px; }
.pmc-auth-mobile-brand img { width: 40px; height: 40px; }
.pmc-auth-mobile-brand strong { font-size: 16px; color: var(--pmc-ink); }

/* Legacy login classes on pages not yet moved to .pmc-auth */
body .login-gate--side {
  background-image: linear-gradient(160deg, rgba(10, 25, 64, 0.88), rgba(24, 63, 146, 0.8)), url("../img/login-bg.webp") !important;
  background-color: #0f2a66 !important;
}
body .login-form-panel {
  background: #fff; border: 1px solid var(--pmc-line); border-radius: 16px; padding: 32px; box-shadow: var(--pmc-shadow);
}
body .login-brand h1 { color: var(--pmc-ink); }
body .login-tagline { color: var(--pmc-muted); }

/* Public pages (grievance / share) */
body .public-page, body .public-body { background: var(--pmc-bg); }
body .public-card, body .public-choice {
  background: #fff; border: 1px solid var(--pmc-line); border-radius: var(--pmc-radius); box-shadow: var(--pmc-shadow-sm);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .pmc-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(290px, 86vw);
    transform: translateX(-105%);
  }
  body.sidebar-open .pmc-sidebar { transform: translateX(0); box-shadow: var(--pmc-shadow-lg); }
  .pmc-sidebar-close, .pmc-menu-btn { display: inline-flex; }
  .pmc-topbar { padding: 10px 16px; }
  .pmc-content { padding: 18px 16px; }
  .pmc-footer { padding: 10px 16px; }
  .pmc-flash-wrap { padding: 12px 16px 0; }
}
@media (max-width: 900px) {
  .pmc-auth { grid-template-columns: 1fr; }
  .pmc-auth-hero { display: none; }
  .pmc-auth-mobile-brand { display: flex; }
}
@media (max-width: 640px) {
  .pmc-clock { display: none; }
  .pmc-topbar-title h1 { font-size: 17px; }
  body .form-card, body .panel-card { padding: 18px; }
  .pmc-auth-card { padding: 26px 20px; }
  body .filter-bar .filter-field { flex-basis: 100%; }
  body .filter-bar .filter-actions { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.pmc-auth-forgot { margin: 14px 0 0; text-align: center; font-size: 14px; }
.pmc-auth-forgot a { font-weight: 600; text-decoration: none; }
.pmc-auth-links p { margin: 0 0 6px; }
.pmc-auth .login-form-panel { all: unset; display: block; }

/* Admin share links */
.inline-form { display: inline; margin: 0; }
body .data-table td .inline-form { margin-left: 0; }
.share-ready { align-items: center; }
.share-ready .material-symbols-outlined { color: var(--pmc-success); }
.share-ready-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.share-ready-body a { word-break: break-all; }

/* Public grievance pages */
body .public-page { min-height: 100vh; padding: 32px 16px; background: var(--pmc-bg); }
body .public-page-shell { margin: 0 auto; max-width: 720px; }
body .public-page-brand {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 20px;
  background: var(--pmc-ink); border-radius: var(--pmc-radius); color: #fff;
}
body .public-page-brand img { width: 44px; height: 44px; background: #fff; border-radius: 10px; padding: 4px; }
body .public-page-brand h1 { margin: 0; font-size: 18px; color: #fff; }
body .public-page-brand .list-meta { color: #9db9f5; }
body .public-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
body .public-choice { padding: 24px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--pmc-text); }
body a.public-choice:hover { border-color: var(--pmc-primary); box-shadow: var(--pmc-shadow); }
body .public-choice > .material-symbols-outlined {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--pmc-primary-soft); color: var(--pmc-primary); font-size: 24px;
}
body .public-choice form { display: flex; flex-direction: column; gap: 10px; }
body .public-choice input[type="text"] {
  min-height: 42px; padding: 9px 12px; border: 1px solid var(--pmc-line-strong); border-radius: var(--pmc-radius-sm); font: inherit;
}
body .public-page-footer { text-align: center; margin-top: 20px; }

body .public-page-shell { background: none; border: 0; box-shadow: none; padding: 0; }
body .public-choice input[type="text"] { background: #fff; }
.pmc-auth-hero h1 { max-width: 18ch; }

/* ---- Legacy overrides found during visual QA ---- */
body .stat-card { flex-direction: row; justify-content: flex-start; text-align: left; overflow: visible; }
body .stat-card::after, body .stat-card.citizen::after, body .stat-card.admin::after,
body .stat-card.transporter::after, body .stat-card.recycler::after { display: none; content: none; }
body .stat-card .stat-content { flex: 1; min-width: 0; text-align: left; }
body .stat-card .stat-content h3 { margin: 0; font-size: 13px; font-weight: 500; color: var(--pmc-muted); text-transform: none; letter-spacing: 0; }
body .stat-card .stat-icon, body .stat-card.admin .stat-icon, body .stat-card.citizen .stat-icon,
body .stat-card.transporter .stat-icon, body .stat-card.recycler .stat-icon { background: var(--pmc-primary-soft); color: var(--pmc-primary); }
body .badge, body .badge-status { text-transform: none; letter-spacing: 0; }
body .filter-bar .filter-field label, body .form-group > label {
  text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--pmc-ink-2);
}
body .filter-bar .filter-field input, body .filter-bar .filter-field select { background-color: #fff; }
body .data-table tbody td > strong:first-child { white-space: nowrap; }
.pmc-nav .nav-sub { border-left: 0; margin-left: 0; }
.pmc-nav .nav-item, .pmc-nav .nav-sub-item { margin: 0; }
body .panel-card > .panel-header { border-bottom: 1px solid var(--pmc-line); padding-bottom: 14px; }
body .stat-card .stat-icon { background: var(--pmc-primary-soft) !important; color: var(--pmc-primary) !important; }

/* ==========================================================================
   SIDE DRAWER, TOASTS, FORM ACTIONS
   ========================================================================== */
.pmc-drawer-root { position: fixed; inset: 0; z-index: 1800; }
.pmc-drawer-root[hidden] { display: none; }
.pmc-drawer-scrim { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.5); opacity: 0; transition: opacity 0.2s; }
.pmc-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: #fff;
  display: flex; flex-direction: column; box-shadow: var(--pmc-shadow-lg);
  transform: translateX(100%); transition: transform 0.22s ease;
}
.pmc-drawer-root.is-open .pmc-drawer-scrim { opacity: 1; }
.pmc-drawer-root.is-open .pmc-drawer { transform: translateX(0); }
.pmc-drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 24px; border-bottom: 1px solid var(--pmc-line);
}
.pmc-drawer-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--pmc-ink); }
.pmc-drawer-body { flex: 1; overflow-y: auto; padding: 24px; }
.pmc-drawer-loading { display: flex; align-items: center; gap: 10px; color: var(--pmc-muted); padding: 24px 0; }
.pmc-spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--pmc-line-strong);
  border-top-color: var(--pmc-primary); animation: pmc-spin 0.7s linear infinite;
}
@keyframes pmc-spin { to { transform: rotate(360deg); } }
body.drawer-open { overflow: hidden; }
body .form-card.in-drawer { border: 0; box-shadow: none; padding: 0; max-width: none; background: none; }
.pmc-drawer .form-actions {
  position: sticky; bottom: -24px; margin: 8px -24px -24px; padding: 16px 24px;
  background: #fff; border-top: 1px solid var(--pmc-line);
}
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.form-intro { margin: 0 0 16px; }
.pmc-drawer .form-row { grid-template-columns: 1fr; }

.pmc-toasts { position: fixed; top: 20px; right: 20px; z-index: 2500; display: flex; flex-direction: column; gap: 10px; }
.pmc-toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-width: 260px; max-width: 420px;
  background: var(--pmc-ink); color: #fff; border-radius: var(--pmc-radius-sm); box-shadow: var(--pmc-shadow-lg);
  font-size: 14px; animation: pmc-toast-in 0.2s ease;
}
.pmc-toast .material-symbols-outlined { color: #4ade80; }
.pmc-toast--error .material-symbols-outlined { color: #f87171; }
.pmc-toast.is-leaving { opacity: 0; transform: translateY(-6px); transition: all 0.25s; }
@keyframes pmc-toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ==========================================================================
   SIDEBAR SCROLLBAR, TABLE ACTION BUTTONS (QA round 2)
   ========================================================================== */
.pmc-sidebar, .pmc-nav { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }
.pmc-nav::-webkit-scrollbar { width: 6px; }
.pmc-nav::-webkit-scrollbar-track { background: transparent; }
.pmc-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 6px; }
.pmc-nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.35); }
.pmc-nav { overscroll-behavior: contain; padding-bottom: 20px; }

/* Row actions: compact, consistent, no wrapping */
body .data-table td .action-links, body .data-table td .table-actions { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; }
body .data-table td .btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; font-weight: 600; box-shadow: none; }
body .data-table td .btn-sm:not(.btn-primary):not(.btn-danger):hover { background: var(--pmc-primary-soft); border-color: var(--pmc-primary); }
body .data-table td:last-child { white-space: nowrap; }

/* ==========================================================================
   GRIEVANCES
   ========================================================================== */
body .grievance-detail-head, body .grievance-list-toolbar, body .grievance-form-toolbar { margin-bottom: 20px; }
body .grievance-detail-head h3, body .grievance-list-toolbar h3, body .grievance-form-toolbar h3 { font-size: 22px; }
body .grievance-detail-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Progress stepper */
body .status-stepper {
  display: flex; gap: 0; margin: 0 0 20px; padding: 18px 20px; background: #fff;
  border: 1px solid var(--pmc-line); border-radius: var(--pmc-radius); box-shadow: var(--pmc-shadow-sm);
  counter-reset: step;
}
body .status-step {
  flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; font-size: 13px; font-weight: 600; color: var(--pmc-muted);
  background: none; border: 0; padding: 0; border-radius: 0; box-shadow: none;
}
body .status-step::before {
  counter-increment: step; content: counter(step); width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; z-index: 1;
  background: #fff; border: 2px solid var(--pmc-line-strong); color: var(--pmc-muted);
}
body .status-step::after {
  content: ""; position: absolute; top: 14px; left: calc(50% + 18px); right: calc(-50% + 18px);
  height: 2px; background: var(--pmc-line-strong);
}
body .status-step:last-child::after { display: none; }
body .status-step.done { color: var(--pmc-ink-2); background: none; }
body .status-step.done::before { background: var(--pmc-primary); border-color: var(--pmc-primary); color: #fff; content: "✓"; }
body .status-step.done::after { background: var(--pmc-primary); }
body .status-step.current { color: var(--pmc-primary); background: none; }
body .status-step.current::before { content: counter(step); background: #fff; border-color: var(--pmc-primary); color: var(--pmc-primary); box-shadow: 0 0 0 4px var(--pmc-primary-soft); }

/* Detail layout */
body .grievance-detail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
body .grievance-detail-grid .panel-card { margin-bottom: 0; }
body .grievance-detail-grid .panel-card > h3 { padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--pmc-line); }
body .info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
body .info-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
body .info-item strong { font-size: 15px; font-weight: 600; color: var(--pmc-ink); word-break: break-word; }
body .info-item p { margin: 0; color: var(--pmc-text); line-height: 1.6; }
body .info-item-wide { grid-column: 1 / -1; }
body .grievance-photo-link { margin: 18px 0 0; }

/* Activity timeline */
body .grievance-timeline { display: flex; flex-direction: column; margin-top: 12px; }
body .grievance-action { display: flex; gap: 14px; position: relative; padding-bottom: 20px; }
body .grievance-action:last-child { padding-bottom: 0; }
body .grievance-action + .grievance-action .grievance-action-mark::before { display: none; }
body .grievance-action:not(:last-child)::after {
  content: ""; position: absolute; left: 6px; top: 18px; bottom: 0; width: 2px; background: var(--pmc-line);
}
body .grievance-action-mark {
  width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; flex-shrink: 0;
  background: var(--pmc-primary); box-shadow: 0 0 0 4px var(--pmc-primary-soft);
}
body .grievance-action p { margin: 6px 0 0; font-size: 14px; color: var(--pmc-text); }

/* List: cards on mobile, table on desktop */
body .grievance-cards { display: none; }
body .grievance-card {
  display: block; padding: 16px; background: #fff; border: 1px solid var(--pmc-line); border-radius: var(--pmc-radius);
  color: var(--pmc-text); text-decoration: none; box-shadow: var(--pmc-shadow-sm);
}
body .grievance-card + .grievance-card { margin-top: 12px; }
body .grievance-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }

/* File upload */
body .upload-drop {
  position: relative; border: 1.5px dashed var(--pmc-line-strong); border-radius: var(--pmc-radius);
  background: #f8fafc; padding: 22px; text-align: center; transition: border-color 0.15s, background 0.15s;
}
body .upload-drop:hover { border-color: var(--pmc-primary); background: var(--pmc-primary-soft); }
body .upload-drop-idle .material-symbols-outlined { font-size: 32px; color: var(--pmc-primary); }
body .upload-drop-idle p { margin: 6px 0 0; font-size: 13.5px; color: var(--pmc-muted); }
body .upload-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
body .upload-drop-preview .upload-drop-clear { position: relative; z-index: 2; }

@media (max-width: 900px) {
  body .grievance-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body .info-grid { grid-template-columns: 1fr; }
  body .grievance-table { display: none; }
  body .grievance-cards { display: block; }
  body .status-step { font-size: 11.5px; }
  .pmc-drawer { width: 100vw; }
  .pmc-drawer-body { padding: 18px; }
  .pmc-drawer .form-actions { margin: 8px -18px -18px; padding: 14px 18px; bottom: -18px; }
}

/* QA round 2b: legacy leaks in stepper / info items, drawer footer pinned */
body .status-step, body .status-step.done, body .status-step.current {
  border: 0; box-shadow: none; background: none; border-radius: 0; padding: 0; outline: 0;
}
body .info-item { background: none; border: 0; padding: 0; border-radius: 0; box-shadow: none; }
.pmc-drawer-body { display: flex; flex-direction: column; }
.pmc-drawer-body > .in-drawer, .pmc-drawer-body > .in-drawer > form { flex: 1; display: flex; flex-direction: column; }
.pmc-drawer .form-actions { margin-top: auto; }

/* ==========================================================================
   SEARCHABLE SELECT (Tom Select) — themed
   ========================================================================== */
body .ts-wrapper { width: 100%; }
body .ts-wrapper .ts-control, body .ts-wrapper.single .ts-control {
  min-height: 42px !important; padding: 8px 40px 8px 12px !important; border: 1px solid var(--pmc-line-strong) !important;
  border-radius: var(--pmc-radius-sm) !important; background: #fff !important; box-shadow: var(--pmc-shadow-sm) !important;
  font-family: var(--pmc-font); font-size: 14.5px; color: var(--pmc-text); line-height: 1.4;
  display: flex; align-items: center; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
body .ts-wrapper:not(.disabled) .ts-control:hover { border-color: #94a3b8 !important; }
body .ts-wrapper.focus .ts-control, body .ts-wrapper.dropdown-active .ts-control {
  border-color: var(--pmc-primary) !important; box-shadow: var(--pmc-focus) !important;
}
body .ts-wrapper.single .ts-control .item { color: var(--pmc-text); }
body .ts-wrapper .ts-control > input { color: var(--pmc-text); font-size: 14.5px; }
body .ts-wrapper .ts-control > input::placeholder, body .ts-wrapper .ts-control .item.placeholder { color: #94a3b8; }
/* chevron */
body .ts-wrapper.single .ts-control::after {
  content: "" !important; position: absolute; right: 14px !important; top: 50% !important; margin: -3px 0 0 !important;
  width: 8px; height: 8px; border: solid var(--pmc-muted) !important; border-width: 0 2px 2px 0 !important;
  transform: rotate(45deg); transition: transform 0.15s;
}
body .ts-wrapper.single.dropdown-active .ts-control::after { transform: rotate(-135deg); margin-top: -1px !important; }
body .ts-wrapper.disabled .ts-control { background: #f1f5f9 !important; color: var(--pmc-muted); cursor: not-allowed; opacity: 1; }

/* dropdown panel */
body .ts-dropdown, body .ts-dropdown.single {
  margin-top: 6px; border: 1px solid var(--pmc-line-strong); border-radius: 10px; overflow: hidden;
  background: #fff; box-shadow: var(--pmc-shadow-lg); font-family: var(--pmc-font); z-index: 1900;
}
body .ts-dropdown .dropdown-input-wrap { padding: 10px; border-bottom: 1px solid var(--pmc-line); background: #f8fafc; }
body .ts-dropdown .dropdown-input, body .plugin-dropdown_input .dropdown-input {
  width: 100% !important; min-height: 38px; padding: 8px 12px 8px 36px !important;
  border: 1px solid var(--pmc-line-strong) !important; border-radius: 8px !important; background-color: #fff !important;
  font-size: 14px; color: var(--pmc-text); box-shadow: none !important; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: 11px center !important;
}
body .ts-dropdown .dropdown-input:focus { border-color: var(--pmc-primary) !important; box-shadow: var(--pmc-focus) !important; }
body .ts-dropdown .ts-dropdown-content { max-height: 260px; padding: 6px; }
body .ts-dropdown .option, body .ts-dropdown .no-results, body .ts-dropdown .create {
  padding: 9px 12px; border-radius: 7px; font-size: 14px; color: var(--pmc-text); cursor: pointer;
}
body .ts-dropdown .option:hover, body .ts-dropdown .active { background: var(--pmc-primary-soft); color: var(--pmc-primary); }
body .ts-dropdown .option.selected { background: var(--pmc-primary); color: #fff; font-weight: 600; }
body .ts-dropdown .option.selected.active { background: var(--pmc-primary-hover); color: #fff; }
body .ts-dropdown .no-results { color: var(--pmc-muted); cursor: default; text-align: center; padding: 14px 12px; }
body .ts-dropdown .no-results:hover { background: none; color: var(--pmc-muted); }
body .ts-dropdown .optgroup-header { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pmc-muted); background: none; }

/* multi-select chips */
body .ts-wrapper.multi .ts-control { flex-wrap: wrap; gap: 6px; padding-right: 12px !important; }
body .ts-wrapper.multi .ts-control > div {
  background: var(--pmc-primary-soft); color: var(--pmc-primary); border: 1px solid #c7d6f7; border-radius: 6px;
  padding: 2px 8px; font-size: 13px; font-weight: 600; margin: 0;
}
body .ts-wrapper.multi .ts-control > div .remove { border-left: 1px solid #c7d6f7; margin-left: 6px; padding-left: 6px; color: var(--pmc-primary); }

/* inside filter bars / drawer */
body .filter-bar .ts-wrapper .ts-control { background: #fff !important; }
.pmc-drawer .ts-dropdown { z-index: 2100; }

/* ==========================================================================
   ROUND 3 — citizen screens, wizard, profile, public header, select chevron
   ========================================================================== */
.pmc-content-inner { padding-bottom: 24px; }

/* ---- Native + Tom Select chevron alignment ---- */
body .ts-wrapper.single .ts-control::after { display: none !important; content: none !important; }
body .ts-wrapper.single .ts-control {
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 12px center !important; background-size: 16px 16px !important;
}
body .ts-wrapper.single.dropdown-active .ts-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231f4fb4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 15-6-6-6 6'/%3E%3C/svg%3E") !important;
}
body .ts-wrapper .ts-control > .item { line-height: 1.4; }
body .form-group select, body .filter-field select { background-position: right 12px center; background-size: 16px 16px; }

/* ---- Public header (grievance / share pages) ---- */
body .public-page-brand {
  background: #fff; color: var(--pmc-ink); border: 1px solid var(--pmc-line); box-shadow: var(--pmc-shadow-sm);
  padding: 14px 20px; gap: 14px;
}
body .public-page-brand img { width: 48px; height: 48px; background: none; padding: 0; border-radius: 0; object-fit: contain; }
body .public-page-brand h1 { color: var(--pmc-ink); font-size: 18px; font-weight: 700; }
body .public-page-brand .list-meta { color: var(--pmc-muted); }
body .public-page-footer a { font-weight: 600; text-decoration: none; }
body .public-page-footer a:hover { text-decoration: underline; }
body .public-page .grievance-detail-head { margin-top: 4px; }

/* ---- Citizen dashboard ---- */
body .citizen-action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
body .citizen-cta-card {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: var(--pmc-radius);
  background: #fff; border: 1px solid var(--pmc-line); color: var(--pmc-text); text-decoration: none;
  box-shadow: var(--pmc-shadow-sm); transition: box-shadow 0.15s, border-color 0.15s;
}
body .citizen-cta-card:hover { box-shadow: var(--pmc-shadow); border-color: var(--pmc-primary); }
body .citizen-cta-card > div:nth-child(2) { flex: 1; min-width: 0; }
body .citizen-cta-card strong { display: block; font-size: 16px; font-weight: 700; color: var(--pmc-ink); }
body .citizen-cta-card p { margin: 2px 0 0; font-size: 13.5px; color: var(--pmc-muted); }
body .citizen-cta-card > span { font-size: 14px; font-weight: 600; color: var(--pmc-primary); white-space: nowrap; }
body .cta-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--pmc-primary-soft); color: var(--pmc-primary);
}
body .citizen-cta-card.primary { background: var(--pmc-primary); border-color: var(--pmc-primary); }
body .citizen-cta-card.primary:hover { background: var(--pmc-primary-hover); }
body .citizen-cta-card.primary strong, body .citizen-cta-card.primary p, body .citizen-cta-card.primary > span { color: #fff; }
body .citizen-cta-card.primary p { opacity: 0.85; }
body .citizen-cta-card.primary .cta-icon { background: rgba(255, 255, 255, 0.18); color: #fff; }

body .citizen-channel-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 28px; margin-bottom: 20px;
  border-radius: var(--pmc-radius); color: #fff; border: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1b3a8a 100%);
}
body .citizen-channel-card .channel-label { color: #c7d6f7; font-size: 13.5px; font-weight: 500; }
body .citizen-channel-card .channel-value { font-size: 36px; font-weight: 700; line-height: 1.15; margin: 4px 0; color: #fff; }
body .citizen-channel-card .channel-sub { color: #aebfe6; font-size: 13.5px; }
body .citizen-channel-card > .material-symbols-outlined { font-size: 56px; color: rgba(255, 255, 255, 0.25); }

body .pipeline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
body .pipeline-card { background: #fff; border: 1px solid var(--pmc-line); border-radius: var(--pmc-radius); padding: 18px 20px; box-shadow: var(--pmc-shadow-sm); }
body .pipeline-card .label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--pmc-muted); }
body .pipeline-card .label .material-symbols-outlined { font-size: 20px; }
body .pipeline-card .value { font-size: 28px; font-weight: 700; color: var(--pmc-ink); margin-top: 6px; }

/* ---- Request cards (pickup list) ---- */
body .list-count { margin: 0 0 12px; font-weight: 500; }
body .request-card {
  display: block; padding: 16px 18px; background: #fff; border: 1px solid var(--pmc-line); border-radius: var(--pmc-radius);
  color: var(--pmc-text); text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s;
}
body .request-card:hover { border-color: var(--pmc-primary); box-shadow: var(--pmc-shadow); }
body .request-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
body .request-card-top strong { font-size: 15px; color: var(--pmc-ink); }
body .empty-state-rich { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 16px; }
body .empty-state-rich .empty-icon { font-size: 44px; color: #94a3b8; }
body .empty-state-rich p { margin: 0; max-width: 40ch; }
body .btn.is-loading { position: relative; color: transparent !important; }
body .btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5); border-top-color: #fff; animation: pmc-spin 0.7s linear infinite;
}
body .btn.is-loading .material-symbols-outlined { visibility: hidden; }

/* ---- Wizard (new request) ---- */
body .form-wizard { max-width: none; width: 100%; margin: 0; }
body .wizard-steps {
  display: flex; gap: 0; margin: 0 0 20px; padding: 18px 20px; background: #fff;
  border: 1px solid var(--pmc-line); border-radius: var(--pmc-radius); box-shadow: var(--pmc-shadow-sm); flex-wrap: nowrap;
}
body .wizard-step {
  flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none;
  font-size: 13px; font-weight: 600; color: var(--pmc-muted); text-align: center;
}
body .wizard-step-num {
  position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--pmc-line-strong); color: var(--pmc-muted); font-size: 13px; font-weight: 700;
}
body .wizard-step::after {
  content: ""; position: absolute; top: 15px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 2px; background: var(--pmc-line-strong);
}
body .wizard-step:last-child::after { display: none; }
body .wizard-step.is-active, body .wizard-step.is-done { background: none; border: 0; color: var(--pmc-ink-2); }
body .wizard-step.is-active { color: var(--pmc-primary); }
body .wizard-step.is-active .wizard-step-num { border-color: var(--pmc-primary); color: var(--pmc-primary); box-shadow: 0 0 0 4px var(--pmc-primary-soft); }
body .wizard-step.is-done .wizard-step-num { background: var(--pmc-primary); border-color: var(--pmc-primary); color: transparent; font-size: 0; }
body .wizard-step.is-done .wizard-step-num::before { content: "✓"; color: #fff; font-size: 15px; }
body .wizard-step.is-done::after { background: var(--pmc-primary); }
body .wizard-pane.form-card { max-width: none; }
body .wizard-pane > h3 {
  margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--pmc-line); font-size: 17px; font-weight: 700; color: var(--pmc-ink);
}
body .wizard-nav {
  max-width: none; margin-top: 18px; padding: 14px 20px; background: #fff; border: 1px solid var(--pmc-line);
  border-radius: var(--pmc-radius); box-shadow: var(--pmc-shadow-sm); display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
body .wizard-nav .wizard-nav-right { display: flex; gap: 10px; margin-left: auto; }
@media (max-width: 640px) { body .wizard-step-label { font-size: 11px; } body .wizard-nav { flex-wrap: wrap; } }

/* ---- Profile ---- */
.profile-header {
  display: flex; align-items: center; gap: 18px; padding: 22px 24px; margin-bottom: 20px; background: #fff;
  border: 1px solid var(--pmc-line); border-radius: var(--pmc-radius); box-shadow: var(--pmc-shadow-sm); flex-wrap: wrap;
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%; background: var(--pmc-primary); color: #fff; display: grid; place-items: center;
  font-size: 22px; font-weight: 700; flex-shrink: 0;
}
.profile-header-text { flex: 1; min-width: 0; }
.profile-header-text h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--pmc-ink); }
.profile-header-text p { margin: 2px 0 0; color: var(--pmc-muted); font-size: 14px; word-break: break-all; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
body .form-card.profile-card { max-width: none; margin: 0; }
body .profile-card > h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--pmc-ink); }
body .profile-card .form-intro { margin: 0 0 18px; color: var(--pmc-muted); font-size: 13.5px; }
body .profile-card > h3 + form, body .profile-card > h3 + .form-intro { margin-top: 14px; }
body .profile-card .form-actions { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--pmc-line); }
@media (max-width: 1100px) { .profile-grid { grid-template-columns: 1fr; } }

/* disabled / read-only inputs read as locked, not broken */
body .form-group input:disabled { background: #f1f5f9; color: var(--pmc-muted); border-style: dashed; box-shadow: none; }

/* hidden attribute must win over component display rules (wizard Back/Submit, etc.) */
[hidden] { display: none !important; }
body .form-actions { justify-content: flex-start; }

/* ==========================================================================
   ROUND 4 — fleet detail, empty states, FULL RESPONSIVE PASS
   ========================================================================== */
body .split-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
body .split-grid .form-card { max-width: none; margin: 0; }
body .split-grid .form-card > h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--pmc-ink); }
body .danger-card { border-color: #f1b3ad; background: #fffafa; }
body .danger-card > h3 { color: var(--pmc-danger); }
body .notice-line { margin: 16px 0 0; }

body .feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 16px; }
body .feature-card {
  display: flex; flex-direction: column; gap: 2px; padding: 16px; background: #f8fafc; border: 1px solid var(--pmc-line);
  border-radius: var(--pmc-radius); box-shadow: none; min-width: 0;
}
body .feature-card .material-symbols-outlined { font-size: 22px; color: var(--pmc-primary); margin-bottom: 6px; }
body .feature-card h4 { margin: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--pmc-muted); }
body .feature-card p { margin: 2px 0 0; font-size: 14.5px; font-weight: 600; color: var(--pmc-ink); word-break: break-word; }

body .empty-state, body .empty-state-rich { background: #f8fafc; border: 1px dashed var(--pmc-line-strong); border-radius: var(--pmc-radius); }
body .empty-state-rich { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 20px; }
body .empty-state-rich > .material-symbols-outlined { font-size: 44px; color: #94a3b8; }
body .empty-state-rich h4 { margin: 0; font-size: 16px; font-weight: 700; color: var(--pmc-ink); }
body .empty-state-rich p { margin: 0 0 8px; max-width: 46ch; color: var(--pmc-muted); }
body .data-table td.empty-state { border: 0; background: none; }

body .data-table td .table-actions { flex-wrap: nowrap; }
body .data-table td.cell-actions { text-align: right; white-space: nowrap; }

/* ---------- Tablet (≤1024px) ---------- */
@media (max-width: 1024px) {
  body .split-grid { grid-template-columns: 1fr; }
  body .stats-grid, body .kpi-grid, body .pipeline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .citizen-action-grid { grid-template-columns: 1fr 1fr; }
  body .panel-card, body .form-card { padding: 20px; }
  body .data-table { min-width: 680px; }
  .pmc-topbar-title p { display: none; }
  body .form-wizard { max-width: none; }
}

/* ---------- Mobile (≤640px) ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .pmc-topbar { min-height: 60px; padding: 8px 12px; gap: 10px; }
  .pmc-topbar-title h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pmc-content { padding: 14px 12px; }
  .pmc-footer { padding: 10px 12px; font-size: 11.5px; flex-direction: column; gap: 2px; }
  .pmc-flash-wrap { padding: 10px 12px 0; }

  body .panel-card, body .form-card { padding: 16px; border-radius: 12px; }
  body .stats-grid, body .kpi-grid, body .pipeline-grid, body .citizen-action-grid { grid-template-columns: 1fr; gap: 12px; }
  body .pipeline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .stat-value { font-size: 24px; }
  body .citizen-channel-card { padding: 18px; }
  body .citizen-channel-card .channel-value { font-size: 28px; }
  body .citizen-channel-card > .material-symbols-outlined { font-size: 40px; }

  /* toolbars stack; primary CTAs become full width */
  body .page-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  body .page-toolbar > .btn, body .page-toolbar .btn-primary { width: 100%; }
  body .panel-header { flex-direction: column; align-items: flex-start; }
  body .filter-bar { padding: 12px; }
  body .filter-bar .filter-actions .btn { flex: 1; }

  /* 44px touch targets */
  body .btn { min-height: 44px; }
  body .btn.btn-sm { min-height: 38px; }
  body .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  body .form-group select, body .filter-field input, body .filter-field select, body .ts-wrapper .ts-control { min-height: 44px !important; font-size: 16px; }

  /* tables scroll sideways inside their card instead of crushing */
  body .data-table { min-width: 620px; font-size: 13.5px; }
  body .data-table thead th, body .data-table tbody td { padding: 10px 12px; }
  body .table-wrap { border-radius: 10px; }

  /* wizard: numbers only, active step shows its label */
  body .wizard-steps { padding: 14px 10px; }
  body .wizard-step-label { display: none; }
  body .wizard-step.is-active .wizard-step-label { display: block; position: absolute; top: 40px; white-space: nowrap; font-size: 12px; }
  body .wizard-steps { padding-bottom: 34px; }
  body .wizard-nav { padding: 12px; }
  body .wizard-nav .wizard-nav-right { width: 100%; margin-left: 0; }
  body .wizard-nav .wizard-nav-right .btn, body .wizard-nav > .btn { flex: 1; }

  /* grievance stepper / profile / detail */
  body .status-stepper { padding: 14px 8px; }
  .profile-header { padding: 16px; gap: 12px; }
  .profile-avatar { width: 52px; height: 52px; font-size: 18px; }
  body .citizen-cta-card { padding: 16px; }
  body .feature-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  body .feature-card { padding: 12px; }
  body .geo-row { grid-template-columns: 1fr; }
  body .form-actions { flex-wrap: wrap; }
  body .form-actions .btn { flex: 1; }

  /* auth + public */
  .pmc-auth-panel { padding: 20px 14px; }
  body .public-page { padding: 16px 12px; }
  body .public-page-brand { padding: 12px 14px; }
  .pmc-notif-drawer { width: 100vw; }
  .pmc-toasts { left: 12px; right: 12px; top: 12px; }
  .pmc-toast { min-width: 0; max-width: none; }
}

/* ---------- Small phones (≤380px) ---------- */
@media (max-width: 380px) {
  body .pipeline-grid, body .feature-grid { grid-template-columns: 1fr; }
  .pmc-icon-btn, .pmc-menu-btn { width: 38px; height: 38px; }
}

/* keep long words/emails from breaking layouts */
body .info-item strong, .profile-header-text p { overflow-wrap: anywhere; }
img, video { max-width: 100%; height: auto; }

/* Full-width app forms: use the space with multi-column rows */
.pmc-content .form-row { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pmc-content .wizard-pane .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .pmc-content .wizard-pane .form-row { grid-template-columns: 1fr; } }

/* ==========================================================================
   ROUND 5 — auth/public layout art, register wizard, profile alignment
   ========================================================================== */
.pmc-auth-hero { position: relative; overflow: hidden; }
.pmc-hero-inner { position: relative; z-index: 1; }
.pmc-auth-copy { position: relative; z-index: 1; }
.pmc-hero-art { position: absolute; inset: 0; z-index: 0; pointer-events: none; color: #fff; }
.art-ring { position: absolute; opacity: 0.12; }
.art-ring-1 { width: 520px; height: 520px; right: -170px; top: -150px; }
.art-ring-2 { width: 380px; height: 380px; left: -140px; bottom: 60px; }
.art-icon { position: absolute; font-size: 120px !important; opacity: 0.08; font-variation-settings: "FILL" 0, "wght" 300; }
.art-icon-1 { right: 40px; bottom: 90px; font-size: 180px !important; }
.art-icon-2 { right: 220px; top: 46%; font-size: 110px !important; transform: rotate(-8deg); }
.art-icon-3 { left: 42%; bottom: 22%; font-size: 90px !important; }
.art-dots {
  position: absolute; right: 36px; top: 36px; width: 170px; height: 120px; opacity: 0.3;
  background-image: radial-gradient(circle, #9db9f5 1.5px, transparent 1.6px); background-size: 18px 18px;
}
.pmc-auth-card--xwide { width: min(760px, 100%); }
.pmc-auth-card--wide { width: min(640px, 100%); }
.pmc-back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; text-decoration: none; margin-bottom: 14px; color: var(--pmc-muted); }
.pmc-back-link:hover { color: var(--pmc-primary); }
.pmc-back-link .material-symbols-outlined { font-size: 18px; }
.pmc-auth-panel { overflow-y: auto; }
body.pmc-public .pmc-auth { min-height: 100vh; }
.pmc-auth-card .public-choice-grid { margin-bottom: 4px; }
.pmc-auth-card .grievance-detail-head { margin-bottom: 16px; }
.pmc-auth-card .grievance-detail-grid { grid-template-columns: 1fr; }
.pmc-auth-card .panel-card { box-shadow: none; }

/* Register wizard inside the auth card */
.pmc-auth .form-wizard { max-width: none; }
.pmc-auth .wizard-steps { box-shadow: none; border: 0; background: #f8fafc; border-radius: 12px; padding: 14px 10px 14px; margin-bottom: 22px; }
.pmc-auth .wizard-nav { box-shadow: none; border: 0; background: none; padding: 6px 0 0; margin-top: 8px; }
.pmc-auth .wizard-pane { padding: 0; }
.pmc-auth .wizard-pane > h3 { margin-top: 0; }
.pmc-auth .account-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.pmc-auth .account-type-option {
  display: block; padding: 16px; border: 1.5px solid var(--pmc-line-strong); border-radius: 12px; background: #fff; cursor: pointer;
  transition: border-color 0.15s, background 0.15s; box-shadow: none;
}
.pmc-auth .account-type-option strong { display: block; color: var(--pmc-ink); font-size: 15px; }
.pmc-auth .account-type-option span, .pmc-auth .account-type-option small { color: var(--pmc-muted); font-size: 13px; }
.pmc-auth .account-type-option:hover { border-color: var(--pmc-primary); }
.pmc-auth .account-type-option.is-selected { border-color: var(--pmc-primary); background: var(--pmc-primary-soft); box-shadow: 0 0 0 3px rgba(31, 79, 180, 0.12); }
.pmc-auth .account-type-option input { position: absolute; opacity: 0; pointer-events: none; }
@media (max-width: 520px) { .pmc-auth .account-type-grid { grid-template-columns: 1fr; } }

/* Terms checkbox card */
body .accept-terms { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--pmc-line-strong); border-radius: 12px; background: #fff; cursor: pointer; }
body .accept-terms.is-checked { border-color: var(--pmc-primary); background: var(--pmc-primary-soft); }
body .accept-terms-box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--pmc-line-strong); display: grid; place-items: center; flex-shrink: 0; background: #fff; color: transparent; }
body .accept-terms.is-checked .accept-terms-box { background: var(--pmc-primary); border-color: var(--pmc-primary); color: #fff; }
body .accept-terms-box .material-symbols-outlined { font-size: 16px; }
body .accept-terms-text { font-size: 13.5px; color: var(--pmc-text); }

/* Profile: equal-height cards, tidy header on small screens */
.profile-grid { align-items: stretch; }
body .form-card.profile-card { display: flex; flex-direction: column; }
body .profile-card > form { display: flex; flex-direction: column; flex: 1; }
body .profile-card .form-actions { margin-top: auto; padding-top: 16px; }
body .profile-card > form > .form-actions { border-top: 1px solid var(--pmc-line); margin-top: auto; }
.profile-grid > .profile-card:nth-child(3) { grid-column: 1 / -1; }
.profile-grid > .profile-card:nth-child(3) .form-row { max-width: 760px; }
@media (max-width: 640px) {
  .profile-header { flex-direction: column; align-items: flex-start; }
  .profile-header .badge { align-self: flex-start; }
  .profile-header-text { width: 100%; }
  .profile-header-text h2 { font-size: 18px; }
}
@media (max-width: 900px) { .pmc-hero-art { display: none; } }

/* Tom Select's hidden source <select> must not inherit full-width input sizing (caused page-wide overflow) */
body .ts-hidden-accessible, body .form-group select.ts-hidden-accessible, body .filter-field select.ts-hidden-accessible {
  position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important;
  margin: -1px !important; border: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; opacity: 0 !important; box-shadow: none !important;
}
/* stat/KPI icon tiles used on analytics */
body .kpi-card .stat-icon, body .kpi-icon, body [class*="kpi"] .stat-icon { background: var(--pmc-primary-soft) !important; color: var(--pmc-primary) !important; }

/* ==========================================================================
   ROUND 6 — settings, filter bar consistency
   ========================================================================== */
.settings-wrap { display: flex; flex-direction: column; gap: 20px; }
.settings-card { background: #fff; border: 1px solid var(--pmc-line); border-radius: var(--pmc-radius); padding: 24px; box-shadow: var(--pmc-shadow-sm); }
.settings-head { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--pmc-line); }
.settings-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--pmc-ink); }
.settings-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--pmc-muted); }
.settings-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--pmc-primary-soft); color: var(--pmc-primary); flex-shrink: 0; }
.settings-icon--danger { background: var(--pmc-danger-soft); color: var(--pmc-danger); }
.settings-card .form-group:last-child { margin-bottom: 0; }
.settings-savebar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(6px); border: 1px solid var(--pmc-line);
  border-radius: var(--pmc-radius); box-shadow: var(--pmc-shadow);
}
/* tag fields */
body .tag-field { border: 0; padding: 0; background: none; }
body .tag-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; min-height: 52px; background: #f8fafc; border: 1px dashed var(--pmc-line-strong); border-radius: var(--pmc-radius-sm); margin-bottom: 10px; }
body .tag-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: var(--pmc-primary-soft); color: var(--pmc-primary); border: 1px solid #c7d6f7;
}
body .tag-chip--blocked { background: var(--pmc-danger-soft); color: var(--pmc-danger); border-color: #f4c2bd; }
body .tag-chip-remove {
  width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(15, 23, 42, 0.08); color: inherit; cursor: pointer;
  font-size: 15px; line-height: 1; display: grid; place-items: center;
}
body .tag-chip-remove:hover { background: rgba(15, 23, 42, 0.18); }
body .tag-add-row { display: flex; gap: 10px; align-items: stretch; }
body .tag-add-row input { flex: 1; }

/* Filter bars: auto-applied everywhere, so only a consistent "Reset filters" action remains */
body .filter-bar .filter-actions { align-self: flex-end; margin-left: auto; }
body .filter-bar .btn-reset { color: var(--pmc-muted); }
body .filter-bar .btn-reset:hover { color: var(--pmc-primary); }
body .filter-bar .filter-field.grow { flex: 2 1 280px; }
.settings-wrap > form { display: flex; flex-direction: column; gap: 20px; }

/* Approved transporters table */
body .approved-table td .live-trips { display: flex; flex-direction: column; gap: 10px; }
body .approved-table td .live-trip { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
body .approved-table td .live-trip-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body .approved-table td:first-child { min-width: 160px; }
body .approved-table td .muted-cell, body .approved-table td.muted-cell { color: var(--pmc-muted); }
body .approved-table td .table-actions .btn { white-space: nowrap; }

/* Grievance detail: stepper connector only up to the current step */
body .status-step.current::after { background: var(--pmc-line-strong); }
body .status-step.current ~ .status-step.done::after { background: var(--pmc-line-strong); }

/* Grievance: record-an-action panel */
body .grievance-action-panel { margin-top: 20px; }
body .grievance-action-panel > h3 { padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--pmc-line); }
body .grievance-action-panel > .list-meta { margin: 0 0 18px; }
body .grievance-action-form .form-row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0 20px; align-items: start; }
body .grievance-action-form .form-group { margin-bottom: 14px; }
body .grievance-action-form .form-group .field-hint { display: block; margin-top: 6px; }
body .grievance-action-form .form-actions { display: flex; justify-content: flex-end; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--pmc-line); }
@media (max-width: 760px) {
  body .grievance-action-form .form-row { grid-template-columns: 1fr; }
  body .grievance-action-form .form-actions .btn { width: 100%; justify-content: center; }
}
body .grievance-action-form .form-actions { width: 100%; max-width: none; box-sizing: border-box; }

/* ==========================================================================
   AUTH: full-page Malba photo, sign-in card floats on top
   ========================================================================== */
body.pmc-public .pmc-auth {
  position: relative; isolation: isolate; min-height: 100vh;
  background: #1b1f27 url("../img/malba-login.webp") 100% 50% / cover no-repeat;
}
body.pmc-public .pmc-auth::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, rgba(8, 16, 34, 0.9) 0%, rgba(8, 16, 34, 0.55) 40%, rgba(8, 16, 34, 0) 60%),
    linear-gradient(to bottom, rgba(8, 16, 34, 0.6) 0%, rgba(8, 16, 34, 0) 28%),
    linear-gradient(to left, rgba(8, 16, 34, 0.45) 0%, rgba(8, 16, 34, 0) 55%);
}
body.pmc-public .pmc-auth-hero { background: none; padding: 0; justify-content: flex-end; min-height: 100vh; }
body.pmc-public .pmc-auth-hero::before, body.pmc-public .pmc-auth-hero::after { content: none; }
body.pmc-public .pmc-auth-hero .pmc-hero-inner { padding: 0 48px 12px; }
body.pmc-public .pmc-auth-hero h1 { margin: 0 0 10px; font-size: 30px; max-width: 20ch; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4); }
body.pmc-public .pmc-auth-hero p { color: #e3ebff; font-size: 15px; }
body.pmc-public .pmc-auth-hero .pmc-auth-points { margin-top: 18px; gap: 9px; }
body.pmc-public .pmc-auth-hero .pmc-auth-copy { padding: 8px 48px 26px; color: #c3d1f2; }
body.pmc-public .pmc-hero-brand {
  position: absolute; top: 34px; left: 44px; z-index: 2; display: flex; align-items: center; gap: 18px; text-decoration: none;
}
body.pmc-public .pmc-hero-brand img { width: 116px; height: auto; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35)); }
body.pmc-public .pmc-hero-brand span {
  font-family: "Noto Sans Devanagari", Inter, sans-serif; font-weight: 700; font-size: 30px; line-height: 1.2; color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}
body.pmc-public .pmc-auth-card {
  background: rgba(255, 255, 255, 0.96); border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 24px 60px rgba(4, 10, 25, 0.45); backdrop-filter: blur(6px);
}
@media (max-width: 900px) {
  body.pmc-public .pmc-auth { background-position: 35% 50%; }
}
/* "Back to login" links: arrow icon, primary colour, no extra bottom gap */
.pmc-auth-card .pmc-back-link { margin-bottom: 0; color: var(--pmc-primary); }
.pmc-auth-card .pmc-back-link:hover { text-decoration: underline; }
.pmc-auth-links .pmc-back-link { justify-content: center; }
.pmc-auth-links--row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 28px; }
.pmc-auth-links .pmc-back-link { line-height: 1.2; }

/* Branding: emblem + name on every auth/public page, emblem in the app header */
.pmc-brand-logo { width: 48px; height: 40px; background: #fff; padding: 3px; }
.pmc-topbar-brand { display: none; flex-shrink: 0; }
.pmc-topbar-brand img { height: 36px; width: auto; display: block; }
@media (max-width: 900px) {
  .pmc-topbar-brand { display: block; }
  body.pmc-public .pmc-hero-brand { top: 22px; left: 20px; gap: 12px; }
  body.pmc-public .pmc-hero-brand img { width: 68px; }
  body.pmc-public .pmc-hero-brand span { font-size: 20px; }
  body.pmc-public .pmc-auth-panel { padding-top: 116px; align-items: flex-start; }
}
.pmc-topbar-brand { align-items: center; gap: 10px; text-decoration: none; }
.pmc-topbar-brand strong { font-size: 16px; font-weight: 700; color: var(--pmc-ink); }
@media (max-width: 900px) {
  .pmc-topbar-brand { display: flex; }
}
@media (max-width: 480px) { .pmc-topbar-title p { display: none; } }
@media (max-width: 900px) {
  .pmc-topbar-brand + .pmc-topbar-title { border-left: 1px solid var(--pmc-line); padding-left: 12px; }
}

/* Card header branding: emblem + PMC Malba on every auth/public card */
body.pmc-public .pmc-auth-mobile-brand {
  display: flex; align-items: center; gap: 12px; margin: -4px 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--pmc-line);
}
body.pmc-public .pmc-auth-mobile-brand img { width: 56px; height: auto; }
body.pmc-public .pmc-auth-mobile-brand strong { font-size: 20px; font-weight: 700; color: var(--pmc-ink); }
@media (max-width: 900px) { body.pmc-public .pmc-auth-panel { padding-top: 104px; } }

/* Desktop brand refinement: single centered PMC Malba wordmark, no duplicate emblem. */
@media (min-width: 1025px) {
  .pmc-topbar {
    position: relative;
    justify-content: space-between;
    min-height: 76px;
  }
  .pmc-topbar-brand {
    display: flex;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    align-items: center;
    justify-content: center;
    gap: 0;
    white-space: nowrap;
    pointer-events: none;
  }
  .pmc-topbar-brand img {
    display: none !important;
  }
  .pmc-topbar-brand strong {
    font-size: 21px;
    font-weight: 750;
    letter-spacing: 0.035em;
    color: var(--pmc-ink);
  }
  .pmc-topbar-title {
    display: none;
  }
}

/* ==========================================================================
   LOGIN PAGE REFINEMENT — desktop split composition + focused mobile card
   ========================================================================== */
body.pmc-public .pmc-auth {
  min-height: 100svh;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, 0.92fr);
  align-items: stretch;
  overflow: hidden;
}
body.pmc-public .pmc-auth-hero {
  min-width: 0;
  box-sizing: border-box;
  padding: 40px clamp(28px, 4vw, 64px) 28px;
}
body.pmc-public .pmc-auth-hero .pmc-hero-inner {
  width: min(100%, 600px);
  margin: 0 auto;
  padding: 0 0 12px;
}
body.pmc-public .pmc-auth-hero h1 {
  max-width: 18ch;
  font-size: clamp(28px, 2.35vw, 38px);
  line-height: 1.16;
}
body.pmc-public .pmc-auth-hero p {
  max-width: 48ch;
  line-height: 1.65;
}
body.pmc-public .pmc-auth-panel {
  min-width: 0;
  box-sizing: border-box;
  padding: 48px clamp(24px, 4vw, 64px);
  align-items: center;
  justify-content: center;
}
body.pmc-public .pmc-auth-card {
  width: min(440px, 100%);
  box-sizing: border-box;
  padding: clamp(28px, 3vw, 40px);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 24px 64px rgba(4,10,25,.28);
  backdrop-filter: blur(10px);
}
body.pmc-public .pmc-auth-mobile-brand {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; margin: 0 0 22px; padding: 0 0 18px;
  border-bottom: 1px solid var(--pmc-line); text-align: center;
}
body.pmc-public .pmc-auth-mobile-brand small { font-size: 12.5px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--pmc-muted); }
body.pmc-public .pmc-auth-mobile-brand img { display: none; }
body.pmc-public .pmc-auth-mobile-brand strong { font-size: 22px; line-height: 1.25; font-weight: 750; color: var(--pmc-ink); }
body.pmc-public .pmc-auth-card h2 {
  margin-bottom: 8px;
  font-size: clamp(24px, 2vw, 28px);
  letter-spacing: -.025em;
}
body.pmc-public .pmc-auth-card .pmc-sub {
  margin-bottom: 26px;
  line-height: 1.6;
}
body.pmc-public .pmc-auth-card .form-group { margin-bottom: 18px; }
body.pmc-public .pmc-auth-card input[type="email"],
body.pmc-public .pmc-auth-card input[type="password"] {
  min-height: 48px;
  border-radius: 9px;
}
body.pmc-public .pmc-auth-card .btn-block {
  min-height: 48px;
  border-radius: 9px;
  font-weight: 700;
}
body.pmc-public .pmc-auth-forgot { margin-top: 16px; }
body.pmc-public .pmc-auth-links { margin-top: 24px; padding-top: 20px; }
body.pmc-public .pmc-auth-links p + p { margin-top: 9px; }
body.pmc-public .pmc-auth-links a { line-height: 1.55; }

@media (max-width: 1024px) {
  body.pmc-public .pmc-auth {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }
  body.pmc-public .pmc-auth-hero { display: none; }
  body.pmc-public .pmc-auth-panel {
    min-height: 100svh;
    padding: 112px 22px 36px;
    align-items: center;
  }
  body.pmc-public .pmc-auth-card {
    width: min(460px, 100%);
    padding: clamp(24px, 5vw, 36px);
  }
  body.pmc-public .pmc-auth-mobile-brand { margin: 0 0 22px; padding: 0 0 16px; }
  body.pmc-public .pmc-auth-mobile-brand strong { font-size: 20px; }
}
@media (max-width: 480px) {
  body.pmc-public .pmc-auth-panel { padding: 100px 14px 24px; }
  body.pmc-public .pmc-auth-card { padding: 24px 20px; border-radius: 14px; }
  body.pmc-public .pmc-auth-links p:nth-child(2) {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  body.pmc-public .pmc-auth-links p:nth-child(2) > a { display: block; }
}

/* Mobile scroll fix: app.css locks html/body to 100dvh + overflow:hidden for the
   app shell. Public/auth pages scroll the document, so release that lock. */
@media (max-width: 768px) {
  html:has(body.pmc-public) {
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overscroll-behavior: auto;
  }
  html body.pmc-public {
    height: auto !important;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.pmc-public .pmc-auth { height: auto; overflow: visible; }
  body.pmc-public .pmc-auth-panel { overflow: visible; }
}

/* ==========================================================================
   SQUARE CORNERS: no rounded corners anywhere; only true circles
   (avatars, status dots, step markers, spinners, radio buttons) stay round.
   ========================================================================== */
html body *, html body *::before, html body *::after { border-radius: 0 !important; }
html body .pmc-avatar,
html body .profile-avatar,
html body .avatar,
html body .pmc-spinner,
html body .btn.is-loading::after,
html body .nav-dot,
html body .status-dot,
html body .log-dot,
html body .node-dot,
html body .cert-dot,
html body .badge::before,
html body .status-step::before,
html body .wizard-step-num,
html body .step-num,
html body .step-badge,
html body .grievance-action-mark,
html body .timeline-list li::before,
html body .stepper span::before,
html body .map-pin-icon,
html body .map-truck-pin-icon,
html body .tag-chip-remove,
html body input[type="radio"] { border-radius: 50% !important; }

/* Every clickable element (buttons, links, nav items, chips, option cards) and form field keeps a very slight 2px radius */
html body .btn,
html body button,
html body input:not([type="checkbox"]):not([type="radio"]),
html body select,
html body textarea,
html body .ts-control,
html body .pmc-icon-btn,
html body .pmc-menu-btn,
html body a,
html body summary,
html body [role="button"],
html body [data-drawer],
html body .nav-item,
html body .nav-sub-item,
html body .pmc-signout,
html body .reminder-card,
html body .account-type-option,
html body .upload-drop,
html body .tag-chip,
html body label[for] { border-radius: 2px !important; }
