@import url("/page-components.css");

/* myNWMES Desktop-First Portal Design System */

:root {
  --green: #005d2f;
  --green-dark: #003d20;
  --green-soft: #e8f0eb;
  --green-accent: #8cc9aa;
  --sidebar-bg: #002b15;
  --sidebar-surface: #00381c;
  --sidebar-hover: #004724;
  --sidebar-active: #005d2f;
  --sidebar-text: #e4eee7;
  --sidebar-muted: #8ba895;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --ink: #1c1c1c;
  --muted: #5b625e;
  --line: #d8dfda;
  --surface: #ffffff;
  --bg: #f4f6f4;
  --danger: #9b1c1c;
  --warning: #b35f00;
  --info: #005689;
  
  --sidebar-width: 260px;
  --header-height: 64px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.12);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* Base Body Override for Portal */
body.portal-body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* App Shell Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Persistent Sidebar (Desktop) */
.app-sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  box-sizing: border-box;
}

.sidebar-header {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
  color: inherit;
}

.sidebar-logo {
  width: auto;
  height: 44px;
  max-width: 38px;
  aspect-ratio: 1994.4 / 2331;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.sidebar-brand-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.15;
}

.sidebar-brand-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Sidebar Nav Lists */
.sidebar-nav {
  flex: 1;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  padding: 0 10px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.nav-link:focus-visible {
  outline: 2px solid var(--green-accent);
  outline-offset: -2px;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  opacity: 0.85;
}

.nav-badge {
  margin-left: auto;
  background: var(--sidebar-surface);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--sidebar-border);
}

.nav-link.active .nav-badge {
  background: #fff;
  color: var(--green);
}

/* Sidebar Footer / User Profile */
.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid var(--sidebar-border);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sidebar-surface);
  color: var(--green-accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.user-info {
  min-width: 0;
  flex: 1;
}

.user-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 12px;
  color: var(--sidebar-muted);
  display: block;
}

.sidebar-signout-btn {
  background: transparent;
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-muted);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: color 0.15s ease, border-color 0.15s ease;
  min-height: 34px;
}

.sidebar-signout-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

/* Main Content Area */
.app-main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Sticky Top Bar */
.app-topbar {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-sizing: border-box;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  min-height: auto;
}

.topbar-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.topbar-breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.topbar-breadcrumbs a:hover {
  color: var(--green);
  text-decoration: underline;
}

.topbar-breadcrumbs span.current {
  color: var(--ink);
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.badge-mode {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-admin {
  background: var(--green-dark);
  color: #fff;
}

.badge-member {
  background: var(--green-soft);
  color: var(--green-dark);
}

/* Main Content Canvas */
.app-canvas {
  flex: 1;
  padding: 32px 40px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.app-canvas.narrow {
  max-width: 900px;
}

.app-canvas.standard {
  max-width: 1200px;
}

.app-canvas.wide {
  max-width: 1600px;
}

/* Page Header Block */
.portal-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px 20px;
  margin-bottom: 28px;
}

.portal-page-title h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
  line-height: 1.15;
}

.portal-page-title p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.portal-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* KPI Summary Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.kpi-value {
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  margin: 4px 0;
}

.kpi-sub {
  font-size: 13px;
  color: var(--muted);
}

/* Desktop Data Tables */
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 28px;
}

.table-toolbar {
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.table-toolbar-left,
.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-search-input {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid #9aa59f;
  border-radius: var(--radius-sm);
  font-size: 14px;
  min-width: 240px;
}

.table-filter-select {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid #9aa59f;
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #fff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  text-align: left;
}

.data-table th {
  background: #f8faf8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #f7faf8;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

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

.data-table .cell-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--muted);
}

/* Split-Pane Layout */
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 28px;
  align-items: start;
}

.split-layout.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.split-pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

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

.sticky-pane {
  position: sticky;
  top: calc(var(--header-height) + 24px);
}

/* Desktop Compact Form Controls */
.portal-form-group {
  margin-bottom: 16px;
}

.portal-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}

.portal-form-group input,
.portal-form-group select,
.portal-form-group textarea {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 15px;
  border: 1px solid #9aa59f;
  border-radius: var(--radius-sm);
  background: #fff;
  box-sizing: border-box;
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.portal-btn.primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  width: auto;
  margin-top: 0;
}

.portal-btn.primary:hover {
  background: var(--green-dark);
}

.portal-btn.secondary {
  background: #fff;
  color: var(--green);
  border-color: var(--green);
  width: auto;
  margin-top: 0;
}

.portal-btn.secondary:hover {
  background: var(--green-soft);
}

.portal-btn.compact {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 13px;
}

/* Portal Footer */
.app-footer {
  padding: 24px 40px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
  box-sizing: border-box;
}

/* Slide-out Drawer Component (e.g. Competency Editor) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 540px;
  max-width: 92vw;
  background: var(--surface);
  box-shadow: -6px 0 28px rgba(0, 0, 0, 0.15);
  z-index: 210;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.drawer-panel.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfa;
}

.drawer-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.drawer-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  background: #fafbfa;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Modal Components */
.modal-backdrop,
.portal-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
  z-index: 1000;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.portal-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: -1;
}

.modal-box,
.portal-modal-card {
  background: #ffffff;
  border-radius: 10px;
  max-width: 520px;
  width: 100%;
  max-height: min(90vh, 640px);
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  margin: auto;
}

.modal-box {
  padding: 1.5rem;
}

.portal-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.portal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.portal-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink, #1c1c1c);
}

.portal-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}

