:root {
  /* CLSU Official Brand Palette */
  --clsu-green: #009639;
  --clsu-yellow: #FFD700;
  --clsu-green-cobra: #1E6031;
  --clsu-gold: #E0A70D;

  --bg: #f2f8f4;
  --panel: #ffffff;
  --muted: #5c6b63;
  --text: #142820;
  --accent: var(--clsu-green-cobra);
  --accent-600: var(--clsu-green);
  --accent-light: #e6f7ed;
  --accent-border: #7fd4a0;
  --highlight: var(--clsu-gold);
  --highlight-light: #fffbea;
  --highlight-border: var(--clsu-yellow);
  --highlight-dark: #8a6914;
  --border: #dce8e0;
  --hover: #eef6f1;
  --danger: #c62828;

  --shadow-sm: 0 1px 3px rgba(30, 96, 49, 0.08);
  --shadow-md: 0 4px 20px rgba(30, 96, 49, 0.12);
  --shadow-lg: 0 12px 40px rgba(30, 96, 49, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}
* { box-sizing: border-box; }
html {
  height: 100%;
  margin: 0;
  overflow-x: clip;
  max-width: 100%;
}
body {
  height: 100%;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
  max-width: 100%;
}
body.sidebar-mobile-open {
  overflow: hidden;
}
.auth-shell {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
}
.auth-card {
  width: 420px; max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; display: grid; gap: 12px; box-shadow: 0 8px 26px rgba(0,0,0,.06);
}
.auth-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auth-tab {
  height: 36px; border-radius: 8px; border: 1px solid var(--border);
  background: #f9fafb; cursor: pointer; font-weight: 600;
}
.auth-tab.active { background: var(--highlight-light); color: var(--highlight-dark); border-color: var(--highlight-border); }
.auth-form { display: grid; gap: 10px; }
.forgot-password-row { margin-top: -4px; text-align: right; }
.forgot-password-link { font-size: 0.875rem; color: var(--highlight-dark); text-decoration: none; }
.forgot-password-link:hover { text-decoration: underline; }
.form-row { display: grid; gap: 6px; }
.form-row label { font-size: 12px; color: var(--muted); }
.form-row input {
  height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px;
  background: white; outline: none;
}
.form-row input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-light); }
.full { width: 100%; justify-content: center; }
.auth-note { text-align: center; }
.app { display: grid; grid-template-columns: 260px minmax(0, 1fr); height: 100vh; overflow: hidden; max-width: 100%; }
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 12px;
}
.sidebar-footer { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.sidebar-about-btn {
  color: var(--muted, #64748b);
  font-weight: 600;
  background: transparent;
}
.sidebar-about-btn:hover {
  color: var(--text, #0f172a);
  background: var(--hover);
}
.sidebar-about-btn svg {
  color: inherit;
  width: 16px;
  height: 16px;
}
.sidebar-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.brand.in-sidebar { display: inline-flex; align-items: center; gap: 8px; }
.sidebar-nav { display: grid; gap: 6px; margin-top: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; color: var(--text);
  text-decoration: none;
}
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--accent-light); color: var(--accent); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 1px solid var(--border);
  background: var(--panel); border-radius: 8px; cursor: pointer;
}
.icon-btn:hover { background: var(--hover); }
.primary-btn, .danger-btn, .icon-left-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; border-radius: 8px; height: 36px;
  padding: 0 12px; cursor: pointer; font-weight: 600;
}
.icon-left-btn { background: var(--panel); border-color: var(--border); }
.icon-left-btn:hover { background: var(--hover); }
.primary-btn { background: var(--accent-600); color: white; }
.primary-btn:hover { filter: brightness(0.95); }
.danger-btn { background: #fee2e2; color: var(--danger); border-color: #fecaca; }
.danger-btn:hover { filter: brightness(0.98); }
.link-btn { background: none; border: none; color: var(--accent-600); cursor: pointer; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.main { display: grid; grid-template-rows: auto auto auto 1fr; gap: 12px; padding: 12px; height: 100vh; overflow: hidden; background: var(--bg); min-width: 0; max-width: 100%; }
.main > * { min-width: 0; max-width: 100%; }
.main > .admin-container,
.main > .applications-container,
.main > .application-container,
.main > .activity-logs-container {
  grid-row: 4;
  min-height: 0;
  align-self: stretch;
}
.topbar {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  overflow: visible;
  position: relative;
  z-index: 20;
}
.topbar.topbar--no-search {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.topbar.topbar--no-search #mobileMenuBtn {
  margin-right: auto;
}
.topbar.topbar--no-search .topbar-actions {
  margin-left: 0;
}
.brand { display: inline-flex; align-items: center; gap: 8px; padding-left: 4px; }
.logo-dot { width: 10px; height: 10px; background: var(--accent-600); border-radius: 50%; box-shadow: 0 0 0 3px var(--accent-light); }
.brand-name { font-weight: 700; letter-spacing: 0.2px; }
.search { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); padding: 0 10px; height: 36px; border-radius: 8px; background: #f9fafb; }
.search input { border: none; outline: none; background: transparent; width: 100%; }
.topbar-actions { display: inline-flex; align-items: center; gap: 10px; overflow: visible; position: relative; }
.avatar { 
  width: 32px; height: 32px; border-radius: 50%; 
  background: linear-gradient(135deg, var(--highlight-border), var(--accent-600)); 
  cursor: pointer;
  background-size: cover;
  background-position: center;
}
.breadcrumb { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px; color: var(--muted); }
.toolbar {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px 12px; display: grid; grid-template-columns: 1fr auto; align-items: center;
}
.sort-group { display: inline-flex; align-items: center; gap: 8px; }
.sort-group select, .share-input select {
  height: 36px; border-radius: 8px; border: 1px solid var(--border); background: white; padding: 0 8px;
}
.view-toggle { display: inline-flex; gap: 8px; margin-left: 10px; }
.counter { font-weight: 600; }
.dropzone.dragover { outline: 2px dashed var(--accent-border); outline-offset: 4px; }
.content { flex: 1; overflow-y: auto; min-height: 0; padding-right: 4px; }
.hidden { display: none; }
.empty-state { display: none; }
.table { display: grid; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); overflow-x: auto; }
.table-head, .table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 260px;
  align-items: center; gap: 10px;
}
.table-head { font-size: 13px; color: var(--muted); padding: 12px; background: #f9fafb; border-bottom: 1px solid var(--border); }
.table-body .table-row { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table-body .table-row:hover { background: var(--hover); }
.actions-col { text-align: right; }
.file-actions { display: inline-flex; gap: 8px; justify-content: flex-end; }
.file-link { color: var(--accent-600); text-decoration: none; font-weight: 600; cursor: pointer; }
.file-link:hover { text-decoration: underline; }
.grid-view .grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: stretch;}
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: transform .08s ease;
}
.card:hover { transform: translateY(-2px); background: var(--hover); }
.card--folder { background: #fef3c7; border-color: #f59e0b; }
.card--folder:hover { background: #fde68a; }
.card--file { background: var(--accent-light); border-color: var(--accent-border); }
.card--file:hover { background: #bbf7d0; }
.card .card-head { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.card .card-footer { display: grid; grid-template-columns: 1fr auto; align-items: center; margin-top: auto; ; border-top: 1px solid var(--border); }
.card .file-actions { display: inline-flex; gap: 6px; }
.badge {
  display: inline-block; padding: 2px 8px; font-size: 12px; color: var(--accent);
  background: var(--accent-light); border: 1px solid var(--accent-border); border-radius: 999px;
}
.detail-panel {
  position: fixed; top: 0; right: 0; width: 420px; height: 100%;
  background: var(--panel); border-left: 1px solid var(--border);
  display: grid; grid-template-rows: auto 1fr; box-shadow: -8px 0 24px rgba(0,0,0,.06);
  z-index: 40;
  transform: translateX(100%); transition: transform .18s ease;
}
.detail-panel.show { transform: translateX(0); }
.detail-header {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px;
  padding: 12px; border-bottom: 1px solid var(--border);
}
.detail-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.detail-body { display: grid; gap: 12px; padding: 12px; overflow: auto; }
.preview {
  height: 360px; border: 1px solid var(--border); border-radius: 12px;
  display: grid; place-items: center; color: var(--muted); background: #fafafa;
  overflow: hidden;
}
.preview img, .preview iframe { max-width: 100%; max-height: 100%; object-fit: contain; }
.meta { display: grid; gap: 8px; }
.meta-row { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 8px; }
.meta-row input {
  height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px;
  background: white;
}
.modal {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 3600;
  padding: 16px;
  box-sizing: border-box;
}
#confirmModal {
  z-index: 3700;
}
.modal .modal-backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px);
}
.modal .modal-content {
  position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  width: 560px; max-width: calc(100vw - 32px); padding: 12px; display: grid; grid-template-rows: auto 1fr auto; gap: 10px;
  z-index: 1;
}
.modal .modal-content.preview-wide {
  width: min(1280px, 90vw); max-width: calc(100vw - 32px);
}
/* Application / PDF preview modal — above fixed topbar, centered, never clipped */
#previewModal,
#pnpkiDocumentModal {
  z-index: 3600;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px 16px;
  align-items: center;
  justify-items: center;
}
#previewModal .modal-content.preview-wide,
#pnpkiDocumentModal .modal-content.preview-wide {
  display: flex;
  flex-direction: column;
  width: min(1280px, 90vw);
  max-width: calc(100vw - 32px);
  height: min(85vh, calc(100dvh - 32px));
  max-height: min(85vh, calc(100dvh - 32px));
  overflow: hidden;
  gap: 0;
  padding: 0;
  border-radius: 16px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 24px 48px -8px rgba(15, 23, 42, 0.28);
}
/* PNPKI document viewer: taller modal so PDF is the primary focus */
#pnpkiDocumentModal .modal-content.preview-wide.pnpki-document-modal {
  height: min(90vh, calc(100dvh - 24px));
  max-height: min(90vh, calc(100dvh - 24px));
  width: min(1360px, 94vw);
}
#previewModal .modal-header,
#pnpkiDocumentModal .modal-header {
  flex-shrink: 0;
  position: relative;
  z-index: 6;
  background: var(--panel);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
#previewModal .modal-header h3,
#previewTitle,
#pnpkiDocumentTitle {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}
#previewModal #previewBody {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #fff;
}
#pnpkiDocumentModal .pnpki-document-body {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  max-height: none;
  overflow: hidden; /* one scrollbar only — inside the PDF embed */
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: #e5e7eb;
}
#previewModal #previewBody > .pff-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.modal.hidden { display: none; }
.modal-header { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.modal-header-actions { display: flex; align-items: center; gap: 8px; }
.modal-body { display: grid; gap: 12px; background: #fff; }
.modal-body iframe, .modal-body img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.share-input { display: grid; grid-template-columns: 1fr 180px auto; gap: 8px; }
.shared-list { display: grid; gap: 8px; }
.shared-item {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fafafa;
}
.perm-badge {
  font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid #cbd5e1; color: #0f172a; background: #e2e8f0;
}
.shared-actions { display: inline-flex; gap: 6px; }

/* Sidebar collapse */
.app[data-collapsed="true"] { grid-template-columns: 72px minmax(0, 1fr); }
.sidebar[data-collapsed="true"] { }
.sidebar[data-collapsed="true"] .nav-item span { display: none; }
.sidebar[data-collapsed="true"] .brand.in-sidebar .clsu-brand-text { display: none; }
.sidebar[data-collapsed="true"] .brand.in-sidebar .brand-name { display: none; }
.sidebar[data-collapsed="true"] .sidebar-footer button span { display: none; }
.sidebar[data-collapsed="true"] .sidebar-footer { justify-items: center; }
.app { grid-template-columns: 260px minmax(0, 1fr); }
.sidebar[data-collapsed="true"] ~ .main { }

/* User dropdown */
.user-menu { position: relative; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  width: min(240px, calc(100vw - 24px)); max-width: calc(100vw - 24px); box-shadow: 0 12px 30px rgba(0,0,0,.1);
  z-index: 100; overflow: hidden;
  padding: 6px;
}
.ud-header {
  padding: 12px; display: flex; align-items: center; gap: 12px;
}
.ud-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--highlight-border), var(--accent-600));
  background-size: cover; background-position: center;
}
.ud-info { min-width: 0; }
.ud-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ud-email { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ud-divider { height: 1px; background: var(--border); margin: 4px 0; }
.ud-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: none; background: none; border-radius: 8px;
  cursor: pointer; color: var(--text); font-size: 13px; font-weight: 500;
  transition: background .1s;
}
.ud-item:hover { background: var(--hover); }
.ud-item svg { width: 16px; height: 16px; color: var(--muted); }
.ud-item.ud-logout { color: var(--danger); }
.ud-item.ud-logout svg { color: var(--danger); }

/* Profile Modal Styles */
.profile-modal { width: min(440px, calc(100vw - 32px)) !important; max-width: calc(100vw - 32px); }
.profile-avatar-edit {
  display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 8px;
}
.profile-preview-wrap {
  position: relative; width: 100px; height: 100px; border-radius: 50%;
  overflow: hidden; cursor: pointer; border: 2px solid var(--border);
}
.profile-preview-wrap img { width: 100%; height: 100%; object-fit: cover; }
.profile-preview-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.4);
  color: white; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; opacity: 0; transition: opacity 0.2s;
}
.profile-preview-wrap:hover .profile-preview-overlay { opacity: 1; }
.profile-preview-overlay svg { width: 20px; height: 20px; }
.profile-preview-overlay span { font-size: 11px; font-weight: 600; }

.password-rules { line-height: 1.4; padding: 4px 0; }

/* Make lucide icons clearer and consistent */
.icon-btn svg, .sidebar-nav svg, .topbar svg, .file-actions svg, .card-head svg {
  width: 18px; height: 18px; stroke-width: 2;
  display: block;
}
.icon-btn { color: var(--text); }
.file-actions .icon-btn { width: 32px; height: 32px; padding: 0; }

.mobile-only { display: none; }

@media (max-width: 1100px) {
  .app { grid-template-columns: 220px minmax(0, 1fr); }
  .grid-view .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 72px minmax(0, 1fr); }
  .nav-item span { display: none; }
  .grid-view .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-head, .table-row { grid-template-columns: 2fr 1fr 160px; }
  .table-head div:nth-child(3), .table-row div:nth-child(3) { display: none; } /* Hide Modified */
}