.portal-modal-actions,
.portal-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .modal-backdrop,
  .portal-modal {
    padding: 0.75rem;
  }
  .modal-box,
  .portal-modal-card {
    padding: 1.25rem;
    max-height: 92vh;
  }
}

/* Table Category Headers */
.data-table tr.table-group-header td {
  background: #edf3ee;
  color: var(--green-dark);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 10px 18px;
  border-top: 2px solid #d0ded4;
  border-bottom: 1px solid #d0ded4;
}

/* Diff / Comparison Tables in Admin */
.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 12px 0 16px;
}

.diff-table th {
  background: #f8faf8;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.diff-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.diff-table td.diff-field {
  font-weight: 600;
  color: var(--ink);
  width: 28%;
}

.diff-table td.diff-old {
  color: #737373;
  background: #fafafa;
  width: 36%;
  word-break: break-word;
}

.diff-table td.diff-new {
  color: var(--green-dark);
  background: #eef7f1;
  font-weight: 600;
  width: 36%;
  word-break: break-word;
}

/* Button Variants */
.portal-btn.danger {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger);
}

.portal-btn.danger:hover {
  background: #fdf3f2;
}

/* Progression 60/40 Desktop Split View */
.progression-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.progression-rules-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.progression-tester-col {
  position: sticky;
  top: calc(var(--header-height) + 24px);
}

.tester-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto;
}

.scenario-result-box {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: #f8faf8;
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.scenario-result-box.pass {
  border-color: #2e7d32;
  background: #f1f8f3;
  color: #1b5e20;
}

.scenario-result-box.fail {
  border-color: #d32f2f;
  background: #fdf3f2;
  color: #b71c1c;
}

/* Responsive Rules */
.sidebar-backdrop {
  display: none;
}

@media (max-width: 1023px) {
  .mobile-menu-btn {
    display: inline-flex;
  }
  
  .app-sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-width) - 20px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
  }
  
  .app-sidebar.open {
    transform: translateX(calc(var(--sidebar-width) + 20px));
    box-shadow: var(--shadow-lg);
  }
  
  .sidebar-backdrop.active {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 95;
  }
  
  .app-canvas {
    padding: 24px 20px;
  }
  
  .split-layout,
  .split-layout.equal,
  .progression-split {
    grid-template-columns: 1fr;
  }

  .progression-tester-col {
    position: static;
  }
}

@media (max-width: 640px) {
  .app-topbar {
    padding: 0 16px;
  }
  
  .portal-page-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .portal-header-actions {
    width: 100%;
  }
  
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .table-search-input {
    width: 100%;
  }
}

/* ==========================================================================
   Desktop Login Layout & Brand Clear Space Presentation
   ========================================================================== */
.portal-login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 24px;
  background: var(--bg);
  box-sizing: border-box;
}

.portal-login-frame {
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.portal-login-brand-pane {
  background: linear-gradient(165deg, #005d2f 0%, #003d1e 100%);
  color: #fff;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.portal-login-crest-container {
  padding: 12px 0 24px;
}

.portal-login-crest {
  height: 92px;
  width: auto;
  aspect-ratio: 1994.4 / 2331;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
}

.portal-login-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #c2e8d3;
  margin-bottom: 8px;
}

.portal-login-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 10px;
  color: #fff;
}

.portal-login-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: #e0faea;
  margin: 0 0 20px;
  line-height: 1.35;
}

.portal-login-details p {
  font-size: 15px;
  line-height: 1.55;
  color: #d2eada;
  margin: 0 0 24px;
}

.portal-login-badge-tag {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
}

.portal-login-card-pane {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
}

.portal-login-card {
  width: 100%;
}

.portal-login-card .eyebrow {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 6px;
}

.portal-login-card h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 10px;
  color: var(--ink);
}

.portal-login-card .intro {
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 24px;
}

@media (max-width: 860px) {
  .portal-login-frame {
    grid-template-columns: 1fr;
  }
  .portal-login-brand-pane {
    padding: 32px 24px;
  }
  .portal-login-crest {
    height: 72px;
  }
  .portal-login-title {
    font-size: 32px;
  }
  .portal-login-card-pane {
    padding: 32px 24px;
  }
}

/* ==========================================================================
   Refined Vertical Spacing for Standard 1440x900 Desktop Viewports
   ========================================================================== */
.portal-body .split-layout {
  gap: 22px;
}

.portal-body .split-pane {
  padding: 24px 32px;
}

/* My Details Vertical Tuning */
.portal-body .details-grid {
  gap: 10px;
  margin: 14px 0 0;
}

.portal-body .detail {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.portal-body .detail dt {
  font-size: 11px;
  letter-spacing: 0.05em;
}

.portal-body .detail dd {
  font-size: 15px;
  margin-top: 2px;
}

.portal-body .form-grid {
  gap: 8px 14px;
}

.portal-body .form-grid label {
  margin: 6px 0 3px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.portal-body .form-grid input:not([type="checkbox"]),
.portal-body .form-grid select {
  min-height: 38px;
  padding: 6px 10px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}

/* Volunteer Duty Preferences 2-Column Grid */
.volunteer-roles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  margin-top: 4px;
}

.volunteer-roles-grid label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  margin: 2px 0;
  cursor: pointer;
}

.volunteer-roles-grid input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--green);
  margin-top: 2px;
}

/* Operational Guidance List Tuning */
.volunteer-notes-list {
  padding-left: 18px;
  line-height: 1.5;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 18px;
}

.volunteer-notes-list li {
  margin-bottom: 6px;
}

/* ==========================================================================
   Google Authentication & Linked Accounts Styles
   ========================================================================== */
.social-auth-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.google-auth-wrapper {
  margin-bottom: 4px;
}

.portal-btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.portal-btn-google:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #c6c9cc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.portal-btn-google:active:not(:disabled) {
  background: #f1f3f4;
}

.portal-btn-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.portal-btn-google .google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.portal-btn-apple {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  background: #000000;
  color: #ffffff;
  border: 1px solid #000000;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s ease;
}

.portal-btn-apple:hover:not(:disabled) {
  background: #1a1a1a;
  color: #ffffff;
}

.portal-btn-apple:active:not(:disabled) {
  background: #333333;
}

.portal-btn-apple:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.portal-btn-apple .apple-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: currentColor;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-divider span {
  padding: 0 12px;
}

/* Linked Accounts in My Details */
.linked-accounts-card {
  margin-top: 24px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.linked-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.linked-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #fbfcfc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  gap: 16px;
}

.linked-account-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.linked-account-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-shrink: 0;
}

.linked-account-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.linked-account-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.linked-account-status {
  font-size: 13px;
  color: var(--muted);
}

.linked-account-status.connected {
  color: var(--green);
  font-weight: 500;
}

.badge-connected {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e6f4ea;
  color: var(--green);
}

.badge-coming-soon {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f3f4;
  color: var(--muted);
}

.linked-account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}



/* Targeted portal mobile layouts; desktop columns remain unchanged. */
[data-dashboard-grid] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.portal-table-scroll { max-width: 100%; overflow-x: auto; }
body.portal-drawer-open { overflow: hidden; }
@media (max-width: 640px) {
  .portal-mobile [data-dashboard-grid], .portal-mobile .competency-grid { grid-template-columns: minmax(0, 1fr); }
  .portal-mobile .app-topbar { height: auto; min-height: var(--header-height); gap: 8px; padding: 8px 12px; }
  .portal-mobile .topbar-left, .portal-mobile .topbar-breadcrumbs, .portal-mobile .topbar-right { min-width: 0; flex-wrap: wrap; gap: 6px; }
  .portal-mobile .topbar-left { flex: 1; }
  .portal-mobile .topbar-breadcrumbs { flex: 1; overflow-wrap: anywhere; }
  .portal-mobile .app-canvas { padding: 18px 12px; }
  .portal-mobile .portal-page-title h1 { font-size: 25px; }
  .portal-mobile .portal-page-header, .portal-mobile .kpi-grid, .portal-mobile .table-card { margin-bottom: 18px; }
  .portal-mobile .kpi-grid, .portal-mobile .split-layout, .portal-mobile .progression-split { gap: 12px; }
  .portal-mobile .kpi-card, .portal-mobile .split-pane, .portal-mobile .section-card, .portal-mobile .tester-card { padding: 16px; }
  .portal-mobile .kpi-value { font-size: 28px; }
  .portal-mobile .app-footer { padding: 18px 12px; }
  .portal-mobile .table-toolbar { padding: 12px; }
  .portal-mobile .table-toolbar-left, .portal-mobile .table-toolbar-right { flex-wrap: wrap; min-width: 0; }
  .portal-mobile .table-toolbar-left:has(.table-search-input) { flex-direction: column; align-items: stretch; }
  .portal-mobile .table-search-input, .portal-mobile .table-filter-select { min-width: 0; width: 100%; }
  .portal-mobile .search-box, .portal-mobile .selected-card, .portal-mobile .portal-header-actions { flex-wrap: wrap; gap: 8px; }
  .portal-mobile .search-box input { min-width: 0; flex: 1 1 150px; }
  .portal-mobile .selected-card > div { min-width: 0; overflow-wrap: anywhere; }
  .portal-mobile button, .portal-mobile .portal-btn, .portal-mobile .nav-link, .portal-mobile .sidebar-signout-btn { min-height: 44px; }
  .portal-mobile .mobile-menu-btn { min-width: 44px; flex-shrink: 0; }
  .portal-mobile input:not([type=checkbox]):not([type=radio]), .portal-mobile select, .portal-mobile textarea { font-size: 16px; }
  .portal-mobile .drawer-header, .portal-mobile .drawer-body, .portal-mobile .drawer-footer, .portal-mobile .modal-box { padding: 16px; }
  .portal-mobile .drawer-footer { flex-wrap: wrap; }
  .portal-mobile .tester-card { max-height: none; }
  .portal-mobile .portal-btn { white-space: normal; }
  .portal-mobile .module-card { min-height: 100px; padding: 16px; }
  .portal-mobile .module-card strong { font-size: 21px; }
  .portal-mobile .split-pane { min-width: 0; }
  .portal-mobile .mobile-wrap { flex-wrap: wrap; gap: 8px; }
  .portal-mobile .panel { padding: 16px; }
  .portal-mobile .panel h2, .portal-mobile .page-header h1 { font-size: 24px; }
  .portal-mobile .stepper { gap: 8px; }
}