@media (max-width: 768px) {
  .mobile-only { display: flex; }
  
  .app { grid-template-columns: minmax(0, 1fr); position: relative; }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(280px, calc(100vw - 48px));
    height: 100%;
    height: 100dvh;
    z-index: 200;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,0.1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.mobile-show { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 150; backdrop-filter: blur(2px);
  }
  .sidebar-backdrop.hidden { display: none; }
  
  .nav-item span { display: inline; }
  .sidebar[data-collapsed="true"] .nav-item span { display: inline; }
  
  .main { padding: 8px; gap: 8px; }
  .topbar { grid-template-columns: auto 1fr auto; padding: 8px; gap: 8px; border-radius: 8px; }
  .topbar-actions .icon-left-btn span { display: none; }
  .topbar-actions .icon-left-btn { width: 44px; height: 44px; padding: 0; justify-content: center; }
    .topbar-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
    
    .toolbar { grid-template-columns: 1fr; gap: 10px; padding: 8px; border-radius: 8px; }
    .toolbar .right { display: flex; justify-content: space-between; align-items: center; width: 100%; flex-wrap: wrap; }
  
  .table-head, .table-row { grid-template-columns: 1fr auto; }
  .table-head div:nth-child(2), .table-row div:nth-child(2) { display: none; } /* Hide Owner */
  .table-head { font-size: 11px; padding: 8px; }
  .table-body .table-row { padding: 8px; }
  
  .grid-view .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .card { padding: 8px; gap: 4px; }
  .card .card-title { font-size: 13px; }
  
  .detail-panel { width: 100%; z-index: 300; }
  
  .share-input { grid-template-columns: 1fr; }
  .share-add-row { flex-direction: column; align-items: stretch; }
  .share-add-btn { width: 100%; justify-content: center; }
  
  .modal .modal-content { padding: 16px; width: 95%; }
  .pff-toolbar { padding: 8px; flex-wrap: wrap; }
  
  .primary-btn, .danger-btn, .icon-left-btn, .secondary-btn { height: 44px; padding: 0 16px; font-size: 14px; }
  .icon-btn { width: 44px; height: 44px; }
}

@media (max-width: 480px) {
  .auth-card { width: 100%; border-radius: 0; border: none; box-shadow: none; height: 100%; display: flex; flex-direction: column; justify-content: center; }
  .topbar { grid-template-columns: auto 1fr; }
  .topbar-actions { justify-content: flex-end; }
}

/* Sidebar Folder Tree ─────────────────────────────────────────────────── */
.folder-tree {
  display: grid;
  gap: 1px;
  margin-top: 2px;
  margin-bottom: 4px;
  max-height: 320px; /* Approximately 10 folders height */
  overflow-y: auto;
  padding-right: 4px;
}
.folder-tree::-webkit-scrollbar {
  width: 4px;
}
.folder-tree::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.folder-tree:hover::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}
.folder-tree.hidden {
  display: none;
}
.folder-tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted, #555);
  user-select: none;
  transition: background 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-tree-item:hover {
  background: var(--hover, #f3f4f6);
}
.folder-tree-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}
.folder-tree-item svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}
.folder-tree-item .folder-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-tree-item .toggle-btn {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  color: #999;
  font-size: 10px;
}
.folder-tree-item .toggle-btn:hover {
  background: rgba(0,0,0,0.08);
}
.folder-tree-children {
  display: grid;
  gap: 1px;
}
.sidebar[data-collapsed="true"] .folder-tree { display: none; }

/* ── Drag and Drop ───────────────────────────────────────────────────────── */
.dragging {
  opacity: 0.4;
  cursor: grabbing;
}
.folder-tree-item.drag-over,
.nav-item.drag-over {
  background: var(--highlight-light) !important;
  color: var(--highlight-dark) !important;
  outline: 2px dashed var(--accent-600);
  outline-offset: -2px;
}
.table-row[draggable="true"],
.card[draggable="true"] {
  cursor: grab;
}
.table-row[draggable="true"]:active,
.card[draggable="true"]:active {
  cursor: grabbing;
}

/* ── Share Modal ─────────────────────────────────────────────────────────── */
.share-modal-content {
  width: 520px;
  max-width: 100%;
}
@media (max-width: 768px) {
  .share-modal-content { width: 100%; min-width: 0; }
}
.share-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.share-modal-title svg {
  width: 18px;
  height: 18px;
  color: var(--accent-600);
  flex-shrink: 0;
}
.share-modal-title h3 { margin: 0; font-size: 15px; font-weight: 600; }
.share-modal-title p  { margin: 0; font-size: 12px; }

.share-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.share-email-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  transition: border-color 0.15s;
}
.share-email-wrap:focus-within {
  border-color: var(--accent-600);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.share-email-wrap svg { width: 14px; height: 14px; color: #9ca3af; flex-shrink: 0; }
.share-email-wrap input {
  border: none;
  outline: none;
  padding: 8px 0;
  font-size: 13px;
  width: 100%;
  background: transparent;
}
.perm-select {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  color: var(--text, #111);
}
.share-add-btn {
  padding: 8px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.share-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin-bottom: 8px;
}
.shared-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
}
.share-empty {
  padding: 12px 0;
  text-align: center;
}
.shared-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  transition: background 0.12s;
}
.shared-item:hover { background: #f3f4f6; }
.shared-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-600);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.shared-item-info {
  flex: 1;
  min-width: 0;
}
.shared-item-email {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shared-item-perm {
  font-size: 11px;
  color: #6b7280;
  margin-top: 1px;
}
.perm-badge-view {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--highlight-light);
  color: var(--highlight-dark);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
}
.perm-badge-edit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f0fdf4;
  color: #15803d;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
}
.perm-badge-comment {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fffbeb;
  color: #b45309;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
}
.perm-badge-owner {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fdf4ff;
  color: #7e22ce;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
}

/* Toast Animations */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-12px) scale(0.95); }
}

.shared-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.shared-item-actions select {
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  padding: 3px 6px;
  background: #fff;
  cursor: pointer;
}
.shared-item-actions .remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.12s, background 0.12s;
}
.shared-item-actions .remove-btn:hover {
  color: #ef4444;
  background: #fef2f2;
}
.shared-item-actions .remove-btn svg { width: 14px; height: 14px; }
.share-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.secondary-btn {
  padding: 7px 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: var(--text, #111);
  transition: background 0.12s;
}
.secondary-btn:hover { background: #f9fafb; }

/* ── Permission Chips (inline on cards/rows) ─────────────────────────────── */
.perm-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.chip-view { background: var(--accent-light); color: var(--accent); }
.chip-edit { background: #f0fdf4; color: #15803d; }
.chip-comment { background: #fffbeb; color: #b45309; }
.chip-owner { background: #fdf4ff; color: #7e22ce; }

/* ── App Loading State ───────────────────────────────────────────────────── */
body.app-loading::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  z-index: 9998;
}
body.app-loading::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border: 3px solid var(--accent-light);
  border-top-color: var(--accent-600);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  z-index: 9999;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ── Detail Panel Redesign ───────────────────────────────────────────────── */
.detail-section {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  overflow: visible;
}
.detail-info-grid {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}
.detail-info-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 8px;
}
.detail-info-label {
  font-size: 12px;
  color: #6b7280;
}
.detail-info-value {
  font-size: 13px;
  color: var(--text, #0f172a);
  word-break: break-all;
  white-space: normal;
}
.detail-access-list { padding: 10px 12px; }
.detail-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  padding: 10px 12px 8px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.detail-section-title svg { width: 13px; height: 13px; }

.detail-access-list {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-access-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-access-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-600);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.detail-access-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.detail-access-email {
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-info-grid {
  padding: 4px 0;
}
.detail-info-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: start;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}
.detail-info-row:last-child { border-bottom: none; }
.detail-info-label {
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  padding-top: 1px;
}
.detail-info-value {
  color: var(--text, #111);
  font-size: 12px;
  word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PDF FORM FILLER — appended only, nothing above is modified
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Outer wrap fills the modal body */
.pff-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: #0a0818;
  overflow: hidden;
}

/* Native browser PDF preview (no PDF.js canvas / AcroForm overlays) */
.pff-wrap--native-preview {
  background: #111827;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.pff-wrap--native-preview .pff-toolbar {
  flex-shrink: 0;
}
.pff-wrap--native-preview .pff-native-chrome {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--border, #e5e7eb);
  max-height: min(36vh, 280px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.pff-wrap--native-preview .pff-submission-panel {
  background: #f8fafc;
  border-bottom: none;
}
.pff-native-pdf-frame-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #1f2937;
  position: relative;
}
.pff-wrap--native-preview .pff-native-pdf-frame-wrap {
  /* Fill remaining modal height — do not grow inside a page scroll */
  flex: 1 1 auto;
  min-height: 0;
}
.pff-native-pdf-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  object-fit: unset;
}
#previewModal #previewBody.modal-body {
  display: flex;
  gap: 0;
}
#previewModal .pff-native-pdf-frame {
  height: 100%;
  min-height: 0;
}

/* Toolbar — sticky at top of modal content (sibling of .pff-scroll-body) */
.pff-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: #0f0d22;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 4;
}
.pff-actions { display: flex; gap: 8px; align-items: center; }
.pff-template-btn {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #c4b5fd;
  padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.pff-template-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.pff-save-btn {
  padding: 6px 18px;
  border-radius: 7px;
  border: none;
  background: #7c3aed;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.pff-hint {
  font-size: 12px;
  color: #7c6fa0;
}
.pff-draft-status {
  font-size: 12px;
  font-weight: 600;
  color: #a78bfa;
  white-space: nowrap;
}
.pff-draft-status[data-state="saving"] {
  color: #c4b5fd;
}
.pff-draft-status[data-state="saved"],
.pff-draft-status[data-state="idle"] {
  color: #86efac;
}
.pff-draft-status[data-state="error"] {
  color: #fca5a5;
}
.pff-mobile-hint {
  display: none;
  font-size: 11px;
  color: #7c6fa0;
}
.pff-zoom-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pff-zoom-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #e9d5ff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.pff-zoom-btn:hover {
  background: rgba(255,255,255,0.12);
}
.pff-mobile-fields {
  flex-shrink: 0;
  background: #0f0d22;
  border-top: 1px solid rgba(255,255,255,0.08);
  max-height: 40vh;
  display: flex;
  flex-direction: column;
}
.pff-mobile-fields-toggle {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: #1e1b4b;
  color: #c4b5fd;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.pff-mobile-fields-list {
  overflow-y: auto;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}
.pff-mobile-field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #a78bfa;
}
.pff-mobile-field-row input {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: #fff;
  color: #111;
  font-size: 16px;
}
.pff-save-fab {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1200;
  padding: 14px 20px;
  border-radius: 999px;
  border: none;
  background: #7c3aed;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pff-save-fab svg {
  width: 18px;
  height: 18px;
}
.pff-save-fab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pff-save-fab:active {
  transform: scale(0.98);
}
.pff-save-btn:hover    { background: #6d28d9; }
.pff-save-btn:disabled { opacity: .55; cursor: default; }

/* Scrollable page area */
.pff-page-area {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  gap: 20px;
  background: #0a0818;
}

/* Single scroll region under sticky toolbar: upload + validation + form pages */
.pff-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}
.pff-scroll-body .pff-form-header,
.pff-scroll-body .pff-form-header--applicant {
  max-height: none;
  overflow: visible;
  flex-shrink: 0;
}
.pff-scroll-body .pff-page-area {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}

.pff-form-header {
  flex-shrink: 0;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.pff-form-header--applicant {
  max-height: none;
  overflow: visible;
}

.pff-doc-uploads--prominent {
  background: #eff6ff;
  border-bottom: 2px solid #93c5fd;
  box-shadow: inset 0 -1px 0 rgba(37, 99, 235, 0.12);
}

.pff-doc-uploads--prominent .pff-doc-upload-label {
  font-size: 14px;
  color: #1e3a8a;
}

.pff-doc-uploads--prominent .pff-file-choose-btn {
  border-color: #60a5fa;
  background: #dbeafe;
  color: #1d4ed8;
}

.pff-doc-uploads--prominent .pff-file-choose-btn:hover {
  background: #bfdbfe;
}

.pff-wrap--applicant {
  background: #f8fafc;
}

.pff-applicant-fields {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 16px;
}

.pff-applicant-fields-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
}

.pff-applicant-fields-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pff-applicant-field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pff-applicant-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
}

.pff-applicant-field-row input[type="text"] {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}

.pff-applicant-field-group {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.pff-applicant-field-group legend {
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
}

.pff-applicant-choice-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
  margin-top: 6px;
}
.pff-applicant-sex-hint {
  margin: 0 0 4px;
}
.pff-applicant-org-unit-row {
  margin-top: 8px;
}
.pff-applicant-org-unit-hint {
  margin: 0 0 6px;
}
.pff-applicant-org-unit-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
}
.pff-applicant-org-unit-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  min-height: 42px;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pff-applicant-org-unit-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* 4P Organizational Unit — exact PDF cell; shrink font, never grow the box */
.pff-text-input.pff-org-unit-overlay,
textarea.pff-text-input.pff-org-unit-overlay,
textarea.pff-text-input[data-field-name="4P"],
textarea.pff-text-input[name="4P"] {
  display: block;
  box-sizing: border-box;
  color: #141820;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 500;
  letter-spacing: 0;
  border-radius: 0;
  padding: 0 5px !important;
  resize: none;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  word-break: normal;
  overflow-wrap: normal;
  line-height: normal;
  background: transparent;
}
.pff-wrap--online-draft .pff-text-input.pff-org-unit-overlay {
  background: transparent;
}
.pff-wrap--online-draft .pff-text-input.pff-org-unit-overlay:hover {
  background: rgba(37, 99, 235, 0.06);
}
.pff-wrap--online-draft .pff-text-input.pff-org-unit-overlay:focus {
  background: rgba(255, 255, 255, 0.95);
}