/* Member home and record browsing: phone-only presentation. */
.mobile-member-home, .mobile-record-rail, .mobile-record-hint { display: none; }
#active-training, #competencies, #request-training { scroll-margin-top: 110px; }
@media (max-width: 640px) {
  #dashboard-view > [data-dashboard-grid], #dashboard-view > .desktop-services-title { display: none; }
  #dashboard-view .portal-page-header { margin-bottom: 20px; gap: 12px; }
  #dashboard-view #dashboard-subtitle { display: none; }
  .mobile-member-home, .mobile-home-links, .mobile-home-quick { display: grid; gap: 12px; }
  .mobile-member-home { padding-bottom: 16px; }
  .mobile-home-info, .mobile-home-action { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  .mobile-home-info h2, .mobile-home-quick h2 { font-size: 20px; margin: 0 0 8px; }
  .mobile-home-info p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
  .mobile-home-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
  .mobile-home-action { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--green-dark); min-height: 56px; }
  .mobile-home-action strong { display: flex; justify-content: space-between; gap: 12px; font-size: 18px; }
  .mobile-home-action > span { font-size: 15px; line-height: 1.45; }
  .mobile-home-action.featured { background: var(--green); border-color: var(--green); color: #fff; }
  .mobile-home-action:focus-visible, .mobile-record-rail:focus-visible { outline: 3px solid #8cc9aa; outline-offset: 2px; }
  .mobile-home-quick { margin-top: 8px; }
  .mobile-home-quick h2 { margin-bottom: 0; }
  .desktop-record-table { display: none; }
  .mobile-record-hint { display: block; margin: 12px 16px 0; color: var(--muted); font-size: 14px; }
  .mobile-record-rail { display: flex; gap: 12px; max-width: 100%; min-width: 0; overflow-x: auto; padding: 16px; scroll-snap-type: x proximity; scroll-padding-inline: 16px; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .mobile-record-card { flex: 0 0 min(82%, 290px); min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf8; scroll-snap-align: start; overflow-wrap: anywhere; }
  .mobile-record-card h3 { margin: 0 0 10px; font-size: 18px; }
  .mobile-record-status { margin: 0 0 14px; font-weight: 700; }
  .mobile-record-card dl { margin: 0; }
  .mobile-record-card dt { margin-top: 12px; font-size: 12px; color: var(--muted); text-transform: uppercase; }
  .mobile-record-card dd { margin: 3px 0 0; font-size: 15px; }
}

/* ==========================================================================
   myNWMES Cohesive Presentation Design System Additions
   ========================================================================== */

/* Skeleton Shimmer Loading */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-title {
  height: 20px;
  width: 50%;
  margin-bottom: 12px;
  border-radius: 4px;
}

.skeleton-card {
  min-height: 120px;
  border-radius: var(--radius-md);
}

/* Universal Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

.badge-status.current,
.badge-status.active,
.badge-status.processed,
.badge-status.verified {
  background: #dcfce7;
  color: #15803d;
}

.badge-status.due-soon,
.badge-status.pending,
.badge-status.warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-status.overdue,
.badge-status.error,
.badge-status.urgent,
.badge-status.invalid {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-status.paused,
.badge-status.cancelled,
.badge-status.info {
  background: #f1f5f9;
  color: #475569;
}

/* Dashboard Redesign: Top Hero Header */
.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.dash-hero-title-group h1 {
  margin: 0 0 6px 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.dash-hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.dash-meta-badge.membership {
  background: var(--green-soft);
  color: var(--green-dark);
}

.dash-meta-badge.member-id {
  background: #f1f5f9;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.dash-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Dashboard Redesign: Compact Summary Strip */
.dash-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.dash-summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dash-summary-card:hover {
  border-color: var(--green-accent);
  box-shadow: var(--shadow-md);
}

.dash-summary-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-summary-main {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 6px 0 2px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.dash-summary-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dashboard Redesign: Things Needing Attention */
.dash-attention-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.dash-attention-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
}

.dash-attention-item.urgent {
  background: #fef2f2;
  border-color: var(--danger);
  color: #991b1b;
}

.dash-attention-item.warning {
  background: #fffbeb;
  border-color: var(--warning);
  color: #92400e;
}

.dash-attention-item.info {
  background: #f0f9ff;
  border-color: var(--info);
  color: #075985;
}

.dash-attention-calm {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 22px;
}

/* Dashboard Redesign: 2-Column Main Content Grid */
.dash-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 20px;
  margin-bottom: 28px;
}

.dash-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 960px) {
  .dash-summary-strip {
    grid-template-columns: 1fr;
  }
  .dash-content-grid {
    grid-template-columns: 1fr;
  }
}

/* Universal Section Card Styling across Admin and Member views */
.portal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.portal-card-header {
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portal-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.portal-card-body,
.table-card-body,
.card-body {
  padding: 24px 32px;
}

/* Card Heading Icon Alignment */
.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--green);
  flex-shrink: 0;
}

.card-title-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Compact Competency Status Pill Badges */
.comp-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.comp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

.comp-pill.current {
  background: #eaf5ec;
  color: #005d2f;
  border: 1px solid #bce2c7;
}

.comp-pill.due-soon {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

.comp-pill.overdue {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.comp-pill.paused {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.comp-pill-icon {
  display: inline-flex;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Event & Volunteer Rows with Subtle Dividers */
.event-rows-list {
  display: flex;
  flex-direction: column;
}

.event-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #eef2ef;
}

.event-row:first-child {
  padding-top: 0;
}

.event-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.volunteer-card-list {
  display: flex;
  flex-direction: column;
}

.volunteer-item {
  padding: 20px 0;
  border-bottom: 1px solid #eef2ef;
}

.volunteer-item:first-child {
  padding-top: 0;
}

.volunteer-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.volunteer-item.is-volunteered {
  background: #f7faf7;
  padding: 18px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid #d1ebd8;
  margin-bottom: 14px;
}

/* Universal Search Control */
.portal-search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.portal-search-bar input {
  flex: 1;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.portal-search-bar input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 93, 47, 0.15);
}

/* Responsive Content Spacing for Cards */
@media (max-width: 768px) {
  .portal-card-header,
  .table-toolbar {
    padding: 14px 20px;
  }
  .portal-card-body,
  .table-card-body,
  .card-body,
  .portal-body .split-pane {
    padding: 18px 20px;
  }
  .volunteer-item.is-volunteered {
    padding: 14px 16px;
  }
}

@media (max-width: 480px) {
  .portal-card-header,
  .table-toolbar {
    padding: 12px 16px;
  }
  .portal-card-body,
  .table-card-body,
  .card-body,
  .portal-body .split-pane {
    padding: 16px 16px;
  }
  .event-row {
    padding: 12px 0;
  }
}

/* ==========================================================================
   Special Events & Ticket Presentation (Website v2)
   ========================================================================== */

.special-event-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: 24px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.special-event-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink, #0f172a);
}

.special-event-meta {
  color: var(--green, #005d2f);
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.special-event-desc {
  color: var(--text, #334155);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 16px;
}

.special-event-instructions {
  background: var(--green-soft, #eef6f1);
  border-left: 4px solid var(--green, #005d2f);
  padding: 12px 18px;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: #1e3a29;
  margin: 0 0 18px;
  line-height: 1.5;
}

.ticket-request-form {
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  padding: 18px 22px;
  margin-top: 18px;
}

.qty-stepper-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 0 16px;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: var(--radius-sm, 8px);
  padding: 4px;
}

.btn-step {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line, #cbd5e1);
  background: #fff;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink, #0f172a);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-step:hover:not(:disabled) {
  background: var(--green-soft, #eef6f1);
  border-color: var(--green, #005d2f);
  color: var(--green, #005d2f);
}

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

.qty-display {
  font-size: 18px;
  font-weight: 800;
  min-width: 32px;
  text-align: center;
  color: var(--ink, #0f172a);
}

.ticket-forward-notice {
  background: #f0fdf4;
  border: 1px dashed var(--green, #005d2f);
  border-radius: var(--radius-sm, 8px);
  padding: 12px 16px;
  font-size: 13.5px;
  color: #166534;
  line-height: 1.5;
  margin: 14px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ticket-forward-notice-icon {
  flex-shrink: 0;
  color: var(--green, #005d2f);
  margin-top: 1px;
}

/* Confirmed Ticket Frame */
.ticket-confirmed-card {
  background: #ffffff;
  border: 2px solid var(--green, #005d2f);
  border-radius: var(--radius-md, 12px);
  padding: 24px 28px;
  margin-top: 16px;
  box-shadow: 0 4px 14px rgba(0, 93, 47, 0.08);
}

.ticket-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.ticket-ref-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ticket-ref-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #64748b);
}

.ticket-ref-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--green-dark, #004322);
}

.ticket-body-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: center;
}

.ticket-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #fafbfc;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  padding: 12px;
}

.ticket-qr-wrap svg,
.ticket-qr-wrap img {
  width: 176px;
  height: 176px;
  display: block;
}

.ticket-qr-hint {
  font-size: 11px;
  color: var(--muted, #64748b);
  text-align: center;
}

.ticket-details-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-qty-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  background: #e6f4ea;
  color: #137333;
  padding: 4px 12px;
  border-radius: 999px;
  width: fit-content;
}

.ticket-qty-pill.partial {
  background: #fef3c7;
  color: #92400e;
}

/* Status Cards for Pending and Waitlisted */
.booking-status-card {
  border-radius: var(--radius-sm, 8px);
  padding: 18px 22px;
  margin-top: 16px;
  border: 1px solid transparent;
}

.booking-status-card.pending {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.booking-status-card.waitlisted {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.booking-status-card.cancelled,
.booking-status-card.declined {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

/* Admin Metric Tiles */
.admin-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}

.metric-tile {
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-tile-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #64748b);
}

.metric-tile-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink, #0f172a);
  line-height: 1.1;
}

.metric-tile-val.highlight {
  color: var(--green, #005d2f);
}

/* Admin Reservations Table */
.reservations-box {
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 20px 24px;
}

.reservations-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.reservation-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  background: #f8fafc;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 28px;
}

.filter-btn:hover {
  background: #eef2f6;
  color: var(--ink, #0f172a);
}

.filter-btn.active {
  background: var(--green, #005d2f);
  border-color: var(--green, #005d2f);
  color: #ffffff;
}

.reservations-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
}

.reservations-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.reservations-table th {
  background: #f8fafc;
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #64748b);
  border-bottom: 1px solid var(--line, #e2e8f0);
  white-space: nowrap;
}

.reservations-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line, #e2e8f0);
  color: var(--ink, #0f172a);
  vertical-align: middle;
}

.reservations-table tbody tr:hover {
  background: #fbfcfd;
}

.res-actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.qty-alloc-input {
  width: 50px;
  min-height: 32px;
  padding: 2px 6px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 4px;
  text-align: center;
}

.admin-priority-select {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--line, #cbd5e1);
  background: #fff;
  color: var(--ink, #0f172a);
}

/* Special Events Ticket Limit Overrides */
.overrides-box {
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 20px 24px;
  margin-top: 16px;
}

.overrides-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.overrides-toolbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.overrides-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.member-search-wrap {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1050;
  margin-top: 4px;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: #f8fafc;
  color: var(--green, #005d2f);
}

.selected-member-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  margin-top: 8px;
}

.preview-box {
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  padding: 8px 12px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-box-large {
  max-width: 720px;
  width: 90vw;
}

/* Ticket Scanner Section */
.scanner-card {
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.scanner-input-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.scanner-input-row input {
  flex: 1;
  min-width: 220px;
  min-height: 42px;
  padding: 8px 14px;
  font-family: ui-monospace, monospace;
  font-size: 15px;
  border: 1.5px solid var(--line, #cbd5e1);
  border-radius: var(--radius-sm, 6px);
}

.scanner-result-box {
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-sm, 8px);
  border: 1.5px solid transparent;
}

.scanner-result-box.valid {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.scanner-result-box.already-used {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.scanner-result-box.error {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.scanner-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-sm, 6px);
  margin-bottom: 8px;
}

.scanner-tag-valid {
  background: #166534;
  color: #ffffff;
}

.scanner-tag-used {
  background: #dc2626;
  color: #ffffff;
}

.scanner-tag-invalid {
  background: #991b1b;
  color: #ffffff;
}

@media (max-width: 640px) {
  .ticket-body-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .special-event-card {
    padding: 18px 20px;
  }
}


/* Shared finishing rules: retain existing tokens and desktop layout. */
.app-main-wrapper, .portal-page-title, .portal-header-actions,
.table-card, .table-toolbar > *, .section-card, .ballot-card { min-width: 0; }
.portal-page-title h1, .panel-subtitle, .message, .alert-banner,
.selected-card, .ballot-title, .request-meta { overflow-wrap: anywhere; }
.portal-header-actions, .modal-actions { flex-wrap: wrap; }
.portal-header-actions { max-width: 100%; }
.portal-btn, .btn { font-family: inherit; line-height: 1.35; }
.portal-btn > svg, .btn > svg { flex-shrink: 0; }
.portal-btn:disabled:hover { cursor: not-allowed; }
.portal-btn.primary:disabled:hover { background: var(--green); }
.portal-btn.secondary:disabled:hover { background: var(--surface); }

/* Older governance tools use the same table treatment as the member portal. */
.portal-table, .member-results-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.portal-table th, .member-results-table th {
  padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700;
  color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line);
}
.portal-table td, .member-results-table td {
  padding: 12px 16px; vertical-align: top; border-bottom: 1px solid var(--line);
}
.portal-table tbody tr:last-child td { border-bottom: 0; }
.table-container, .portal-table-scroll, #scan-results-container { max-width: 100%; overflow-x: auto; }
.table-container:focus-visible, .portal-table-scroll:focus-visible { outline-offset: -3px; }

/* Keep long governance dialogs and their action buttons inside the viewport. */
.modal-overlay { padding: 16px; overflow-y: auto; }
.modal-overlay > div, .modal-box, .modal-card {
  background: var(--surface, #ffffff);
  max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  border-radius: var(--radius-md); border: 1px solid var(--line);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.selected-card { gap: 12px; }
.selected-card > div, .search-box input { min-width: 0; }
.form-field, .form-group, .form-grid > *, .form-grid-2 > * { min-width: 0; }
.alert-banner, .empty-state { border-radius: var(--radius-md); line-height: 1.5; }
[class*="badge-status-"], .badge-active, .badge-revoked {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 600;
  line-height: 1.5; white-space: normal;
}
.badge-active { background: var(--green-soft); color: var(--green-dark); }
.badge-revoked { background: #fee2e2; color: var(--danger); }

@media (max-width: 640px) {
  .portal-mobile .portal-page-header { gap: 12px; }
  .portal-mobile .portal-header-actions { width: 100%; flex-shrink: 1; }
  .portal-mobile .portal-header-actions > * { max-width: 100%; }
  .portal-mobile .form-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .portal-mobile .modal-overlay { padding: 12px; }
  .portal-mobile .modal-overlay > div { width: 100% !important; padding: 16px !important; max-height: calc(100dvh - 24px); }
  .portal-mobile .modal-overlay > div > div:has(> button) { flex-wrap: wrap; }
  .portal-mobile .selected-card { flex-wrap: wrap; }
  .portal-mobile .search-box { flex-wrap: wrap; }
  .portal-mobile .portal-table th, .portal-mobile .portal-table td { padding: 10px 12px; }
  .portal-mobile .table-container { overscroll-behavior-x: contain; }
  .portal-mobile .radio-option, .portal-mobile .filter-btn { min-height: 44px; }
  .portal-mobile input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  .portal-mobile select { min-height: 44px; max-width: 100%; }
  .portal-mobile .table-toolbar-left, .portal-mobile .table-toolbar-right { max-width: 100%; }
  .privacy-container { margin: 16px auto; padding: 0 12px 24px; }
  .privacy-card { padding: 20px 16px; }
  .privacy-brand { min-width: 0; }
  .privacy-brand-sub { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
@media (max-width: 640px) {
  .portal-mobile .panel h2 { font-size: 20px; }
  .portal-mobile .page-header h1 { font-size: 25px; }
}
/* Do not apply the generic full-page main height to the sign-in card. */
.portal-login-card-pane { min-height: 0; }
@media (max-width: 640px) {
  .portal-login-shell { padding: 16px 12px; }
  .portal-login-brand-pane, .portal-login-card-pane { padding: 24px 20px; }
  .portal-login-crest-container { padding: 0 0 16px; }
  .portal-login-crest { height: 48px; }
  .portal-login-title { font-size: 28px; }
}
/* Governance overlays share the same external layout as member dialogs. */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex;
  align-items: center; justify-content: center; background: rgba(15, 23, 42, .65);
}
.modal-overlay > div { background: var(--surface); box-shadow: var(--shadow-lg); }
.event-form-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  padding: 24px; margin-bottom: 24px;
}
@media (max-width: 640px) {
  .event-form-panel { padding: 16px; margin-bottom: 18px; }
}

/* Assessor Guidance & Expected Answer */
.assessor-guidance-box {
  margin: 10px 0 14px;
  padding: 12px 14px;
  background: #f0fdf4;
  border-left: 4px solid var(--green, #005d2f);
  border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
  font-size: 13.5px;
  line-height: 1.5;
}
.assessor-guidance-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green, #005d2f);
  margin-bottom: 4px;
}
.assessor-guidance-text {
  color: var(--ink, #1e293b);
  white-space: pre-wrap;
}

/* Question Bank Admin Badges & Elements */
.badge-always-include {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-optional {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 9999px;
}
.qb-config-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.qb-config-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.qb-config-input {
  width: 90px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
}
.qb-question-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}
.qb-question-card:hover {
  border-color: var(--green-accent, #005d2f);
}
.qb-question-card.inactive {
  opacity: 0.65;
  background: #f8fafc;
}
.qb-question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.qb-question-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.qb-question-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.qb-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.qb-select-card {
  margin-bottom: 20px;
  padding: 16px 20px;
}
.qb-select-label {
  font-weight: 600;
  font-size: 14px;
  display: block;
  margin-bottom: 6px;
}
.qb-competency-select {
  width: 100%;
  max-width: 480px;
  font-size: 15px;
  font-weight: 600;
}
.qb-config-title {
  font-size: 18px;
  margin: 0 0 4px;
  font-weight: 700;
}
.qb-stats-strip {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.qb-stat-badge {
  font-size: 11px;
  padding: 2px 7px;
}
.qb-config-label {
  font-size: 14px;
  font-weight: 600;
}
.qb-config-message {
  margin: 0;
  font-size: 13px;
}
.qb-questions-container {
  padding: 16px 20px;
}
.qb-modal-panel {
  max-width: 680px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}
.qb-modal-title {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 20px;
}
.qb-form-group {
  margin-bottom: 14px;
}
.qb-form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.qb-form-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 6px;
}
.qb-form-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
}
.qb-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.qb-form-input,
.qb-form-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
}
.qb-checkbox-group {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qb-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}
.qb-modal-error {
  margin-bottom: 14px;
}
.qb-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.qb-empty-msg {
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
}
.qb-order-span {
  color: var(--muted);
  margin-right: 6px;
}

/* Membership Administration Subnav Tabs */
.portal-subnav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 24px;
}

.portal-subnav-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: -2px;
  transition: all 0.15s ease-in-out;
}

.portal-subnav-btn:hover {
  color: var(--text);
}

.portal-subnav-btn.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

/* Subscription status banner in My Details */
.subscription-status-card {
  margin-bottom: 18px;
}

.subscription-status-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: #f8faf8;
  border: 1px solid var(--line);
}

.subscription-status-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  display: block;
}

.subscription-status-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}

.subs-history-item {
  border-left: 3px solid var(--line);
  padding: 8px 14px;
  margin-bottom: 12px;
  background: #f8fafc;
  border-radius: 0 4px 4px 0;
}

.subs-history-item.voided {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.subs-history-item.corrected {
  border-left-color: #d97706;
}




/* Web Notification Bell & Notification Centre */
.nav-notification-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-color, #334155);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}
.portal-mobile .nav-notification-btn {
  min-height: 36px;
  min-width: 36px;
  max-height: 36px;
  padding: 0;
}
.nav-notification-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}
.nav-notification-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--green-dark, #005d2f);
}
.nav-notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid #fff;
}
.nav-notification-badge.hidden {
  display: none !important;
}

.notification-centre-panel {
  position: fixed;
  top: 60px;
  right: 16px;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 80px);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notification-centre-panel.hidden {
  display: none !important;
}
.notification-centre-header {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notification-centre-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.notification-centre-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}
.notification-centre-close:hover {
  color: #0f172a;
}
.notification-centre-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}
.notification-tab-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
}
.notification-tab-btn.active {
  background: #ffffff;
  color: #005d2f;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.notification-bulk-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 6px 16px;
  font-size: 11px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}
.notification-action-link {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.notification-action-link:hover {
  color: #1d4ed8;
}
.notification-action-link.danger {
  color: #dc2626;
}
.notification-action-link.danger:hover {
  color: #b91c1c;
}
.notification-centre-list {
  flex: 1;
  overflow-y: auto;
  max-height: 420px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  cursor: pointer;
  transition: background 0.1s ease;
}
.notification-item:hover {
  background: #f8fafc;
}
.notification-item.unread {
  background: #f0fdf4;
}
.notification-item.unread:hover {
  background: #e6f9ed;
}
.notification-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.notification-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.notification-item-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  background: #fee2e2;
  color: #b91c1c;
  white-space: nowrap;
}
.notification-item-msg {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}
.notification-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.notification-item-time {
  font-size: 11px;
  color: #94a3b8;
}
.notification-item-actions {
  display: flex;
  gap: 8px;
}
.notification-btn-sm {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
}
.notification-btn-sm:hover {
  color: #0f172a;
  text-decoration: underline;
}
.notification-btn-sm.delete:hover {
  color: #dc2626;
}
.notification-empty {
  padding: 36px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

/* Administration Hub Redesign (Phase 2) */
.admin-search-container {
  position: relative;
  margin: 0 0 24px;
}
.admin-search-container input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: #ffffff;
  font-size: 15px;
  color: var(--text-color, #0f172a);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.admin-search-container input:focus {
  outline: none;
  border-color: var(--green-dark, #005d2f);
  box-shadow: 0 0 0 3px rgba(0, 93, 47, 0.12);
}
.admin-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}
.admin-search-results {
  margin-top: -16px;
  margin-bottom: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}
.admin-search-results.hidden {
  display: none !important;
}
.admin-search-item {
  display: block;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s ease;
}
.admin-search-item:last-child {
  border-bottom: none;
}
.admin-search-item:hover {
  background: #f8fafc;
}
.admin-search-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.admin-search-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}
.admin-search-item-cat {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
}
.admin-search-item-desc {
  font-size: 12px;
  color: #475569;
  margin-top: 2px;
}

.admin-action-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 18px 24px;
  margin-bottom: 28px;
}
.admin-action-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #dcfce7;
  color: #15803d;
  flex-shrink: 0;
}
.admin-action-banner h2 {
  font-size: 17px;
  font-weight: 700;
  color: #14532d;
  margin: 0 0 2px;
}
.admin-action-banner p {
  font-size: 13px;
  color: #166534;
  margin: 0;
}

.admin-category-block {
  margin-bottom: 32px;
}
.admin-category-header {
  margin-bottom: 14px;
}
.admin-category-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-category-desc {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}
.admin-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.admin-func-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
  min-height: 100px;
}
.admin-func-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}
.admin-func-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.admin-func-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.admin-func-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
}
.admin-func-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  white-space: nowrap;
}
.admin-func-chip.action-needed {
  background: #fee2e2;
  color: #b91c1c;
}

/* --- Action Centre & My Requests Styles --- */
.action-centre-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
  overflow-x: auto;
}
.action-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.action-tab-btn:hover {
  color: #0f172a;
}
.action-tab-btn.active {
  color: #005d2f;
  border-bottom-color: #005d2f;
}
.action-tab-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}
.action-tab-btn.active .action-tab-count {
  background: #dcfce7;
  color: #166534;
}

.action-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.action-filter-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.action-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.action-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s ease;
}
.action-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.action-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.action-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.action-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.action-card-meta {
  font-size: 13px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.action-card-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.action-card-summary {
  font-size: 14px;
  color: #334155;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 6px;
  border-left: 3px solid #cbd5e1;
  margin: 0;
}
.action-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.action-card-assignee {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #475569;
}
.action-card-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Conversation Drawer / Modal */
.conversation-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 12px 4px;
  margin-bottom: 14px;
}
.conversation-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 80%;
}
.conversation-message.mine {
  align-self: flex-end;
  align-items: flex-end;
}
.conversation-message.theirs {
  align-self: flex-start;
  align-items: flex-start;
}
.conversation-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}
.conversation-message.mine .conversation-bubble {
  background: #005d2f;
  color: #ffffff;
  border-bottom-right-radius: 2px;
}
.conversation-message.theirs .conversation-bubble {
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 2px;
}
.conversation-meta {
  font-size: 11px;
  color: #94a3b8;
}
.conversation-input-box {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.conversation-textarea {
  flex: 1;
  min-height: 60px;
  resize: vertical;
}

.shortcut-card {
  margin-top: 20px;
  padding: 18px 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.shortcut-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.shortcut-card-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.shortcut-card-desc {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

/* Key Administration */
.kpi-grid-6 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-card-keys {
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-card-keys .kpi-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink, #0f172a);
  line-height: 1.2;
}
.kpi-card-keys .kpi-label {
  font-size: 0.8rem;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.keys-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-pill {
  padding: 6px 12px;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 20px;
  background: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink, #334155);
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-pill:hover {
  background: var(--surface-hover, #f1f5f9);
}
.filter-pill.active {
  background: var(--primary, #005d2f);
  color: #ffffff;
  border-color: var(--primary, #005d2f);
}
.badge-manual {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}
.badge-automatic {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
}
.badge-date-unknown {
  color: #b45309;
  font-weight: 600;
}
.history-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 0.82rem;
}
.history-card-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 4px;
  color: #334155;
}
.history-card-reason {
  color: #475569;
  font-style: italic;
}
.table-empty-cell {
  text-align: center;
  padding: 24px;
}
.table-cell-sub {
  font-size: 0.8rem;
}
.table-actions-cell {
  text-align: right;
}
.convo-closed-notice {
  margin-top: 10px;
  font-style: italic;
}
.conversation-empty {
  text-align: center;
  padding: 1rem;
}

.keys-search-box {
  display: flex;
  gap: 8px;
  align-items: center;
}
.keys-search-input {
  max-width: 260px;
}
.modal-box-wide {
  max-width: 620px;
}
.modal-header-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header-title {
  margin: 0;
  font-size: 1.25rem;
}
.target-summary-box {
  background: #f1f5f9;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.88rem;
}
.form-label-bold {
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}
.form-radio-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.text-danger-star {
  color: #b91c1c;
}
.history-title {
  margin: 0 0 8px 0;
  font-size: 0.9rem;
  color: #475569;
}
.history-scroll-list {
  max-height: 160px;
  overflow-y: auto;
}
.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}
.mt-3 {
  margin-top: 12px;
}
.mt-4 {
  margin-top: 16px;
}
.block-hint {
  display: block;
  margin-top: 4px;
}

/* Training Request Details & Action Card Interactivity */
.training-request-row {
  cursor: pointer;
}
.training-request-row:focus-visible {
  outline: 2px solid var(--primary, #005d2f);
  outline-offset: -2px;
}

.action-card.is-clickable,
.action-card[data-type="training_request"] {
  cursor: pointer;
}
.action-card:focus-visible {
  outline: 2px solid var(--primary, #005d2f);
  outline-offset: 2px;
}

.request-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.request-details-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.request-details-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.05em;
}
.request-details-val {
  font-size: 14px;
  color: #0f172a;
}
.request-notes-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  color: #334155;
  white-space: pre-wrap;
}
.request-competency-info {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #166534;
}
.request-competency-info.warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.training-req-actions-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.request-notes-candidate {
  margin-top: 4px;
}
.request-competency-bold {
  font-weight: 600;
}
.request-subtext {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}
.request-empty-msg {
  margin: 0;
  font-size: 13px;
}