/* Submitted application preview — clean read-only PDF view without edit chrome */
.pff-wrap--submitted-readonly .pff-text-input {
  pointer-events: none;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  outline: none !important;
}
/* Keep dedicated □ + ✓ overlays visible (do not fall back to template PDF marks). */
.pff-wrap--submitted-readonly .pff-checkbox:not(.pff-sex-overlay),
.pff-wrap--submitted-readonly .pff-radio:not(.pff-sex-overlay) {
  pointer-events: none;
  cursor: default;
  appearance: none;
  -webkit-appearance: none;
  opacity: 1 !important;
  background-color: #ffffff !important;
  border: 1.5px solid #1f2937 !important;
  box-shadow: none !important;
  outline: none !important;
  border-radius: 0;
}
.pff-wrap--submitted-readonly .pff-checkbox:not(.pff-sex-overlay):checked,
.pff-wrap--submitted-readonly .pff-radio:not(.pff-sex-overlay):checked {
  background-color: #ffffff !important;
  border-color: #111827 !important;
}
.pff-wrap--submitted-readonly .pff-checkbox:not(.pff-sex-overlay):checked::after,
.pff-wrap--submitted-readonly .pff-radio:not(.pff-sex-overlay):checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  font-size: 78%;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}
.pff-wrap--submitted-readonly .pff-field-required.pff-text-input,
.pff-wrap--submitted-readonly .pff-wrap--required-outlines .pff-text-input.pff-field-required {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
.pff-wrap--submitted-readonly .pff-applicant-field-group.pff-field-required {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
.pff-applicant-reopen-row .application-incomplete-banner {
  margin: 0;
}

.pff-required-star {
  color: #dc2626;
}

/* Official required PNPKI fields — match Signature: 1px border only.
   Text inputs use solid white fill to cover thick red boxes printed in the PDF. */
.pff-wrap--required-outlines .pff-text-input.pff-field-required,
.pff-wrap--required-outlines .pff-text-input.pff-org-unit-overlay.pff-field-required {
  box-sizing: border-box !important;
  border: 1px solid #dc2626 !important;
  outline: none !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  background-color: #ffffff !important;
  border-radius: 0 !important;
}
/* Never paint red borders on checkbox/radio overlays during fill-up.
   Those tiny red squares are the bug applicants keep reporting near Gender. */
.pff-wrap--required-outlines .pff-checkbox,
.pff-wrap--required-outlines .pff-radio,
.pff-wrap--required-outlines .pff-checkbox.pff-field-required,
.pff-wrap--required-outlines .pff-radio.pff-field-required {
  box-sizing: border-box !important;
  border: 1.5px solid #1f2937 !important;
  outline: none !important;
  box-shadow: none !important;
  background-color: #ffffff !important;
  border-radius: 0 !important;
}
/* 4E Gender: red outline only — no black □ chrome. */
.pff-wrap--required-outlines .pff-sex-overlay.pff-field-required {
  box-sizing: border-box !important;
  border: 1px solid #dc2626 !important;
  outline: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
  border-radius: 0 !important;
}
.pff-wrap--required-outlines .pff-photo-zone.pff-field-required,
.pff-wrap--required-outlines .pff-sig-zone.pff-field-required {
  box-sizing: border-box !important;
  border: 1px solid #dc2626 !important;
  outline: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
  border-radius: 0 !important;
}
.pff-wrap--required-outlines .pff-text-input.pff-field-required:hover,
.pff-wrap--required-outlines .pff-text-input.pff-org-unit-overlay.pff-field-required:hover,
.pff-wrap--required-outlines .pff-text-input.pff-field-required:focus,
.pff-wrap--required-outlines .pff-text-input.pff-org-unit-overlay.pff-field-required:focus {
  border: 1px solid #b91c1c !important;
  outline: none !important;
  box-shadow: none !important;
  background-color: #ffffff !important;
}
.pff-field-required.pff-applicant-field-group {
  box-sizing: border-box;
  border: 1px solid #dc2626 !important;
  box-shadow: none;
  background-color: rgba(254, 242, 242, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
}
.pff-wrap--required-outlines .pff-text-input.pff-field-required,
.pff-wrap--required-outlines .pff-text-input.pff-org-unit-overlay.pff-field-required {
  padding: 0 5px !important;
  overflow: hidden !important;
  text-overflow: clip !important;
}
.pff-required-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #991b1b;
  font-weight: 600;
}
.pff-required-legend::before {
  content: '';
  width: 14px;
  height: 10px;
  border: 1px solid #dc2626;
  border-radius: 1px;
  background: transparent;
  flex-shrink: 0;
}

.pff-applicant-sex-row {
  margin-top: 4px;
}

.pff-applicant-media-host {
  width: 100%;
}

.pff-applicant-media-zone {
  border: 1px dashed #c4b5fd;
  border-radius: 8px;
  background: #faf5ff;
  cursor: pointer;
}

/* One PDF page (canvas + overlay stacked) */
.pff-page-slot {
  position: relative;
  flex-shrink: 0;
  margin: 0 auto 18px;
  overflow: hidden;
}
.pff-page {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  box-shadow: 0 4px 32px rgba(0,0,0,.5);
  transform-origin: 0 0;
}
.pff-page canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Overlay — exact same box as the canvas */
.pff-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none; /* children opt-in */
}

/* Transparent text input overlaid on a PDF text field */
.pff-text-input {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 5px;
  color: #141820;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 500;
  pointer-events: auto;
  cursor: text;
  border-radius: 0;
  transition: background .1s, box-shadow .1s, border-color .1s;
  line-height: normal;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  min-width: 0;
  min-height: 0;
  z-index: 20;
}
.pff-text-input:hover {
  background: rgba(37, 99, 235, 0.06);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.35);
}
.pff-text-input:focus {
  background: rgba(37, 99, 235, 0.08);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.55);
}

.pff-checkbox, .pff-radio {
  position: absolute;
  margin: 0;
  padding: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  border: 1.5px solid #1f2937;
  border-radius: 0;
  background-color: #ffffff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70% 70%;
  z-index: 5;
  pointer-events: auto;
  min-width: 0;
  min-height: 0;
}
.pff-checkbox:checked, .pff-radio:checked {
  background-color: #ffffff;
  border-color: #111827;
  background-image: none;
}
.pff-checkbox:hover, .pff-radio:hover {
  outline: none;
  border-color: #111827;
}
.pff-checkbox:disabled, .pff-radio:disabled {
  cursor: default;
  opacity: 0.85;
}

/* Photo / Signature dashed zone — keep PDF borders visible */
.pff-photo-zone,
.pff-sig-zone {
  position: absolute !important;
  box-sizing: border-box;
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0;
  border: 1px dashed rgba(37, 99, 235, 0.35);
  background: transparent;
  min-width: 0;
  min-height: 0;
  transition: border-color .15s, background .15s;
  z-index: 5;
}
.pff-photo-zone:hover,
.pff-sig-zone:hover {
  border-color: rgba(37, 99, 235, 0.7);
  background: rgba(37, 99, 235, 0.04);
}
.pff-zone-label {
  font-size: 10px;
  color: #6b7280;
  text-align: center;
  padding: 2px;
  pointer-events: none;
  user-select: none;
}

/* Passport ID Photo — cover-fit, independent of signature */
.pff-photo-img,
.pff-photo-zone .pff-zone-img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  object-fit: cover;
  object-position: center 28%;
}

/* Signature — contain + absolute center; never reuse photo cover rules */
.pff-sig-zone {
  display: block;
  background: #ffffff;
}
.pff-sig-img,
.pff-sig-zone .pff-zone-img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  max-width: 92%;
  max-height: 92%;
  display: block;
  pointer-events: none;
  object-fit: contain;
  object-position: center center;
}

/* Field boundary inspection mode */
.pff-wrap--inspect .pff-text-input,
.pff-wrap--inspect .pff-checkbox,
.pff-wrap--inspect .pff-radio,
.pff-wrap--inspect .pff-photo-zone,
.pff-wrap--inspect .pff-sig-zone {
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.9) !important;
  background: rgba(220, 38, 38, 0.08) !important;
}
.pff-zoom-btn.is-active {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.55);
}

/* ── Admin Dashboard — green & yellow theme ─────────────────────────────── */
.admin-container,
.applications-container,
.application-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px 24px;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #eef2f7;
  background: linear-gradient(180deg, var(--highlight-light) 0%, #f7faf5 120px, var(--bg) 280px);
}

.activity-logs-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 20px;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #eef2f7;
  background: linear-gradient(180deg, var(--highlight-light) 0%, #f7faf5 120px, var(--bg) 280px);
}
.admin-container::-webkit-scrollbar,
.applications-container::-webkit-scrollbar,
.application-container::-webkit-scrollbar,
.activity-logs-container::-webkit-scrollbar {
  width: 10px;
}
.admin-container::-webkit-scrollbar-thumb,
.applications-container::-webkit-scrollbar-thumb,
.application-container::-webkit-scrollbar-thumb,
.activity-logs-container::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
  border: 2px solid #eef2f7;
}
.admin-container::-webkit-scrollbar-thumb:hover,
.applications-container::-webkit-scrollbar-thumb:hover,
.application-container::-webkit-scrollbar-thumb:hover,
.activity-logs-container::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
.admin-container::-webkit-scrollbar-track,
.applications-container::-webkit-scrollbar-track,
.application-container::-webkit-scrollbar-track,
.activity-logs-container::-webkit-scrollbar-track {
  background: #eef2f7;
  border-radius: 999px;
}
/* Legacy inner scroll helper — avoid nested scroll unless explicitly needed */
.admin-panel-scroll {
  overflow: visible;
  overscroll-behavior: auto;
}
.admin-panel-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.admin-header-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--accent-border);
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--highlight-light) 100%);
  box-shadow: 0 2px 10px rgba(22, 163, 74, 0.06);
  flex-shrink: 0;
}
.admin-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}
.admin-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.admin-updated-label {
  color: var(--muted);
}
.admin-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--accent-border);
}
.admin-storage-indicator:not(:empty)::before {
  content: '·';
  margin-right: 6px;
  color: var(--border);
}
.admin-live-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-600);
  animation: admin-live-pulse 1.5s ease-in-out infinite;
}
.admin-live-indicator.admin-live-reconnecting {
  color: var(--highlight-dark);
}
.admin-live-indicator.admin-live-reconnecting::before {
  background: var(--highlight);
  animation: none;
}
@keyframes admin-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.admin-card {
  background: var(--panel);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.06);
  overflow: hidden;
}
.panel-loading,
.panel-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.admin-charts-card {
  padding: 16px 20px 20px;
  margin-top: 0;
  flex-shrink: 0;
}
.admin-charts-scroll {
  margin-top: 8px;
  padding-right: 2px;
}
.admin-charts-card .admin-bottleneck-callout {
  flex-shrink: 0;
}
.admin-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.admin-chart-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.admin-chart-card-wide {
  grid-column: 1 / -1;
}
.admin-chart-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: #14532d;
}
.admin-chart-desc {
  margin: 0 0 14px;
}
.admin-donut-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.admin-donut {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.admin-donut-hole {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #14532d;
  line-height: 1.1;
}
.admin-donut-hole small {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.admin-chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 180px;
}
.admin-chart-legend-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  padding: 4px 0;
}
.admin-chart-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.admin-chart-legend-value {
  font-weight: 600;
  color: #14532d;
}
.admin-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 36px;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.12s ease;
}
.admin-bar-row:hover {
  background: var(--highlight-light);
}
.admin-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: #365314;
}
.admin-bar-track {
  height: 12px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}
.admin-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .35s ease;
}
.admin-bar-count {
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  color: #14532d;
}
.admin-trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 140px;
  padding-top: 8px;
}
.admin-trend-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.admin-trend-bar-wrap {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.admin-trend-bar {
  width: 100%;
  max-width: 42px;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--highlight) 0%, var(--accent) 100%);
  transition: height .35s ease;
}
.admin-trend-label {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.admin-bottleneck-callout {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--highlight-border);
  background: var(--highlight-light);
  color: #713f12;
  font-size: 13px;
}
.admin-updated-at {
  display: block;
  margin-top: 12px;
}
.admin-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  min-height: 72px;
  flex-shrink: 0;
}
.admin-status-grid-7 {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}
.admin-status-grid-6 {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}
.admin-status-grid-5 {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.admin-status-card-static {
  cursor: default;
}
.admin-status-card-static:hover {
  border-color: var(--border);
  box-shadow: none;
}
.admin-status-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  width: 100%;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.admin-status-card:hover {
  border-color: var(--accent-border);
  background: #fffef5;
}
.admin-status-card.active {
  border-color: var(--accent-600);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
  background: var(--accent-light);
}
.admin-status-card[data-status="all"] {
  background: linear-gradient(145deg, #fff 0%, var(--accent-light) 100%);
  border-color: var(--accent-border);
}
.admin-status-card[data-status="all"] .admin-status-value { color: var(--accent); }
.admin-status-card[data-status="incomplete"] {
  background: #fffbeb;
  border-color: #fde68a;
}
.admin-status-card[data-status="incomplete"] .admin-status-value { color: var(--highlight-dark); }
.admin-status-card[data-status="pending"] {
  background: var(--highlight-light);
  border-color: var(--highlight-border);
}
.admin-status-card[data-status="pending"] .admin-status-value { color: var(--highlight-dark); }
.admin-status-card[data-status="registered"] {
  background: var(--accent-light);
  border-color: var(--accent-border);
}
.admin-status-card[data-status="registered"] .admin-status-value { color: var(--accent); }
.admin-status-card[data-status="expired"] {
  background: #fef2f2;
  border-color: #fecaca;
}
.admin-status-card[data-status="expired"] .admin-status-value { color: #b91c1c; }
.admin-status-card[data-status="approved"] {
  background: #bbf7d0;
  border-color: #4ade80;
}
.admin-status-card[data-status="approved"] .admin-status-value { color: #14532d; }
.admin-status-card[data-status="history"] {
  background: #f0f9ff;
  border-color: #bae6fd;
}
.admin-status-card[data-status="history"] .admin-status-value { color: #0369a1; }
.admin-status-card[data-status="rejected"] {
  background: #fef3c7;
  border-color: #fcd34d;
}
.admin-status-card[data-status="rejected"] .admin-status-value { color: #92400e; }
.admin-status-card[data-status="under_review"] {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.admin-status-card[data-status="under_review"] .admin-status-value { color: #4338ca; }
.admin-status-card.active[data-status="pending"] {
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.35);
}
.admin-status-card.active[data-status="approved"],
.admin-status-card.active[data-status="registered"],
.admin-status-card.active[data-status="all"] {
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
}
.admin-status-card-error {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
}
.admin-status-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.admin-status-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 600;
}
.admin-users-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  flex: 0 0 auto;
  overflow: visible;
}
.admin-users-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 0 0 auto;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.admin-users-scroll-hint {
  margin: 0;
  font-size: 12px;
}
.admin-users-scroll-hint.hidden {
  display: none;
}
.admin-dashboard-lower {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 0;
  overflow: visible;
}
.admin-users-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.admin-users-head h3 {
  margin: 0 0 4px;
}
.admin-users-count {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.admin-users-scroll {
  flex: 0 0 auto;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: visible;
}
.admin-users-table-wrap {
  overflow: visible;
  min-width: 0;
}
.admin-container .admin-table-head th,
.applications-container .admin-table-head th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(90deg, var(--accent-light) 0%, var(--highlight-light) 100%);
  box-shadow: 0 1px 0 var(--accent-border);
}
.admin-users-scroll .admin-table-head th {
  position: sticky;
  top: 0;
  z-index: 3;
}
.admin-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table-head {
  background: linear-gradient(90deg, var(--accent-light) 0%, var(--highlight-light) 100%);
  border-bottom: 2px solid var(--accent-border);
}
.admin-table-head th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.admin-table-row {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.admin-table-row:last-child {
  border-bottom: none;
}
.admin-table-row:hover {
  background: var(--highlight-light);
}
.admin-table-row td {
  padding: 14px 16px;
  vertical-align: middle;
}
.admin-user-info {
  display: flex;
  flex-direction: column;
}
.admin-user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.admin-user-email {
  font-size: 12px;
  color: var(--muted);
}
.admin-user-id-display {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}
.admin-status-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.admin-status-select {
  min-width: 120px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--accent-border);
  padding: 0 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}
.admin-status-select:focus {
  border-color: var(--accent-600);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
  outline: none;
}
.admin-status-remarks {
  min-width: 140px;
  flex: 1 1 160px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0 10px;
  font-size: 13px;
  background: #fff;
}
.admin-status-remarks:focus {
  border-color: var(--accent-600);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
  outline: none;
}
.admin-container .primary-btn {
  background: var(--accent-600);
}
.admin-container .primary-btn:hover {
  background: var(--accent);
}
.admin-container .secondary-btn {
  border-color: var(--highlight-border);
  color: var(--highlight-dark);
}
.admin-container .secondary-btn:hover {
  background: var(--highlight-light);
}
.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}
.admin-badge-admin { background: #fdf4ff; color: #7e22ce; }
.admin-badge-user { background: var(--accent-light); color: var(--accent); }
.admin-badge-role-super_admin { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.admin-badge-role-admin { background: #fdf4ff; color: #7e22ce; }
.admin-badge-role-validator { background: #fff7ed; color: #c2410c; }
.admin-badge-role-staff { background: #e0f2fe; color: #0369a1; }
.admin-badge-role-applicant { background: var(--accent-light); color: var(--accent); }
.admin-role-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.admin-user-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.admin-role-select {
  min-width: 130px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0 8px;
  font-size: 13px;
}
.admin-badge-verified { background: #f0fdf4; color: #15803d; }
.admin-badge-unverified { background: #fff7ed; color: #c2410c; }
.admin-badge-applied { background: #f0fdf4; color: #15803d; }
.admin-badge-not-applied { background: #f9fafb; color: #6b7280; }
.admin-badge-pnpki-not_submitted { background: #f9fafb; color: #6b7280; }
.admin-badge-pnpki-submitted { background: var(--highlight-light); color: var(--highlight-dark); }
.admin-badge-pnpki-completed { background: #f0fdf4; color: #15803d; }
.admin-badge-status-incomplete { background: var(--highlight-light); color: var(--highlight-dark); }
.admin-badge-status-pending { background: var(--highlight-light); color: var(--highlight-dark); }
.admin-badge-status-registered { background: var(--accent-light); color: var(--accent); }
.admin-badge-status-expired { background: #fef2f2; color: #b91c1c; }
.admin-badge-status-approved { background: #bbf7d0; color: #14532d; }
.admin-badge-status-rejected { background: var(--highlight-light); color: var(--highlight-dark); border: 1px solid var(--highlight-border); }

/* ── Centralized Storage Management (Admin) ─────────────────────────────── */
.admin-storage-management {
  padding: 0;
}
.admin-storage-management #adminStoragePanelBody {
  padding: 24px 28px 28px;
}
.storage-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.storage-panel-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
}
.storage-account-label {
  margin: 4px 0 0;
}
.storage-fallback-notice {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.storage-connection-badge {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  display: inline-block;
}
.storage-connection-pending {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.storage-connection-ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.admin-storage-indicator.storage-indicator-action {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.admin-storage-cta {
  margin: 12px 0 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.admin-storage-cta--ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.admin-storage-cta--pending {
  background: #fffbeb;
  border-color: #fde68a;
}
.admin-storage-cta-text {
  margin: 0;
  color: #92400e;
  font-size: 0.92rem;
  flex: 1 1 220px;
}
.admin-storage-cta--ok .admin-storage-cta-text {
  color: #065f46;
}
.admin-storage-cta-account {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  opacity: 0.9;
}
.storage-connection-account {
  display: block;
  margin-top: 4px;
  font-weight: 500;
}
.storage-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.storage-stat-card {
  background: linear-gradient(145deg, #fff 0%, var(--accent-light) 100%);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.storage-stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.storage-stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.storage-stat-value.storage-health-ok { color: var(--accent); }
.storage-stat-value.storage-health-bad { color: #b91c1c; }
.storage-stat-meta {
  font-size: 12px;
  color: var(--muted);
}
.storage-recommendation {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: var(--highlight-light);
  border-radius: 8px;
  border: 1px solid var(--highlight-border);
}
.storage-section {
  margin-top: 20px;
}
.storage-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}
.storage-issue-list {
  margin: 0 0 12px;
  padding-left: 20px;
  color: #b91c1c;
  font-size: 13px;
}
.storage-benefits {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}
.storage-backends {
  display: grid;
  gap: 10px;
}
.storage-backend-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fffef8;
}
.storage-backend-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}
.storage-env-hint {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  padding: 4px 8px;
  background: var(--accent-light);
  border-radius: 6px;
  color: var(--accent);
}
.storage-migrate-box {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px dashed var(--highlight-border);
  background: var(--highlight-light);
}
.storage-cli {
  margin: 10px 0 0;
  padding: 12px 14px;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  overflow-x: auto;
}
.storage-cli code { white-space: pre-wrap; word-break: break-all; }
.storage-disk-table { margin-top: 0; }
.storage-loading,
.storage-error {
  padding: 24px;
  text-align: center;
}

.activity-log-modal {
  max-width: 720px;
  width: calc(100% - 32px);
}
.activity-log-modal .modal-header {
  align-items: flex-start;
  gap: 16px;
}
.activity-log-header-text h3 {
  margin: 0 0 4px;
}
.activity-log-header-text p {
  margin: 0;
}
.activity-log-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.activity-log-body {
  max-height: min(60vh, 520px);
  overflow-y: auto;
  padding-top: 8px;
  scrollbar-gutter: stable;
}
.activity-log-purpose {
  margin: 0 0 6px;
  max-width: 42rem;
}
.activity-history-table-wrap {
  margin: 0;
}
.activity-history-table .admin-table-head th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card, #fff);
}
.activity-history-when {
  white-space: nowrap;
}
.activity-log-empty,
.activity-log-error {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
}
.activity-log-error {
  color: #b91c1c;
}
.activity-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.activity-log-item {
  display: flex;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}
.activity-log-item:last-child {
  border-bottom: none;
}
.activity-log-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
}
.activity-log-icon svg {
  width: 18px;
  height: 18px;
}
.activity-log-event-application_status_changed .activity-log-icon {
  background: var(--accent-light);
  color: var(--accent);
}
.activity-log-event-validation_status_changed .activity-log-icon {
  background: #fff7ed;
  color: #c2410c;
}
.activity-log-event-form_saved .activity-log-icon {
  background: #f0fdf4;
  color: #15803d;
}
.activity-log-event-file_uploaded .activity-log-icon {
  background: #eff6ff;
  color: #1d4ed8;
}
.activity-log-event-user_registered .activity-log-icon,
.activity-log-event-user_verified .activity-log-icon {
  background: #f5f3ff;
  color: #6d28d9;
}
.activity-log-event-admin_role_changed .activity-log-icon {
  background: #fef2f2;
  color: #b91c1c;
}
.system-activity-table .system-activity-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.system-activity-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.activity-log-body-inner {
  flex: 1;
  min-width: 0;
}
.activity-log-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.activity-log-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.activity-log-time {
  white-space: nowrap;
}
.activity-log-actor {
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.activity-log-status-change {
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}
.activity-log-from,
.activity-log-to {
  padding: 2px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  font-weight: 600;
  text-transform: capitalize;
}
.activity-log-to {
  background: var(--highlight-light);
  color: var(--highlight-dark);
}
.activity-log-arrow {
  color: var(--muted);
}
.activity-log-meta,
.activity-log-app {
  margin-top: 6px;
}

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

@media (max-width: 900px) {
  .admin-container,
  .applications-container,
  .application-container {
    padding: 20px;
  }
  .admin-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .admin-table-head th,
  .admin-table-row td {
    padding: 12px 12px;
  }
}

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

@media (max-width: 640px) {
  .admin-container,
  .applications-container,
  .application-container {
    padding: 16px;
    gap: 16px;
  }
  .admin-status-grid {
    grid-template-columns: 1fr;
  }
  .admin-donut-wrap {
    justify-content: center;
  }
  .admin-bar-row {
    grid-template-columns: 72px 1fr 28px;
  }

  /* Turn the admin table into stacked cards (not activity logs) */
  .admin-table-wrapper:not(.admin-batch-scroll):not(.activity-logs-records-scroll) { overflow-x: visible; }
  .admin-batch-scroll {
    max-height: min(420px, 55vh);
    overflow: auto;
  }
  .admin-table:not(.activity-logs-table):not(.application-status-batch-table) { display: block; }
  .admin-table:not(.activity-logs-table):not(.application-status-batch-table) thead { display: none; }
  .admin-table:not(.activity-logs-table):not(.application-status-batch-table) tbody { display: grid; gap: 12px; padding: 12px; }
  .admin-table-row {
    display: block;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
  }
  .admin-table-row:hover { background: #fff; }
  .admin-table-row td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
  }
  .admin-table-row td:last-child { border-bottom: none; }
  .admin-table-row td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    flex: 0 0 auto;
    min-width: 92px;
  }
  .admin-user-info { align-items: flex-end; text-align: right; }
  .admin-user-name { font-size: 14px; }
  .admin-user-email { font-size: 12px; }
}

#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  background: #ffffff;
  color: #1f2937;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  border: 1px solid #f3f4f6;
}

/* ── Applicant: My Application status panel ─────────────────────────────────── */
.application-container {
  padding: 24px 28px 40px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.application-header-group { margin-bottom: 20px; }
.application-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 6px;
}
.application-subtitle { margin: 0; }
.application-status-hero {
  background: linear-gradient(135deg, var(--highlight-light) 0%, var(--accent-light) 100%);
  border: 1px solid var(--accent-border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 20px;
}
.application-status-message {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
}
.app-status-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.app-status-incomplete { background: #f3f4f6; color: #4b5563; }
.app-status-pending { background: var(--highlight-light); color: var(--highlight-dark); }
.app-status-registered { background: var(--accent-light); color: var(--accent); }
.app-status-expired { background: #fee2e2; color: #991b1b; }
.app-status-approved { background: #bbf7d0; color: #14532d; }
.app-status-rejected { background: #fee2e2; color: #991b1b; }
.app-status-progress-not_started { background: #f3f4f6; color: #4b5563; }
.app-status-progress-pending { background: #fef3c7; color: #92400e; }
.app-status-progress-applied { background: #bbf7d0; color: #14532d; }
.app-status-progress-expired { background: #fee2e2; color: #991b1b; }
.application-renewal-notice {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.92rem;
}
.application-renewal-eligible {
  background: #e6f7ed;
  border-color: #7fd4a0;
  color: #1E6031;
}
.admin-badge-status-submitted { background: #fef3c7; color: #92400e; }
.admin-badge-status-submitted_to_dict { background: #dbeafe; color: #1d4ed8; }
.admin-badge-status-applied { background: #bbf7d0; color: #14532d; }
.admin-badge-status-expired { background: #fee2e2; color: #991b1b; }
.admin-badge-status-not_submitted { background: #f3f4f6; color: #4b5563; }
.admin-badge-batch-collecting { background: #fef3c7; color: #92400e; }
.admin-badge-batch-submitted_to_dict { background: #dbeafe; color: #1d4ed8; }
.admin-badge-batch-applied { background: #bbf7d0; color: #14532d; }
.admin-badge-batch-rejected { background: #fee2e2; color: #991b1b; }
.admin-user-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.admin-batch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 20px 20px 0;
}
.admin-batch-card {
  padding-bottom: 4px;
  display: flex;
  flex-direction: column;
  max-height: min(560px, 62vh);
  overflow: hidden;
}
.admin-batch-card > .admin-table-wrapper {
  padding: 0 20px 16px;
}
.admin-batch-scroll-body {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: min(420px, 50vh);
  margin: 0 20px 16px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #eef2f7;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.admin-batch-card > .admin-table-wrapper.admin-batch-scroll,
.admin-batch-scroll-body .admin-table-wrapper.admin-batch-scroll {
  margin: 0;
  padding: 0;
  max-height: none;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.applications-container .admin-users-scroll,
.admin-container .admin-users-scroll,
.application-status-container .application-status-records-scroll {
  max-height: min(420px, 48vh);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #eef2f7;
}

.application-status-container .application-status-records-scroll {
  max-height: min(340px, 42vh);
  min-height: 200px;
}

.admin-batch-scroll::-webkit-scrollbar,
.admin-batch-scroll-body::-webkit-scrollbar,
.applications-container .admin-users-scroll::-webkit-scrollbar,
.admin-container .admin-users-scroll::-webkit-scrollbar,
.application-status-records-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.admin-batch-scroll::-webkit-scrollbar-thumb,
.admin-batch-scroll-body::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
  border: 2px solid #eef2f7;
}
.admin-batch-scroll::-webkit-scrollbar-thumb:hover,
.admin-batch-scroll-body::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
.admin-batch-scroll::-webkit-scrollbar-track,
.admin-batch-scroll-body::-webkit-scrollbar-track {
  background: #eef2f7;
  border-radius: 999px;
}
.admin-batch-scroll .admin-table-head th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.admin-batch-scroll-hint {
  margin: 0 20px 8px;
  font-size: 12px;
}
.admin-batch-scroll .admin-batch-table {
  min-width: 980px;
}
.admin-batch-decision-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-batch-count {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.admin-batch-count-approved {
  background: var(--accent-light);
  color: var(--clsu-green-cobra);
  border: 1px solid var(--accent-border);
}
.admin-batch-count-rejected {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.admin-batch-count-review {
  background: #fffbea;
  color: #854d0e;
  border: 1px solid var(--highlight-border);
}
.admin-batch-applicants-row td {
  padding: 0 12px 12px;
  background: rgba(0, 150, 57, 0.02);
  border-top: none;
}
.admin-batch-applicants-details {
  margin: 0;
}
.admin-batch-applicants-details > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--clsu-green-cobra);
  padding: 10px 4px;
  list-style-position: outside;
}
.admin-batch-applicants-details[open] > summary {
  margin-bottom: 8px;
}
.admin-batch-applicants-panel {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.admin-batch-applicants-table {
  min-width: 640px;
}
.admin-batch-applicants-table th,
.admin-batch-applicants-table td {
  font-size: 12px;
  padding: 10px 12px;
}
.admin-batch-applicant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-batch-applicant-actions .primary-btn,
.admin-batch-applicant-actions .danger-btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}
.admin-readonly-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #854d0e;
  background: #fffbea;
  border: 1px solid var(--highlight-border);
}
.application-status-records-scroll {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  flex: 1 1 auto;
  margin: 0;
  max-height: min(340px, 42vh);
  min-height: 200px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  scrollbar-color: #64748b #eef2f7;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.application-status-records-scroll::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.application-status-records-scroll::-webkit-scrollbar-thumb {
  background: #64748b;
  border-radius: 999px;
  border: 2px solid #eef2f7;
}

.application-status-records-scroll::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.application-status-records-scroll::-webkit-scrollbar-track {
  background: #eef2f7;
  border-radius: 999px;
}

.application-status-records-scroll .admin-table-wrapper,
.application-status-records-scroll .application-status-table-wrap {
  overflow: visible;
  border: none;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}

.application-status-records-scroll .application-status-table {
  min-width: 1280px;
  width: max-content;
}

.applications-doc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 180px;
}

.applications-doc-actions .secondary-btn {
  min-height: 32px;
  padding: 0 10px;
}

.applications-doc-name {
  flex: 1 1 100%;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.applications-certificate-note {
  margin: 0;
  padding-top: 4px;
}

.application-status-records-scroll .application-status-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.application-status-container .admin-users-scroll-hint {
  margin: 0 0 10px;
  font-size: 12px;
}

.application-status-container .admin-users-head {
  padding: 0 0 12px;
  margin-bottom: 0;
}

.application-status-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 16px;
}

.application-status-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.application-status-filter-btn.active {
  border-color: var(--clsu-green);
  background: var(--accent-light);
  color: var(--clsu-green-cobra);
  box-shadow: inset 0 0 0 1px var(--clsu-green);
}

.application-status-filter-btn--approved.active {
  border-color: var(--clsu-green);
  background: var(--accent-light);
}

.application-status-filter-btn--rejected.active {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
  box-shadow: inset 0 0 0 1px #f87171;
}

.application-status-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 11px;
  font-weight: 700;
}

.application-status-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.application-status-action-group .primary-btn,
.application-status-action-group .danger-btn {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.application-status-decision-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: default;
}

.application-status-decision-btn--approved {
  background: var(--accent-light);
  color: var(--clsu-green-cobra);
  border-color: var(--accent-border);
}

.application-status-decision-btn--rejected {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.application-status-batch-table-wrap {
  overflow-x: auto;
}

.application-status-batch-table {
  min-width: 720px;
}

.application-status-batch-table th.batch-table-actions-head,
.application-status-batch-table td.batch-table-actions-cell {
  min-width: 200px;
  vertical-align: middle;
}

.application-status-batch-table th.batch-decision-head-cell,
.application-status-batch-table td.batch-decision-status-cell {
  min-width: 150px;
  width: auto;
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
}

.batch-decision-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.batch-decision-status--approved {
  background: rgba(0, 150, 57, 0.12);
  color: var(--clsu-green-cobra, #009639);
  border: 1px solid rgba(0, 150, 57, 0.22);
}

.batch-decision-status--rejected {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.batch-decision-status--pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.batch-decision-status--muted {
  color: var(--muted);
}

.applicant-decision-cell .batch-decision-status {
  margin: 0 auto;
}

.application-batch-approval-hint {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0, 150, 57, 0.06);
  border: 1px solid rgba(0, 150, 57, 0.14);
}

.admin-batch-actions--stacked {
  flex-direction: column;
  align-items: stretch;
}

.application-create-batch-row {
  margin-top: 14px;
}

.application-batch-limit-note {
  margin: 8px 0 0;
}

.applications-panel-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.applications-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.applications-summary-card {
  flex-shrink: 0;
}

.applications-certificate-note {
  margin: 0;
  padding: 0 4px;
}

.admin-export-history-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.export-history-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 8px 24px;
  min-width: 0;
}

.export-history-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 20px;
  padding: 0 2px;
}

.export-history-header-main {
  min-width: 0;
  flex: 1 1 260px;
}

.export-history-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--accent, #009639);
}

.export-history-lead {
  margin: 4px 0 0;
  max-width: 36rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted, #64748b);
}

.export-history-header-stats {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.export-history-stat-card {
  min-width: 108px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
}

.export-history-stat-value {
  display: block;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--clsu-green-cobra, #006b2d);
  font-variant-numeric: tabular-nums;
}

.export-history-stat-label {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.export-history-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.export-history-table-wrap {
  overflow: auto;
  max-height: min(560px, 62vh);
}

.export-history-table th,
.export-history-table td {
  font-size: 0.875rem;
  vertical-align: middle;
}

.export-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.export-history-pagination-wrap {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border, #e2e8f0);
  background: #fafbfc;
}

.export-history-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.export-history-pagination .muted {
  font-size: 0.8125rem;
}

.export-history-status--success,
.export-history-status--completed {
  color: #166534;
  font-weight: 600;
  font-size: 0.8125rem;
}

.export-history-status--failed {
  color: #b91c1c;
  font-weight: 600;
  font-size: 0.8125rem;
}

.export-history-status--partial {
  color: #a16207;
  font-weight: 600;
  font-size: 0.8125rem;
}

.export-history-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted, #64748b);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ── About modal ──────────────────────────────────────────────────── */
#aboutModal {
  z-index: 3650;
}

#aboutModal .about-modal {
  width: min(920px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(90vh, 820px);
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-radius: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  box-sizing: border-box;
}

#aboutModal .about-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  align-items: flex-start;
}

#aboutModal .about-modal-heading h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  letter-spacing: -0.01em;
}

#aboutModal .about-modal-subtitle {
  margin: 4px 0 0;
}

#aboutModal .about-modal-body {
  padding: 20px 24px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #f8fafc;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#aboutModal .about-modal-footer {
  padding: 14px 24px;
  background: #fff;
  border-top: 1px solid var(--border, #e5e7eb);
  display: flex;
  justify-content: flex-end;
}

#aboutModal .about-office-block,
#aboutModal .about-author-section,
#aboutModal .about-author-list,
#aboutModal .about-author-card,
#aboutModal .about-author-meta {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

#aboutModal .about-office-block {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

#aboutModal .about-intro {
  margin: 0 0 12px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--muted, #475569);
  font-weight: 500;
}

#aboutModal .about-office-name,
#aboutModal .about-office-division {
  margin: 0;
  font-weight: 700;
  color: var(--text, #0f172a);
  line-height: 1.4;
}

#aboutModal .about-office-name {
  font-size: 1rem;
}

#aboutModal .about-office-division {
  margin-top: 4px;
  font-size: 0.9rem;
  color: #15803d;
}

#aboutModal .about-author-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#aboutModal .about-section-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}

#aboutModal .about-author-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#aboutModal .about-author-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

#aboutModal .about-author-card--main {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 72%);
  gap: 16px;
  padding: 16px 18px;
}

/* Override global `.modal-body img { width/height: 100% }` which blew up portraits */
#aboutModal .about-author-photo-wrap {
  width: 88px;
  height: 88px;
  flex: 0 0 88px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  background: #f1f5f9;
}

#aboutModal .about-author-card--main .about-author-photo-wrap {
  width: 104px;
  height: 104px;
  flex-basis: 104px;
  border-color: #86efac;
}

#aboutModal .modal-body .about-author-photo,
#aboutModal .about-author-photo {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  object-position: center top;
  border-radius: 50%;
  background: #f1f5f9;
}

#aboutModal .about-author-meta {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#aboutModal .about-author-name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: normal;
}

#aboutModal .about-author-role {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted, #64748b);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#aboutModal .about-author-email {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.8125rem;
  color: var(--accent-600, #009639);
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

#aboutModal .about-author-email:hover {
  text-decoration: underline;
}

@media (max-width: 820px) {
  #aboutModal .about-author-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  #aboutModal .about-modal {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: min(92vh, 760px);
  }

  #aboutModal .about-modal-header,
  #aboutModal .about-modal-body,
  #aboutModal .about-modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  #aboutModal .about-author-card,
  #aboutModal .about-author-card--main {
    gap: 12px;
    padding: 12px 14px;
  }

  #aboutModal .about-author-photo-wrap,
  #aboutModal .about-author-card--main .about-author-photo-wrap {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
  }

  #aboutModal .about-author-name {
    font-size: 0.92rem;
  }
}

/* ── Export Details modal ─────────────────────────────────────────── */
#exportHistoryDetailModal {
  z-index: 3650;
}

.export-details-modal {
  width: min(640px, calc(100vw - 32px));
  max-height: min(88vh, 760px);
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-radius: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.export-details-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  align-items: flex-start;
}

.export-details-modal-heading h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  letter-spacing: -0.01em;
}

.export-details-modal-subtitle {
  margin: 4px 0 0;
}

.export-details-modal-body {
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #f8fafc;
  min-height: 0;
}

.export-details-modal-footer {
  padding: 16px 24px;
  background: #fff;
  border-top: 1px solid var(--border, #e5e7eb);
  display: flex;
  justify-content: flex-end;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.export-details-section {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.export-details-section-title {
  margin: 0 0 16px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}

.export-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  margin: 0;
}

.export-details-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 0;
  min-width: 0;
}

.export-details-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ecfdf5;
  color: #15803d;
  border: 1px solid #bbf7d0;
  flex-shrink: 0;
}

.export-details-item-icon svg {
  width: 18px;
  height: 18px;
}

.export-details-item-icon--status-failed {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.export-details-item-icon--status-partial {
  background: #fffbeb;
  color: #a16207;
  border-color: #fde68a;
}

.export-details-item-body {
  min-width: 0;
}

.export-details-item dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted, #64748b);
  line-height: 1.3;
}

.export-details-item dd {
  margin: 4px 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  line-height: 1.4;
  word-break: break-word;
}

.export-details-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.export-details-status-badge--success,
.export-details-status-badge--completed {
  background: #dcfce7;
  color: #166534;
}

.export-details-status-badge--failed {
  background: #fee2e2;
  color: #991b1b;
}

.export-details-status-badge--partial {
  background: #fef3c7;
  color: #92400e;
}

.export-details-applicant-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.export-details-applicant-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.export-details-applicant-item:last-child {
  border-bottom: none;
}

.export-details-applicant-bullet {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.export-details-applicant-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.export-details-applicant-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  line-height: 1.35;
  word-break: break-word;
}

.export-details-applicant-email {
  font-size: 0.8125rem;
  color: var(--muted, #64748b);
  line-height: 1.35;
  word-break: break-word;
}

.export-details-empty {
  margin: 0;
  padding: 16px;
  text-align: center;
  color: var(--muted, #64748b);
  font-size: 0.875rem;
  border: 1px dashed var(--border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
}

.export-details-error-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.8125rem;
  line-height: 1.45;
  word-break: break-word;
}

@media (max-width: 640px) {
  .export-details-modal {
    width: calc(100vw - 24px);
    max-height: min(92vh, 720px);
  }

  .export-details-modal-body,
  .export-details-section {
    padding: 16px;
  }

  .export-details-modal-header,
  .export-details-modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .export-details-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.applications-export-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 4px 4px 0;
}

.applications-export-actions-bar .secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-export-history-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-export-history-card .admin-reports-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.applications-records-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.applications-records-card .admin-users-head {
  flex-shrink: 0;
}

.applications-records-card .application-status-records-scroll {
  max-height: min(360px, 45vh);
}

.application-status-batch-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.application-status-batch-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(240px, 32vh);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  scrollbar-color: #64748b #eef2f7;
  margin: 0 20px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.application-status-batch-scroll::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.application-status-batch-scroll::-webkit-scrollbar-thumb {
  background: #64748b;
  border-radius: 999px;
  border: 2px solid #eef2f7;
}

.application-status-batch-scroll::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.application-status-batch-scroll::-webkit-scrollbar-track {
  background: #eef2f7;
  border-radius: 999px;
}

.application-status-batch-scroll .application-status-batch-actions {
  padding: 12px 16px;
  min-width: min-content;
}

.application-status-batch-actions .application-create-batch-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.application-status-batch-card--focused {
  box-shadow: 0 0 0 2px var(--clsu-green), 0 8px 24px rgba(0, 150, 57, 0.12);
  transition: box-shadow 0.3s ease;
}

.applications-batch-scroll-hint {
  margin-top: 4px;
}

.application-status-readonly-note {
  padding: 0 20px 16px;
}

.admin-status-card-filter {
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  text-align: left;
}

.admin-status-card-filter.active {
  border-color: var(--clsu-green);
  box-shadow: inset 0 0 0 1px var(--clsu-green);
  background: var(--accent-light);
}

.application-notifications-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.application-notification-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}

.application-notification-item.is-unread {
  border-color: var(--accent-border);
  background: var(--accent-light);
}

.application-notification-title {
  font-weight: 700;
  color: var(--clsu-green-cobra);
  margin-bottom: 4px;
}

.application-notification-message {
  font-size: 13px;
  line-height: 1.45;
}

.application-notification-message--multiline {
  white-space: pre-line;
}
  margin-top: 6px;
}
.admin-batch-card > .muted.small:only-child,
.admin-batch-card > p.muted {
  padding: 20px;
  margin: 0;
}
.admin-batch-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 210px;
}

.admin-batch-actions-decisions {
  width: 100%;
}

.admin-batch-actions-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding-top: 2px;
}

.admin-decision-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.admin-decision-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  min-width: 96px;
  padding: 0 14px;
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.admin-decision-action-btn .admin-decision-icon-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.admin-decision-action-btn--approve {
  color: #fff;
  background: var(--accent-600, #009639);
  border-color: #007a2f;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.admin-decision-action-btn--approve:hover:not(:disabled):not([aria-disabled="true"]) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 150, 57, 0.28);
}

.admin-decision-action-btn--reject {
  color: #fff;
  background: #dc2626;
  border-color: #b91c1c;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.admin-decision-action-btn--reject:hover:not(:disabled):not([aria-disabled="true"]) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.24);
}

.admin-decision-action-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.admin-decision-action-btn:disabled,
.admin-decision-action-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.2);
}

.admin-decision-icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-decision-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  background: var(--panel);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.admin-decision-icon-svg {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
}

.admin-decision-icon-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.admin-decision-icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.admin-decision-icon-btn--approve {
  color: var(--clsu-green-cobra, #009639);
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.admin-decision-icon-btn--approve:hover {
  background: #dcfce7;
  color: #047857;
}

.admin-decision-icon-btn--reject {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.admin-decision-icon-btn--reject:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.admin-decision-icon-btn:disabled,
.admin-decision-icon-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.35);
}

.admin-batch-decision-col {
  min-width: 180px;
  vertical-align: middle;
}

.admin-batch-decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-batch-decision-actions .primary-btn,
.admin-batch-decision-actions .danger-btn {
  min-width: 88px;
}
.tracking-stepper {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.tracking-step {
  position: relative;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.tracking-step-marker {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 2px solid #cbd5e1;
}
.tracking-step-done .tracking-step-marker,
.tracking-step-current .tracking-step-marker {
  background: var(--accent);
  border-color: var(--accent);
}
.tracking-step-current .tracking-step-label {
  color: var(--accent);
  font-weight: 700;
}
.tracking-step-rejected .tracking-step-marker {
  background: #ef4444;
  border-color: #ef4444;
}
.tracking-step-done .tracking-step-label { color: #334155; }
.application-tracking-note { margin-top: 12px; }
.admin-tracking-summary-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.admin-tracking-scroll {
  max-height: min(180px, 20vh);
  min-height: 110px;
  padding: 0 20px 12px;
}
.admin-tracking-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 0;
}
.admin-tracking-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 0 4px;
  min-width: min(100%, 640px);
}
.admin-tracking-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-tracking-card:hover,
.admin-tracking-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-border);
}
.admin-tracking-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}
.admin-tracking-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.admin-badge-tracking-not_started { background: #f3f4f6; color: #4b5563; }
.admin-badge-tracking-submitted { background: #dbeafe; color: #1d4ed8; }
.admin-badge-tracking-under_review { background: var(--highlight-light); color: var(--highlight-dark); }
.admin-badge-tracking-approved { background: #bbf7d0; color: #14532d; }
.admin-badge-tracking-completed { background: #166534; color: #fff; }
.admin-badge-tracking-rejected { background: #fee2e2; color: #991b1b; }
.app-status-validated { background: #bbf7d0; color: #14532d; }
.app-status-needs_review { background: #fee2e2; color: #991b1b; }
.app-status-review_warning { background: var(--highlight-light); color: var(--highlight-dark); }

.admin-badge-validation-validated { background: #bbf7d0; color: #14532d; }
.admin-badge-validation-needs_review { background: #fee2e2; color: #991b1b; }
.admin-badge-validation-review_warning { background: var(--highlight-light); color: var(--highlight-dark); }
.admin-badge-validation-pending { background: #f3f4f6; color: #4b5563; }

.validation-report { font-size: 13px; }
.validation-purpose { margin: 0 0 10px; }
.validation-report-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.validation-score { font-weight: 700; color: var(--accent); }
.validation-benefits {
  margin: 0 0 12px;
  padding-left: 18px;
  color: #365314;
  line-height: 1.5;
}
.validation-check-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.validation-check-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}
.validation-check-pass { border-color: #86efac; background: #f0fdf4; }
.validation-check-warn { border-color: var(--highlight-border); background: var(--highlight-light); }
.validation-check-fail { border-color: #fecaca; background: #fef2f2; }
.validation-check-name { font-weight: 600; }
.validation-check-meta { color: var(--muted); font-size: 12px; }
.validation-issue-group { margin-bottom: 12px; }
.validation-issue-group h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #14532d;
}
.validation-issue-group ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}
.validation-issue {
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.45;
}
.validation-issue-error { background: #fef2f2; border: 1px solid #fecaca; }
.validation-issue-warning { background: var(--highlight-light); border: 1px solid var(--highlight-border); }
.validation-issue-info { background: #f8fafc; border: 1px solid #e2e8f0; }
.validation-issue-sev {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  margin-right: 6px;
  opacity: 0.85;
}
.validation-report-compact .validation-report-head { margin-bottom: 8px; }

.pff-validation-panel {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #fffef5;
  max-height: 220px;
  overflow-y: auto;
}

/* Mandatory document checklist (Task 10) */
.pff-submission-panel {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  flex-shrink: 0;
}
.pff-documents-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pff-documents-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.02em;
}
.pff-doc-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pff-doc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid transparent;
}
.pff-doc-item-ready {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.pff-doc-item-missing {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.pff-doc-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}
.pff-doc-lucide-icon {
  width: 14px;
  height: 14px;
}
.pff-doc-item-ready .pff-doc-icon {
  background: #10b981;
  color: #fff;
}
.pff-doc-item-missing .pff-doc-icon {
  background: #ef4444;
  color: #fff;
}
.pff-doc-item-optional {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}
.pff-doc-item-optional .pff-doc-icon {
  background: #94a3b8;
  color: #fff;
}
.pff-doc-upload-row--primary {
  padding-bottom: 4px;
  border-bottom: 1px dashed #e2e8f0;
}
.pff-doc-label {
  flex: 1;
  font-weight: 600;
}
.pff-doc-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.pff-doc-missing-msg {
  margin: 0;
  font-size: 12px;
  color: #b91c1c;
  line-height: 1.45;
}
.pff-doc-ready-msg {
  margin: 0;
  font-size: 12px;
  color: #047857;
  line-height: 1.45;
}
.pff-doc-uploads {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}
.pff-doc-upload-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pff-doc-upload-label {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}
.pff-doc-upload-row input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pff-file-choose-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 7px;
  border: 1px solid #c4b5fd;
  background: #f5f3ff;
  color: #5b21b6;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pff-file-choose-btn:hover {
  background: #ede9fe;
}
.pff-file-choose-btn:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}
.pff-doc-file-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 12px;
  color: #374151;
}
.pff-doc-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 24px;
}
.pff-doc-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 120px;
}
.pff-doc-card-thumb-wrap {
  position: relative;
  width: 120px;
}
.pff-doc-card-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 88px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
  overflow: hidden;
}
.pff-doc-card-thumb:hover {
  border-color: #c4b5fd;
  box-shadow: 0 0 0 2px rgba(196, 181, 253, 0.35);
}
.pff-doc-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pff-doc-card-name {
  font-size: 11px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pff-doc-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.pff-pnpki-pdf-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pff-pnpki-pdf-status-label {
  word-break: break-word;
}
.pff-pnpki-pdf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.pff-pnpki-pdf-actions .pff-file-choose-btn.is-disabled,
.pff-pnpki-pdf-actions .pff-file-choose-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.pff-pnpki-pdf-hint {
  margin: 8px 0 0;
}
.pff-pnpki-pdf-pending-badge,
.pff-pnpki-pdf-ready-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.pff-pnpki-pdf-pending-badge {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
}
.pff-pnpki-pdf-ready-badge {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.pff-pnpki-pdf-cancel {
  flex-shrink: 0;
}
.pff-doc-viewer-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pff-doc-viewer-open-tab {
  text-decoration: none;
  font-size: 12px;
  padding: 6px 10px;
}
.pff-doc-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.pff-doc-remove-btn:hover {
  background: #b91c1c;
}
.pff-doc-remove-link {
  padding: 0;
  border: none;
  background: none;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.pff-doc-remove-link:hover {
  color: #991b1b;
}
.pff-doc-view-btn {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #c4b5fd;
  background: #f5f3ff;
  color: #5b21b6;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.pff-doc-view-btn:hover {
  background: #ede9fe;
}
.pff-doc-pdf-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #b91c1c;
  background: #fef2f2;
}
.pff-doc-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  background: #f9fafb;
}
.pff-doc-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.pff-doc-viewer-modal.hidden {
  display: none;
}
.pff-doc-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
}
.pff-doc-viewer-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(960px, 96vw);
  max-height: 92vh;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
}
.pff-doc-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}
.pff-doc-viewer-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pff-doc-viewer-close {
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.pff-doc-viewer-close:hover {
  color: #111827;
}
.pff-doc-viewer-body {
  flex: 1;
  min-height: 320px;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pff-doc-viewer-image {
  max-width: 100%;
  max-height: calc(92vh - 64px);
  object-fit: contain;
  background: #111827;
}
.pff-doc-viewer-frame {
  width: 100%;
  height: calc(92vh - 64px);
  min-height: 420px;
  border: 0;
  background: #fff;
}
body.pff-doc-viewer-open {
  overflow: hidden;
}
.pff-draft-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #e9d5ff;
}
.pff-draft-btn:hover {
  background: rgba(255,255,255,0.14);
}
.pff-submit-btn {
  padding: 6px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pff-submit-btn svg {
  width: 16px;
  height: 16px;
}
.pff-draft-btn.icon-left-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pff-draft-btn.icon-left-btn svg {
  width: 16px;
  height: 16px;
}
.pff-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.application-validation-card { border-color: var(--accent-border); }
.application-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.application-metric {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
}
.application-metric-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 4px;
}
.application-metric-value {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  word-break: break-word;
}
.application-detail-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.application-detail-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.application-form-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.application-form-hub-hint {
  margin: 10px 0 0;
}
.application-docs-subhead {
  margin: 14px 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.application-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.application-doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}
.application-doc-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.application-doc-meta strong {
  font-size: 13px;
  color: #0f172a;
  word-break: break-word;
}
.application-doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.applicant-pnpki-callout {
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
}
.applicant-pnpki-callout-body strong {
  display: block;
  margin-bottom: 6px;
  color: #14532d;
}
.application-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.application-card-head h3 { margin: 0; }
.application-loading,
.application-error {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.application-footnote { margin-top: 8px; }

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVENESS — BREAKPOINTS
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Large tablet / Small laptop */
@media (max-width: 1100px) {
  .modal .modal-content.preview-wide { width: calc(100vw - 48px); }
}

/* Tablet Portrait */
@media (max-width: 900px) {
  .modal .modal-content.preview-wide { width: calc(100vw - 32px); }
}

/* Mobile Landscape / Large Phone */
@media (max-width: 768px) {
  /* 1. TOPBAR UPLOAD BUTTONS */
  .topbar-actions #newFolderBtn span,
  .topbar-actions #uploadBtn span,
  .topbar-actions #uploadFolderBtn span {
    display: none;
  }
  .topbar-actions #newFolderBtn,
  .topbar-actions #uploadBtn,
  .topbar-actions #uploadFolderBtn {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
  }

  /* 2. TABLE VIEW */
  .table-head, .table-row {
    grid-template-columns: 1fr auto !important;
  }
  /* Hide Owner and Modified */
  .table-head div:nth-child(2), .table-row div:nth-child(2),
  .table-head div:nth-child(3), .table-row div:nth-child(3) {
    display: none !important;
  }
  .table-body .table-row {
    padding: 10px 8px;
  }
  .file-actions {
    gap: 4px;
  }

  /* 3. GRID VIEW */
  .grid-view .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  /* 4. DETAIL PANEL */
  .detail-panel {
    width: 100%;
    max-width: 100vw;
    z-index: 300;
  }
  .detail-panel.show {
    transform: translateX(0);
  }
  .preview {
    height: 220px;
  }

  /* 5. PDF FILLER MODAL */
  .modal .modal-content.preview-wide {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
  }
  #previewModal,
  #pnpkiDocumentModal {
    padding: 0;
  }
  #previewModal .modal-content.preview-wide,
  #pnpkiDocumentModal .modal-content.preview-wide {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
    padding: 0;
  }
  .pff-toolbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
  }
  .pff-hint {
    display: none;
  }
  .pff-draft-status {
    width: 100%;
    white-space: normal;
    order: 2;
  }
  .pff-mobile-hint {
    display: block;
    width: 100%;
    font-size: 11px;
    color: #9ca3af;
    order: 3;
  }
  .pff-page-area {
    padding: 10px 8px;
    align-items: stretch;
  }
  .pff-page-slot,
  .pff-page {
    max-width: 100%;
    margin: 0 auto;
  }
  .pff-page-slot {
    overflow: hidden;
  }
  .application-container {
    padding: 16px 14px 32px;
  }
  .application-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .application-card-head {
    flex-direction: column;
    align-items: stretch;
  }
  .application-card-head .secondary-btn {
    width: 100%;
  }

  /* 6. SHARE MODAL */
  .share-add-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .share-add-btn {
    width: 100%;
    justify-content: center;
    height: 44px;
  }
  .perm-select {
    width: 100%;
  }

  /* 7. TOOLBAR (sort controls) */
  .toolbar {
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    grid-template-columns: 1fr;
  }
  .toolbar .right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .sort-group {
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    justify-content: space-between;
  }
  .sort-group select {
    height: 40px;
    font-size: 13px;
    flex: 1;
  }

  /* 9. TOUCH TARGET SIZES */
  .icon-btn {
    width: 44px;
    height: 44px;
  }
  .nav-item {
    min-height: 44px;
    padding: 10px 12px;
  }
  .primary-btn, .danger-btn, .secondary-btn, .icon-left-btn {
    height: 44px;
  }
  .auth-form .form-row input {
    height: 48px;
  }
  .auth-tab {
    height: 44px;
  }

  /* 12. SCROLLING */
  .content, .pff-page-area, .detail-body, .shared-list {
    -webkit-overflow-scrolling: touch;
  }
}

/* Mobile Portrait (Small Phones) */
@media (max-width: 480px) {
  /* 2. TABLE VIEW ACTIONS */
  .file-actions .icon-btn {
    width: 36px;
    height: 36px;
  }
  .table {
    padding: 0;
  }

  /* 3. GRID VIEW PORTRAIT */
  .grid-view .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .card {
    padding: 10px 8px;
  }
  .card .card-title {
    font-size: 12px;
  }

  /* 8. TOAST NOTIFICATIONS */
  #toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
  }
  .toast {
    min-width: 0;
    width: 100%;
  }

  /* 10. MODAL GENERAL (Bottom Sheet Style) */
  .modal {
    align-items: flex-end;
  }
  .modal .modal-content {
    width: 100vw;
    max-width: 100vw;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    top: auto;
    margin: 0;
    padding: 20px 16px;
  }
  /* Don't apply bottom sheet to PDF filler / application preview */
  .modal .modal-content.preview-wide {
    position: relative;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    bottom: auto;
    top: auto;
  }
  #previewModal,
  #pnpkiDocumentModal {
    align-items: stretch;
    padding: 0;
  }
  #previewModal .modal-content.preview-wide,
  #pnpkiDocumentModal .modal-content.preview-wide {
    height: 100dvh;
    max-height: 100dvh;
    width: 100vw;
    max-width: 100vw;
  }
}

.toast.toast-success { border-left: 4px solid #10b981; }
.toast.toast-error { border-left: 4px solid #ef4444; }
.toast.toast-info { border-left: 4px solid var(--highlight); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(100%) scale(0.9); }
}

/* Modal confirm specific */
.modal-confirm {
  max-width: 400px;
}

.modal-confirm .modal-body {
  padding: 20px 24px;
}

.modal-confirm .modal-footer {
  padding: 16px 24px;
  background: #f9fafb;
  border-top: 1px solid #f3f4f6;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.full-width {
  width: 100%;
}

.secondary-btn {
  background: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.secondary-btn:hover {
  background: #f9fafb;
}

/* Signature pad modal */
.pff-sigpad-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1300;
  display: flex; align-items: center; justify-content: center;
}
.pff-sigpad-box {
  background: #1e1b4b;
  border-radius: 14px;
  padding: 24px;
  width: 500px; max-width: 95vw;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.pff-sigpad-box h4 { margin: 0 0 14px; color: #c4b5fd; font-size: 15px; }
.pff-sigpad-canvas {
  width: 100%; height: 160px;
  background: #fff; border-radius: 8px;
  display: block; cursor: crosshair; touch-action: none;
}
.pff-sigpad-actions {
  display: flex; gap: 10px; margin-top: 14px; justify-content: flex-end;
}
.pff-sigpad-actions button {
  padding: 7px 18px; border-radius: 7px; border: none;
  cursor: pointer; font-size: 14px; font-weight: 500;
}
.pff-sigpad-cancel { background: transparent; color: #9ca3af; border: 1px solid rgba(255,255,255,.15) !important; }
.pff-sigpad-clear  { background: rgba(255,255,255,.1); color: #c4b5fd; }
.pff-sigpad-use    { background: #7c3aed; color: #fff; }

/* ── Checkbox & Radio overlays ──────────────────────────────────────────────── */
/* Every option is a dedicated □; ✓ sits centered inside when selected. */
.pff-checkbox,
.pff-radio {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
  cursor: pointer;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: #ffffff;
  border: 1.5px solid #1f2937;
  border-radius: 0;
  transition: background .1s, border-color .1s;
}
.pff-checkbox:hover,
.pff-radio:hover {
  border-color: #111827;
  background: #fffbeb;
}
.pff-checkbox:checked,
.pff-radio:checked {
  background: #ffffff;
  border-color: #111827;
}
.pff-checkbox:checked::after,
.pff-radio:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  font-size: 78%;
  font-weight: 800;
  line-height: 1;
  background: none;
  border-radius: 0;
  pointer-events: none;
}

/* ── Dropdown / select overlay ──────────────────────────────────────────────── */
.pff-select {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
  cursor: pointer;
  background: rgba(255,255,255,0.0);
  border: none;
  outline: none;
  padding: 1px 2px;
  color: #111;
  font-family: inherit;
  border-radius: 2px;
  transition: background .1s, box-shadow .1s;
  appearance: none;
  -webkit-appearance: none;
}
.pff-select:hover {
  background: rgba(139,92,246,0.06);
  box-shadow: inset 0 0 0 1px rgba(139,92,246,0.35);
}
.pff-select:focus {
  background: rgba(255,255,255,0.95);
  box-shadow: inset 0 0 0 2px #8b5cf6;
  color: #111;
  z-index: 2;
}

/* White cover to hide PDF's own rendered garbage values behind checkbox/radio */
.pff-field-cover {
  position: absolute;
  box-sizing: border-box;
  background: #fff;
  pointer-events: none;
  z-index: 0;
}
.pff-checkbox,
.pff-radio {
  z-index: 1;
}

/* 4E Gender: ONE red guide (non-clickable) + borderless clickable Male/Female hits. */
.pff-sex-required-guide {
  position: absolute !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #dc2626 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  pointer-events: none !important;
  z-index: 5 !important;
}
.pff-sex-required-guide.is-satisfied {
  border-color: rgba(220, 38, 38, 0.45) !important;
}
/* Invisible white covers over PDF-printed Gender □ marks. */
.pff-sex-mark-cover {
  position: absolute !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
  outline: none !important;
  pointer-events: none !important;
  z-index: 4 !important;
}
/* Invisible hit targets — no black □, no red □ on the control itself. */
.pff-sex-check {
  position: absolute !important;
  display: block !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  outline: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 50 !important;
  opacity: 1 !important;
  min-width: 0 !important;
  min-height: 0 !important;
}
.pff-sex-check:hover,
.pff-sex-check:focus,
.pff-sex-check:checked {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}
.pff-sex-check:checked::after {
  content: '✓' !important;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: #111827;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none !important;
  background: none !important;
  border: none !important;
}
.pff-wrap--submitted-readonly .pff-sex-check {
  pointer-events: none !important;
  cursor: default !important;
}
/* Kill every legacy gender chrome that drew black/tiny red boxes */
.pff-sex-hit,
.pff-sex-overlay,
.pff-sex-overlay.pff-checkbox,
.pff-sex-overlay.pff-radio,
.pff-sex-group-overlay,
.pff-sex-sync-radio,
.pff-sex-check.pff-checkbox,
.pff-sex-check.pff-radio,
.pff-sex-check.pff-field-required {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}
.pff-sex-hit,
.pff-sex-overlay,
.pff-sex-group-overlay,
.pff-sex-sync-radio {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  z-index: 0 !important;
}

/* Share modal */
.share-general-access {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  margin-top: 8px;
}
.share-section-label {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}
.shared-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}
.share-general-access .shared-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.share-general-access .shared-item-info {
  flex: 1;
}
.share-general-access .shared-item-email {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
}
.share-general-access .shared-item-perm {
  font-size: 12px;
  color: #64748b;
}
.perm-change-select {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  background: white;
  cursor: pointer;
  outline: none;
}
.perm-change-select:focus {
  border-color: var(--accent-600);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}

/* PDF form filler feedback */
.pff-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 8px;
  background: #1e293b;
  color: #fff;
  font-size: 13px;
  z-index: 60;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.pff-loading {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.pff-err {
  color: #b91c1c;
  font-size: 13px;
}

.activity-logs-container {
  padding-bottom: 20px;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-logs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 2px 0;
  flex-shrink: 0;
}

.activity-logs-header-main {
  min-width: 0;
  flex: 1 1 280px;
}

.activity-logs-lead {
  margin: 4px 0 0;
  max-width: 40rem;
  line-height: 1.5;
}

.activity-logs-header-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.activity-logs-stat-card {
  min-width: 108px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06));
}

.activity-logs-stat-card--muted {
  background: #f8fafc;
}

.activity-logs-stat-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--clsu-green-cobra, #006b2d);
  font-variant-numeric: tabular-nums;
}

.activity-logs-stat-label {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.activity-logs-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent, #009639);
}

.activity-logs-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.activity-logs-card.activity-logs-card--filters {
  overflow: visible;
}

.activity-logs-filters-panel button,
.activity-logs-filters-toolbar button,
.activity-logs-filter-actions button,
.activity-logs-pagination-actions button,
.activity-logs-filter-chip {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
}

.activity-logs-filters-panel button svg,
.activity-logs-filter-actions button svg,
.activity-logs-pagination-actions button svg,
.activity-logs-filters-toolbar button svg {
  pointer-events: none;
}

.activity-logs-card--filters {
  position: relative;
  z-index: 2;
}

.activity-logs-card--results {
  position: relative;
  z-index: 1;
}

.activity-logs-container select,
.activity-logs-container input[type="date"],
.activity-logs-container input[type="search"] {
  pointer-events: auto;
  cursor: pointer;
}

.activity-logs-container input[type="search"] {
  cursor: text;
}

.activity-logs-card--results {
  padding: 0;
  flex: 1 1 auto;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.activity-logs-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.activity-logs-table-toolbar .activity-logs-section-title {
  margin: 0;
}

.activity-logs-results-head,
.activity-logs-scroll-hint {
  flex-shrink: 0;
}

.activity-logs-pagination-wrap {
  flex-shrink: 0;
  padding: 0 22px 16px;
}

.activity-logs-hero,
.activity-logs-card--filters {
  flex-shrink: 0;
}

.activity-logs-filters-panel {
  padding: 16px 18px;
  min-width: 0;
}

.activity-logs-filters-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.activity-logs-filters-toolbar .activity-logs-filter--search {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.activity-logs-refresh-btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 40px;
}

.activity-logs-filters-head,
.activity-logs-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.activity-logs-results-head {
  padding: 20px 22px 0;
}

.activity-logs-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 650;
  color: var(--text, #0f172a);
}

.activity-logs-section-title svg {
  width: 18px;
  height: 18px;
  color: var(--clsu-green, #009639);
}

.activity-logs-section-desc {
  margin: 0;
  max-width: 42rem;
}

.activity-logs-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.activity-logs-filter--search {
  width: 100%;
}

.activity-logs-search-input {
  width: 100%;
}

.activity-logs-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.activity-logs-filter {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.activity-logs-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.activity-logs-filter-label svg {
  width: 14px;
  height: 14px;
}

.activity-logs-select,
.activity-logs-input {
  min-height: 40px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid var(--border, #dbe3ee);
  background: #fff;
  padding: 8px 12px;
  font-size: 14px;
  box-sizing: border-box;
}

.activity-logs-select:focus,
.activity-logs-input:focus {
  outline: none;
  border-color: var(--clsu-green, #009639);
  box-shadow: 0 0 0 3px rgba(0, 150, 57, 0.12);
}

.activity-logs-active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-logs-active-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #64748b);
}

.activity-logs-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 150, 57, 0.22);
  background: var(--accent-light, #ecfdf3);
  color: var(--clsu-green-cobra, #006b2d);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.activity-logs-filter-chip svg {
  width: 12px;
  height: 12px;
}

.activity-logs-filter-chip:hover {
  background: #dff5e8;
}

.activity-logs-filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.activity-logs-filter-actions-primary,
.activity-logs-filter-actions-export {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.activity-logs-export-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #64748b);
  margin-right: 2px;
}

.activity-logs-table-wrap {
  margin: 0;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 12px;
  background: #fff;
}

.activity-logs-table-shell {
  margin: 0 16px 12px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border, #cbd5e1);
  background: #fff;
  flex: 1 1 auto;
  min-height: 320px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.activity-logs-records-scroll,
#activityLogsScrollRegion {
  display: block;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  height: clamp(320px, 52vh, 560px);
  min-height: 320px;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* Reserve space only on the right so the thumb sits flush with the table edge */
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #4ade80 #f0fdf4;
  border: none;
  border-radius: 12px;
  background: #fff;
  /* Keep IP / Device clear of the thumb without a large blank gutter */
  padding-right: 2px;
}

.activity-logs-container .activity-logs-records-scroll,
.activity-logs-container #activityLogsScrollRegion {
  height: clamp(320px, calc(100vh - 420px), 560px);
}

.activity-logs-records-scroll:focus-visible,
#activityLogsScrollRegion:focus-visible {
  outline: 2px solid var(--clsu-green, #009639);
  outline-offset: 2px;
}

/* Thin, green-themed table scrollbar — visible but not bulky */
.activity-logs-records-scroll::-webkit-scrollbar,
#activityLogsScrollRegion::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.activity-logs-records-scroll::-webkit-scrollbar-thumb,
#activityLogsScrollRegion::-webkit-scrollbar-thumb {
  background: #86efac;
  border-radius: 999px;
  border: 2px solid #fff;
  background-clip: padding-box;
  min-height: 36px;
}

.activity-logs-records-scroll::-webkit-scrollbar-thumb:hover,
#activityLogsScrollRegion::-webkit-scrollbar-thumb:hover,
.activity-logs-records-scroll::-webkit-scrollbar-thumb:active,
#activityLogsScrollRegion::-webkit-scrollbar-thumb:active {
  background: #16a34a;
  border: 2px solid #fff;
  background-clip: padding-box;
}

.activity-logs-records-scroll::-webkit-scrollbar-track,
#activityLogsScrollRegion::-webkit-scrollbar-track {
  background: #f0fdf4;
  border-radius: 999px;
  margin: 4px 0;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.activity-logs-records-scroll::-webkit-scrollbar-corner,
#activityLogsScrollRegion::-webkit-scrollbar-corner {
  background: transparent;
}

.activity-logs-scroll-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 22px 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
}

.activity-logs-scroll-hint svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--clsu-green, #009639);
}

.activity-logs-results-intro {
  min-width: 0;
  flex: 1 1 auto;
}

.activity-logs-sort {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.activity-logs-sort-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.activity-logs-sort-select {
  min-width: 180px;
}

.activity-logs-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.activity-logs-table-head th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(180deg, #009639 0%, #007a2f 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  border-bottom: none;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.activity-logs-table-head th:last-child {
  padding-right: 18px;
}

.activity-logs-table tbody td {
  padding: 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--border, #eef2f7);
  background: #fff;
}

.activity-logs-table tbody td:last-child {
  padding-right: 18px;
}

.activity-logs-row:hover td {
  background: #f8fffb;
}

.activity-logs-row:last-child td {
  border-bottom: none;
}

.activity-logs-when {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 108px;
}

.activity-logs-when-date {
  font-weight: 650;
  color: var(--text, #0f172a);
  font-size: 13px;
}

.activity-logs-when-time {
  font-size: 12px;
  color: var(--muted, #64748b);
}

.activity-logs-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.activity-logs-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e2e8f0, #f8fafc);
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-logs-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.activity-logs-user-name {
  font-weight: 650;
  color: var(--text, #0f172a);
  font-size: 14px;
}

.activity-logs-user-email {
  font-size: 12px;
  color: var(--muted, #64748b);
  word-break: break-word;
}

.activity-logs-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}

.activity-logs-role-badge--super_admin { background: #fef3c7; color: #92400e; }
.activity-logs-role-badge--admin { background: #dbeafe; color: #1d4ed8; }
.activity-logs-role-badge--validator { background: #ffedd5; color: #c2410c; }
.activity-logs-role-badge--staff { background: #ede9fe; color: #6d28d9; }
.activity-logs-role-badge--applicant { background: #ecfdf3; color: #15803d; }

.activity-logs-activity-cell {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 220px;
}

.activity-logs-event-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-logs-event-icon svg {
  width: 16px;
  height: 16px;
}

.activity-logs-event-icon--auth { background: #eff6ff; color: #1d4ed8; }
.activity-logs-event-icon--submit { background: #ecfdf3; color: #15803d; }
.activity-logs-event-icon--success { background: #ecfdf3; color: #047857; }
.activity-logs-event-icon--danger { background: #fef2f2; color: #b91c1c; }
.activity-logs-event-icon--admin { background: #f5f3ff; color: #6d28d9; }
.activity-logs-event-icon--review { background: #fff7ed; color: #c2410c; }
.activity-logs-event-icon--profile { background: #f0f9ff; color: #0369a1; }
.activity-logs-event-icon--neutral { background: #f1f5f9; color: #475569; }

.activity-logs-activity-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.activity-logs-activity-label {
  font-weight: 650;
  color: var(--text, #0f172a);
  font-size: 14px;
  line-height: 1.35;
}

.activity-logs-detail {
  display: block;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.4;
}

.activity-logs-batch-badge {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.activity-logs-tech {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.activity-logs-ip {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #334155;
}

.activity-logs-device {
  font-size: 11px;
  color: var(--muted, #64748b);
}

.activity-logs-muted-dash {
  color: var(--muted, #94a3b8);
}

.activity-logs-empty-state {
  padding: 48px 24px;
  text-align: center;
}

.activity-logs-table tbody td.panel-loading,
.activity-logs-table tbody td.activity-log-empty,
.activity-logs-table tbody td.activity-log-error {
  text-align: center;
  padding: 48px 16px;
  background: #fff;
}

.activity-logs-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-logs-empty-icon svg {
  width: 28px;
  height: 28px;
}

.activity-logs-empty-state h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.activity-logs-pagination-wrap {
  padding: 16px 22px 20px;
}

.activity-logs-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.activity-logs-pagination-meta {
  font-size: 13px;
  color: var(--text, #334155);
}

.activity-logs-pagination-actions {
  display: flex;
  gap: 8px;
}

.activity-logs-pagination-actions .secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 1200px) {
  .activity-logs-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .activity-logs-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-logs-table-shell {
    margin-inline: 14px;
  }

  .activity-logs-records-scroll {
    min-height: 200px;
  }

  .activity-logs-filters-panel,
  .activity-logs-results-head,
  .activity-logs-pagination-wrap {
    padding-inline: 16px;
  }
}

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

  .activity-logs-filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .activity-logs-table thead {
    display: none;
  }

  .activity-logs-table tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
  }

  .activity-logs-table tbody td {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border, #eef2f7);
  }

  .activity-logs-table tbody td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted, #64748b);
  }

  .activity-logs-table tbody td:last-child {
    border-bottom: none;
  }
}

.nav-item {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.nav-badge.hidden {
  display: none;
}

.application-unassigned-section {
  margin-bottom: 20px;
}

.application-unassigned-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.application-unassigned-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.application-unassigned-title {
  margin: 0;
  font-size: 16px;
}

.application-create-batch-row,
.application-batch-assign-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.application-pnpki-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.application-pnpki-view-btn svg {
  width: 16px;
  height: 16px;
}

.pnpki-document-modal {
  width: min(1360px, 94vw);
}

.pnpki-document-modal-header {
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px !important;
  max-height: min(20vh, 168px);
  overflow: hidden;
}

.pnpki-document-header-info {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

#pnpkiDocumentModal #pnpkiDocumentTitle {
  font-size: 13px;
  line-height: 1.25;
}

.pnpki-document-meta {
  display: block;
  min-width: 0;
}

.pnpki-document-header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.9fr);
  gap: 8px 12px;
  align-items: start;
}

.pnpki-document-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.pnpki-document-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.pnpki-document-meta-item strong {
  color: #64748b;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.pnpki-document-meta-item span {
  color: #0f172a;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pnpki-document-body {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow: hidden;
  padding: 0;
  background: #e5e7eb;
}

/* PDF fills the modal body — Chrome/Drive viewer owns the only scrollbar */
.pnpki-document-viewport {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.pnpki-document-frame-wrap {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  transform: none;
}

.pnpki-document-frame-wrap iframe,
.pnpki-document-frame-wrap embed {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: #fff;
  object-fit: unset;
  max-width: none;
  max-height: none;
}

.pnpki-document-frame-wrap embed {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: #fff;
}

#pnpkiDocumentModal .modal-body.pnpki-document-body iframe,
#pnpkiDocumentModal .modal-body.pnpki-document-body embed {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  object-fit: unset;
}

.pnpki-document-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.applications-pnpki-view-cell {
  width: 110px;
  white-space: nowrap;
}

.application-unassigned-action-cell {
  width: 120px;
}

.application-create-batch-input {
  min-width: 220px;
  flex: 1 1 220px;
  padding: 8px 12px;
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 8px;
}

.admin-table-row--unassigned {
  background: rgba(251, 191, 36, 0.08);
}

.admin-badge-status-received {
  background: rgba(14, 116, 144, 0.12);
  color: #0e7490;
}
/* PNPKI interactive application checklist */
.application-incomplete-banner {
  margin: 12px 0 16px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(254, 226, 226, 0.65);
  color: #7f1d1d;
}
.application-incomplete-banner--compact {
  margin: 8px 0 12px;
  padding: 10px 12px;
  font-size: 13px;
}
.application-incomplete-banner > strong {
  display: block;
  margin-bottom: 4px;
}
.application-incomplete-banner p { margin: 6px 0 0; }
.application-incomplete-missing { margin-top: 10px; }
.application-incomplete-missing-title {
  font-weight: 700;
  margin: 0 0 8px !important;
  font-size: 14px;
}
.application-incomplete-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.application-incomplete-list li {
  margin: 0;
}
.application-missing-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(185, 28, 28, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  color: #7f1d1d;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.application-missing-item:hover,
.application-missing-item:focus-visible {
  background: #fff;
  border-color: rgba(185, 28, 28, 0.55);
  outline: none;
}
.application-missing-item:focus-visible {
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.25);
}
.application-missing-box {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  color: #b91c1c;
}
.application-incomplete-mark {
  color: #b91c1c;
  font-weight: 700;
}
.pff-applicant-privacy-notice-row {
  margin-top: 8px;
}
.pff-applicant-privacy-notice {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 150, 57, 0.22);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0, 150, 57, 0.06), rgba(255, 255, 255, 0.92));
}
.pff-applicant-privacy-notice-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text, #0f172a);
}
.pff-applicant-privacy-notice-body {
  display: grid;
  gap: 10px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted, #475569);
}
.pff-applicant-privacy-notice-body p {
  margin: 0;
}
.pff-applicant-privacy-notice-body strong {
  color: var(--text, #0f172a);
  font-weight: 650;
}
.pff-applicant-privacy-notice-contacts {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}
.pff-applicant-privacy-notice-contacts a {
  color: var(--clsu-green, #009639);
  font-weight: 600;
  text-decoration: none;
}
.pff-applicant-privacy-notice-contacts a:hover {
  text-decoration: underline;
}
.pff-applicant-consent-row {
  margin-top: 8px;
}
.pff-applicant-consent-name-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(0, 0.7fr);
  gap: 10px 14px;
  margin: 4px 0 12px;
  align-items: end;
  max-width: 720px;
}
.pff-applicant-consent-name-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text, #0f172a);
}
.pff-applicant-consent-name-field input {
  display: block;
  width: 100%;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 500;
  color: var(--text, #0f172a);
  box-sizing: border-box;
  box-shadow: none;
}
.pff-applicant-consent-name-field input::placeholder {
  color: #94a3b8;
  font-weight: 400;
  opacity: 1;
}
.pff-applicant-consent-name-field input:hover {
  border-color: #94a3b8;
}
.pff-applicant-consent-name-field input:focus {
  outline: none;
  border-color: var(--clsu-green, #009639);
  box-shadow: 0 0 0 3px rgba(0, 150, 57, 0.16);
}
.pff-applicant-consent-name-field--initials {
  max-width: none;
}
.pff-applicant-consent-hint,
.pff-applicant-consent-body {
  margin: 0 0 12px;
  line-height: 1.5;
  color: var(--muted, #475569);
  font-size: 0.875rem;
}
.pff-applicant-consent-body p {
  margin: 0 0 10px;
}
.pff-applicant-consent-body p:last-child {
  margin-bottom: 0;
}
.pff-applicant-consent-list {
  margin: 0 0 12px;
  padding-left: 1.25rem;
  display: grid;
  gap: 8px;
}
.pff-applicant-consent-list li {
  padding-left: 2px;
}
.pff-applicant-consent-list--numbered {
  list-style: decimal;
  padding-left: 1.35rem;
}
@media (max-width: 720px) {
  .pff-applicant-consent-name-grid {
    grid-template-columns: 1fr;
    max-width: none;
    gap: 10px;
  }

  .pff-applicant-consent-name-field input {
    height: 40px;
    min-height: 40px;
    max-height: 40px;
  }
}
.application-checklist-card {
  margin: 12px 0 16px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border, #dbe3ef);
  background: rgba(248, 250, 252, 0.9);
}
.application-checklist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.application-checklist-head h4 { margin: 0; font-size: 15px; }
.application-checklist-progress {
  font-size: 13px;
  color: var(--muted, #64748b);
  font-weight: 600;
}
.application-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.application-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.application-checklist-item.is-complete { color: #166534; }
.application-checklist-item.is-missing { color: #b91c1c; }
.application-checklist-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}
.application-checklist-missing { margin: 10px 0 0; }
.application-form-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pnpki-validation-summary {
  margin: 0;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border, #dbe3ef);
  background: rgba(248, 250, 252, 0.95);
  max-height: 132px;
  overflow: auto;
}
.pnpki-validation-summary h4 {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}
.pnpki-validation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px 8px;
}
.pnpki-validation-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  line-height: 1.3;
  min-width: 0;
}
.pnpki-validation-item strong {
  font-weight: 500;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pnpki-validation-item.is-complete span { color: #166534; font-weight: 700; }
.pnpki-validation-item.is-missing span { color: #b91c1c; font-weight: 700; }
.pnpki-validation-missing {
  margin-top: 6px;
  color: #7f1d1d;
  font-size: 11px;
}
.pnpki-validation-missing ul {
  margin: 4px 0 0;
  padding-left: 16px;
}
#pnpkiRequestCorrectionBtn {
  margin-top: 6px;
  padding: 4px 8px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .pnpki-document-header-grid {
    grid-template-columns: 1fr;
  }
  .pnpki-document-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #pnpkiDocumentModal .pnpki-document-modal-header {
    max-height: min(28vh, 220px);
    overflow: auto;
  }
}

/* Online drafts: keep PDF template fully visible; never paint opaque white boxes. */
.pff-wrap--online-draft .pff-text-input {
  background: transparent;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pff-wrap--online-draft .pff-text-input:hover {
  background: rgba(37, 99, 235, 0.06);
}
.pff-wrap--online-draft .pff-text-input:focus {
  background: rgba(37, 99, 235, 0.08);
}
.pff-wrap--online-draft .pff-photo-zone,
.pff-wrap--online-draft .pff-sig-zone {
  background: transparent;
  overflow: hidden;
  position: absolute !important;
}
.pff-wrap--online-draft .pff-photo-zone {
  background: transparent;
}
.pff-wrap--online-draft .pff-sig-zone {
  background: #ffffff;
}
.pff-wrap--online-draft .pff-photo-img,
.pff-wrap--online-draft .pff-photo-zone .pff-zone-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}
.pff-wrap--online-draft .pff-sig-img,
.pff-wrap--online-draft .pff-sig-zone .pff-zone-img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  object-position: center center;
}

.pff-documents-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pff-completion-badge {
  flex-shrink: 0;
  min-width: 48px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 4px 10px;
}
.pff-documents-panel--ready .pff-completion-badge {
  background: #bbf7d0;
  color: #14532d;
}
.pff-documents-panel:not(.pff-documents-panel--ready) .pff-completion-badge {
  background: #fee2e2;
  color: #991b1b;
}
.pff-completion-meter {
  margin: 0 0 8px;
  font-size: 13px;
}
.pff-doc-ready-msg {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 13px;
}
.pff-doc-ready-msg p {
  margin: 0;
}
.pff-doc-ready-msg p + p {
  margin-top: 4px;
}
.pff-submit-btn.is-blocked,
.pff-submit-btn:disabled,
.primary-btn.pff-submit-btn.is-blocked,
.primary-btn.pff-submit-btn:disabled,
.primary-btn.pff-submit-btn[aria-disabled="true"] {
  background: #94a3b8 !important;
  color: #f8fafc !important;
  opacity: 1;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}
/* Blocked submit remains clickable so incomplete attempts can notify by email */
.primary-btn.pff-submit-btn.is-blocked[aria-disabled="true"]:not(:disabled) {
  cursor: pointer;
  pointer-events: auto;
}
.pff-field-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
  outline: none;
}
input.pff-field-invalid,
textarea.pff-field-invalid,
.pff-photo-zone.pff-field-invalid,
.pff-sig-zone.pff-field-invalid,
.pff-applicant-field-group.pff-field-invalid,
#pff-applicant-sex-row.pff-field-invalid {
  border: 2px solid #ef4444 !important;
  border-radius: 6px;
}
.pff-field-error-msg {
  margin: 4px 0 0;
  padding: 2px 4px;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  background: rgba(254, 242, 242, 0.95);
  border-radius: 4px;
}
.pff-photo-zone .pff-field-error-msg,
.pff-sig-zone .pff-field-error-msg {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  z-index: 2;
  text-align: center;
}

/* Keep PDF preview clean: inline validation messages stay in notifications. */
#previewModal .pff-field-error-msg {
  display: none !important;
}
.pff-doc-still-needed {
  margin: 6px 0 0;
  padding-left: 18px;
  color: #7f1d1d;
  font-size: 13px;
}
.pff-documents-panel--progress .pff-doc-item-missing .pff-doc-status {
  color: var(--muted, #64748b);
  font-weight: 500;
}
.pff-documents-panel--compact {
  padding: 8px 0 0;
}
.pff-documents-panel--compact .pff-documents-head {
  margin: 0;
}
.pff-documents-panel--compact .pff-documents-title {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.pff-submission-panel:has(.pff-documents-panel--compact) {
  padding-top: 8px;
  padding-bottom: 8px;
  background: #f8fafc;
}
.pff-doc-missing-msg--errors {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}

/* -- Notification Center (bell + fixed portal panel) -------------------------- */
.notification-center {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.notification-bell-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border, #e5e7eb);
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.notification-bell-btn:hover,
.notification-bell-btn[aria-expanded="true"] {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--clsu-green-cobra, #14532d);
}
.notification-bell-btn:active { transform: scale(.93); }
.notification-bell-btn i,
.notification-bell-btn svg {
  width: 17px;
  height: 17px;
}
.notification-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 2px solid #fff;
  box-sizing: border-box;
  transition: transform .2s cubic-bezier(.4,0,.2,1);
}
.notification-bell-badge.hidden { display: none !important; }

/* Backdrop (mobile only) */
.notification-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 4800;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.notification-backdrop:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}
.notification-backdrop.hidden { display: none !important; }

/* Panel — fixed, compact dropdown */
.notification-panel {
  position: fixed;
  top: 60px;
  right: 16px;
  width: 380px;
  max-width: calc(100vw - 24px);
  max-height: min(70vh, 580px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow:
    0 4px 6px -1px rgba(0,0,0,.05),
    0 20px 40px -4px rgba(15,23,42,.14);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Animation */
  opacity: 0;
  transform: translateY(-8px) scale(.97);
  transition: opacity .18s ease, transform .18s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.notification-panel:not(.hidden) {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.notification-panel.hidden { display: none !important; }

/* Sticky chrome: header + filters + actions */
.notification-panel-chrome {
  flex: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
}
.notification-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 8px;
}
.notification-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}
.notification-panel-subtitle {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: #64748b;
}
.notification-panel-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s;
}
.notification-panel-close:hover { background: #f1f5f9; }
.notification-panel-close i,
.notification-panel-close svg { width: 15px; height: 15px; }

/* Filters — compact pills, NO horizontal scroll */
.notification-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 14px 8px;
  overflow: hidden;
}
.notification-filter-btn {
  flex: 0 0 auto;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.notification-filter-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.notification-filter-btn.is-active {
  background: #14532d;
  border-color: #14532d;
  color: #fff;
}

/* Actions row */
.notification-panel-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 14px 10px;
}
.notification-action-link {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color .12s;
}
.notification-action-link:hover { color: #1d4ed8; text-decoration: underline; }

/* Scrollable notification list */
.notification-panel-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  flex: 1 1 auto;
  min-height: 80px;
  -webkit-overflow-scrolling: touch;
}
.notification-empty {
  padding: 32px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}
.notification-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

/* Notification cards */
.notification-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background .12s;
}
.notification-item:hover { background: #f8fafc; }
.notification-item.is-unread {
  background: #f0fdf4;
}
.notification-item.is-unread:hover {
  background: #dcfce7;
}
.notification-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.notification-item-icon.cat-error { background: #fef2f2; color: #b91c1c; }
.notification-item-icon.cat-warning { background: #fffbeb; color: #b45309; }
.notification-item-icon.cat-success { background: #ecfdf5; color: #047857; }
.notification-item-icon.cat-info { background: #eff6ff; color: #1d4ed8; }
.notification-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 1px;
  line-height: 1.3;
}
.notification-item-message {
  font-size: 11.5px;
  color: #64748b;
  white-space: pre-line;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notification-missing-list {
  margin: 4px 0 0;
  padding-left: 16px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
  max-height: 8rem;
  overflow: auto;
}
.notification-missing-list li { margin: 1px 0; }
.notification-item:has(.notification-missing-list) .notification-item-message {
  -webkit-line-clamp: unset;
  max-height: none;
  overflow: visible;
}
.notification-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.notification-item-action-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #14532d;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.notification-item-action-btn:hover {
  background: #f0fdf4;
  border-color: #86efac;
}
.pff-notify-focus {
  outline: 2px solid rgba(220, 38, 38, 0.65) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(254, 226, 226, 0.85);
  transition: box-shadow 0.2s ease, outline-color 0.2s ease;
}
.notification-item-meta {
  margin-top: 4px;
  font-size: 10.5px;
  color: #94a3b8;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.notification-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
  display: inline-block;
  flex-shrink: 0;
}
.notification-item.is-read .notification-item-dot { display: none; }

/* Tablet */
@media (max-width: 1024px) {
  .notification-panel {
    width: min(380px, calc(100vw - 16px));
  }
}

/* Mobile: slide-in drawer */
@media (max-width: 720px) {
  .notification-panel {
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    bottom: 0 !important;
    width: min(100vw, 380px) !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: -8px 0 30px rgba(15, 23, 42, 0.18);
    transform: translateX(100%);
    opacity: 1;
  }
  .notification-panel:not(.hidden) {
    transform: translateX(0);
  }
  .notification-panel.is-mobile-sheet {
    left: 0 !important;
    width: 100vw !important;
  }
}
