body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; padding: 0; background: #f5f5f7; }

:root {
  /* Authorization & Step State Colors */
  --auth-yes-solid: #059669;
  --auth-yes-soft: #10b981;
  --auth-yes-pale: #ecfdf5;

  --auth-no-solid: #dc2626;
  --auth-no-soft: #ef4444;
  --auth-no-pale: #fef2f2;

  --auth-hold-solid: #475569;
  --auth-hold-soft: #64748b;
  --auth-hold-pale: #f1f5f9;

  --auth-disc-solid: #d97706;
  --auth-disc-soft: #fbbf24;
  --auth-disc-pale: #fefce8;
}

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

.topnav {
  background: #1e3a8a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 12px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.topnav-left { display: flex; align-items: center; gap: 24px; height: 100%; }
.topnav-nav { height: 100%; }
.topnav-nav .topnav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.topnav-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  transition: background 0.2s, color 0.2s;
}
.topnav-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
/* Icon-only nav entries (Dashboard): glyph on desktop, glyph + label on mobile */
.topnav-nav a.nav-icon-link { gap: 8px; }
.topnav-nav .nav-icon { width: 20px; height: 20px; display: block; flex: none; }
.topnav-nav .nav-icon-label { display: none; }
.topnav-right { display: flex; gap: 20px; align-items: center; height: 100%; }
.user-meta { display: flex; align-items: center; gap: 12px; }
.user-label { color: rgba(255,255,255,0.7); font-size: 0.9rem; font-weight: 600; }
.username-link { color: #fff; text-decoration: none; font-weight: normal; border-bottom: 2px solid transparent; transition: border-color 0.2s; }
.username-link:hover { border-bottom-color: #fff; }
.logout-badge { background: rgba(255,255,255,0.15); color: #fff; padding: 2px 14px; border-radius: 10px; font-weight: 700; text-decoration: none; font-size: 0.85rem; transition: background 0.2s; }
.lang-badges { display: flex; gap: 4px; align-items: center; }
.lang-badge { background: rgba(255,255,255,0.15); color: #fff; padding: 2px 10px; border-radius: 10px; font-weight: 700; text-decoration: none; font-size: 0.85rem; transition: background 0.2s; }
.lang-badge:hover { background: rgba(255,255,255,0.28); }
.lang-badge-active { background: rgba(255,255,255,0.35); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.75); }

.topnav .hamburger { display: none; background: rgba(255,255,255,0.06); border: none; color: #fff; font-size: 18px; padding: 6px; border-radius: 6px; }
.topnav .hamburger:hover { background: rgba(255,255,255,0.12); }
.topnav .subnav { position: absolute; display: none; left: 0; top: 100%; background: #fff; color: #111; border-radius: 8px; padding: 4px; box-shadow: 0 6px 18px rgba(15,23,42,0.12); min-width: 160px; width: max-content; z-index: 1000; list-style: none; }
.topnav .subnav a { color: #111; font-weight: 700; display: block; padding: 2px 8px; text-decoration: none; white-space: nowrap; }
.topnav .subnav a:hover { background: #f3f4f6; }
.topnav li.dropdown { position: relative; }
.topnav li.dropdown:hover .subnav { display: block; }

.container { padding: 16px; }

.app-content { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: calc(100vh - 56px); padding-top: 8px; }

.app-footer { 
  margin-top: auto; 
  padding: 5px 20px; 
  border-top: 1px solid #e2e8f0; 
  background: gray;

}
.app-footer .footer-content { 
  display: flex; 
  justify-content: space-between;
  align-items: center;
}
.app-footer a { 
  color: whitesmoke; 
  text-decoration: none; 
  font-size: 0.9rem; 
  font-weight: 500;
  transition: color 0.2s;
}
.app-footer a:hover { 
  color: #1e40af; 
  text-decoration: underline;
}

.login-card { max-width: 480px; margin: 32px auto; padding: 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(15,23,42,0.06); background: #fff; }
.login-card h1 { margin-bottom: 8px; }
.login-card p { margin-bottom: 12px; color: #374151; }
.login-card label { font-weight: 700; font-size: 0.9rem; }
.login-card input[type="text"], .login-card input[type="password"] { padding: 8px; border-radius: 6px; border: 1px solid #d1d5db; margin-top: 4px; margin-bottom: 6px; width: 100%; }

.card { 
  background: #fff; 
  border-radius: 12px; 
  padding: 4px 16px; 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); 
  border: 1px solid rgba(0,0,0,0.05);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.card.no-padding { padding: 0; }
.card-header { padding: 8px 16px; border-bottom: 1px solid #eee; background: #f9fafb; display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { margin: 0; font-size: 1.05rem; }
.card > h3:first-child, .card > h2:first-child { margin-top: 0; margin-bottom: 8px; }

.btn { 
  background: #1e40af; 
  color: #fff; 
  padding: 2px 12px; 
  text-decoration: none; 
  border-radius: 6px; 
  border: 1px solid transparent;
  font-weight: 400;
  font-size: 0.9rem;
  transition: all 0.2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.25;
}
.btn:hover { background: #1d4ed8; border-color: rgba(255,255,255,0.1); }
.btn:active { transform: translateY(1px); }

.btn-sm {
  padding: 4px 8px;
  font-size: 0.8rem;
  border-radius: 4px;
}

.btn-secondary {
  background: #64748b;
}
.btn-secondary:hover { background: #475569; }

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 700;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab-btn.active {
  color: #1e40af;
  border-bottom: 2px solid #1e40af;
}

.btn-filter {
  background: #334155;
  color: #fff;
}
.btn-filter:hover {
  background: #1e293b;
}

.btn-add {
  height: 100%;
  padding: 8px 16px;
  background: blue;
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
}
.btn-add:hover {
  background: darkblue;
}

.btn-danger {
  background: #ef4444;
}
.btn-danger:hover { background: #dc2626; }

/* ── Shared tab navigation ──────────────────────────────── */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 2px solid #1e40af;
  margin-bottom: 0;
}
.tab-btn {
  padding: 8px 18px;
  border: 1px solid #94a3b8;
  border-bottom: 2px solid #1e40af;
  background: #fff;
  cursor: pointer;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  font-weight: 500;
  font-size: 0.95rem;
  color: #1e293b;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s, color 0.15s;
}
.tab-btn:hover { background: #eff6ff; color: #1e40af; }
.tab-btn.active { background: #1e40af; color: #fff; border-color: #1e40af; border-bottom-color: #1e40af; }
.tab-btn-sm { padding: 4px 12px; font-size: 0.82rem; }
.tab-content { display: none; }

/* ── Calling info tooltip ───────────────────────────────────── */
[data-sc-id] {
  cursor: default;
  border-bottom: 1px dashed #94a3b8;
  display: inline;
}
.calling-tooltip {
  display: none;
  position: absolute;
  z-index: 9999;
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 8px;
  padding: 10px 14px;
  min-width: 200px;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  font-size: 0.82rem;
  line-height: 1.5;
  pointer-events: auto;
}
.calling-tooltip .ct-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #93c5fd;
  margin-bottom: 8px;
  border-bottom: 1px solid #334155;
  padding-bottom: 6px;
}
.calling-tooltip .ct-table {
  width: 100%;
  border-collapse: collapse;
}
.calling-tooltip .ct-label {
  color: #94a3b8;
  font-size: 0.78rem;
  padding: 2px 8px 2px 0;
  white-space: nowrap;
  vertical-align: top;
}
.calling-tooltip .ct-value {
  color: #e2e8f0;
  padding: 2px 0;
}
.calling-tooltip .ct-empty {
  color: #64748b;
  font-style: italic;
}
/* ─────────────────────────────────────────────────────────── */
.tab-content.active { display: block; }
/* ─────────────────────────────────────────────────────────── */

.step-value-btn {
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #000;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}

.step-value-btn:hover:not(:disabled) { 
  filter: brightness(0.95);
}

.step-value-btn.yes {
  color: #fff;
  border-color: var(--auth-yes-solid);
  background: var(--auth-yes-solid);
}
.step-value-btn.no {
  color: #fff;
  border-color: var(--auth-no-solid);
  background: var(--auth-no-solid);
}
.step-value-btn.hold {
  color: #000;
  border-color: var(--auth-hold-soft);
  background: var(--auth-hold-pale);
}
.step-value-btn.disc {
  color: #000;
  border-color: var(--auth-disc-soft);
  background: var(--auth-disc-soft);
}
.step-value-btn.active {
  background: black;
  color: #fff;
  border-color: #000;
}
.step-value-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.step-value-btn.hidden {
  display: none;
}

/* Status Badges */
.status-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid;
}
.status-badge.yes { color: var(--auth-yes-soft); border-color: var(--auth-yes-soft); background: var(--auth-yes-pale); }
.status-badge.no { color: var(--auth-no-soft); border-color: var(--auth-no-soft); background: var(--auth-no-pale); }
.status-badge.hold { color: var(--auth-hold-soft); border-color: var(--auth-hold-soft); background: var(--auth-hold-pale); }
.status-badge.disc { color: var(--auth-disc-solid); border-color: var(--auth-disc-soft); background: var(--auth-disc-pale); }

/* Platform count badges (used for sustain/HC progress counts) */
.count-badge {
  display: inline-block;
  min-width: 34px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #3b82f6;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.count-badge.interactive {
  cursor: pointer;
}

/* HC Vote Pills */
.hc-vote-pill.none { background: #f9fafb; border-color: #e5e7eb; color: #000; }
.hc-vote-pill.yes { background: var(--auth-yes-pale); border-color: var(--auth-yes-soft); color: #000; }
.hc-vote-pill.no { background: var(--auth-no-pale); border-color: var(--auth-no-soft); color: #000; }
.hc-vote-pill.hold { background: var(--auth-hold-pale); border-color: var(--auth-hold-soft); color: #000; }
.hc-vote-pill.disc { background: var(--auth-disc-pale); border-color: var(--auth-disc-soft); color: #000; }

/* HC Vote Badges (inside pills) */
.hc-vote-badge.none { background: #94a3b8; color: #fff; }
.hc-vote-badge.yes { background: var(--auth-yes-solid); color: #fff; }
.hc-vote-badge.no { background: var(--auth-no-solid); color: #fff; }
.hc-vote-badge.hold { background: var(--auth-hold-solid); color: #fff; }
.hc-vote-badge.disc { background: var(--auth-disc-solid); color: #fff; }

.compact-table { 
  table-layout: auto !important; 
  width: 100%; 
  border-collapse: collapse;  
}

/* Rounded bordered tables */
.compact-table.rounded-table {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
.compact-table.rounded-table.table-auto {
  width: auto;
  min-width: 400px;
}
.compact-table.rounded-table.account-link-table {
  min-width: 0;
}
.compact-table.rounded-table thead th:first-child { border-top-left-radius: 7px; }
.compact-table.rounded-table thead th:last-child { border-top-right-radius: 7px; }
.compact-table.rounded-table tbody tr:last-child td { border-bottom: 0; }
.compact-table.rounded-table tbody tr:last-child td:first-child { border-bottom-left-radius: 7px; }
.compact-table.rounded-table tbody tr:last-child td:last-child { border-bottom-right-radius: 7px; }

.compact-table thead th { background: #334155; color: #ffffff; text-align: left; padding: 6px 8px; border-bottom: 2px solid #e2e8f0; font-weight: 600; cursor: pointer; }
.compact-table thead th:hover { background: #1e293b; }
.compact-table tbody td { 
  padding: 4px 8px; 
  border-bottom: 1px solid #f1f5f9; 
  line-height: 1.25; 
  vertical-align: middle;
  word-wrap: break-word;
  word-break: break-word;
}
.compact-table select, .compact-table input {
  max-width: 100%;
}

/* ─── Group bracket styles for table view (mobile only) ─── */
@media (max-width: 768px) {
  .proposal-group-row.group-start > td.group-left {
    border-top: 2px solid #6366f1;
  }
  .proposal-group-row > td.group-left {
    border-left: 3px solid #6366f1;
  }
  .proposal-group-row.group-end > td.group-left {
    border-bottom: 2px solid #6366f1;
  }
}

.proposal-group-row > td.group-cell {
  background: #f8f8ff;
}
/* Hover for grouped rows must override the td background */
.compact-table tbody tr.proposal-group-row:hover > td {
  background: #dbeafe !important;
}

/* Hover for proposal cards (both grouped and ungrouped) */
.proposal2-card:hover {
  background: #dbeafe;
  border-color: #64748b;
}

#reportTable_filter select, .list-filter select {
  max-width: 120px;
}

.list-filter { background: #fff; padding: 5px; border-radius: 12px; margin-bottom: 0px; border: 1px solid rgba(0,0,0,0.05); display: flex; gap: 4px; align-items: flex-end; }
.list-footer { margin-top: 8px; font-size: 0.85rem; color: #64748b; }

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: #fff;
  width: 100%;
  max-width: 550px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 20px;
}
.modal-header { margin-bottom: 12px; border-bottom: 1px solid #f1f5f9; padding-bottom: 8px; }
.modal-header h3 { margin: 0; color: #1e293b; }
.modal-footer { margin-top: 16px; display: flex; gap: 8px; justify-content: flex-end; }

.form-group { margin-bottom: 4px; }
.form-group label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 1px; color: #475569; }
.form-group input[type="text"], .form-group input[type="number"], .form-group select, .form-group textarea {
  width: 100%; padding: 4px; border-radius: 6px; border: 1px solid #d1d5db; font-size: 0.9rem; 
  
}

.header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.header-row h2 { margin: 0; }

/* Page-level headers and summaries: slight inset to match list/card content rhythm */
.app-content > .header-row,
.app-content > h2, 
.app-content > p {
  padding-left: 8px;
  padding-right: 8px;
}

/* Remove gap between a page h2 and the summary paragraph immediately following it */
.app-content > h2 {
  margin-bottom: 2px;
}
.app-content > h2 + p {
  margin-top: 0;
  margin-bottom: 12px;
}
.empty-state { text-align: center; padding: 16px; color: #94a3b8; }

.badge-status { background:#eef2ff; color:#1e40af; border:1px solid #dbeafe; padding:2px 8px; font-weight:700; font-size:0.8rem; display: inline-block; }
.badge-step { background:#967878; color:#991b1b; border:1px solid #fee2e2; padding:2px 8px; font-weight:700; font-size:0.8rem; display: inline-block; }
.badge-admin { 
  background: grey; 
  color: white; 
  border: 1px solid gray; 
  padding: 2px 8px; 
  font-weight: 700; 
  font-size: 0.75rem; 
  border-radius: 12px; 
  margin-left: 4px; 
  display: inline-flex;
  align-items: center;
  line-height: 1;
  vertical-align: middle;
}
.badge-global { 
  background: black; 
  color: white; 
  border: 1px solid black; 
  padding: 2px 8px; 
  font-weight: 700; 
  font-size: 0.75rem; 
  border-radius: 12px; 
  margin-left: 4px; 
  display: inline-flex;
  align-items: center;
  line-height: 1;
  vertical-align: middle;
}
.badge-inactive { 
  background: #f3f4f6; 
  color: #374151; 
  border: 1px solid #d1d5db; 
  padding: 2px 8px; 
  font-weight: 700; 
  font-size: 0.75rem; 
  border-radius: 12px; 
  margin-right: 4px; 
  display: inline-flex;
  align-items: center;
  line-height: 1;
  vertical-align: middle;
}

.svg-icon { width: 16px; height: 16px; vertical-align: middle; }
.compact-table tbody tr:hover { background: #dbeafe; }
.compact-table tbody tr:hover > td { background: inherit; }
.actions-col { width: auto; text-align: left; white-space: nowrap; min-width: 100px; display: flex; gap: 6px; justify-content: flex-start; align-items: center; }

.badge { display:inline-block; background:#fde68a; color:#92400e; padding:1px 5px; border-radius:6px; font-size:0.75rem; margin-left:4px; }

.inline-form { display: inline; margin: 0; padding: 0; }

fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 3px;
}
fieldset legend {
  padding: 0 8px;
  font-weight: 700;
}
.compact-fieldset {
  padding: 4px;
}

@media (max-width: 720px) {
  .main-sidebar { position: fixed; left: -260px; top: 0; bottom: 0; z-index: 2000; transition: left 0.22s ease; }
  .main-sidebar.open { left: 0; }
  .app-shell { padding-left: 0; }
  .topnav { padding-left: 48px; flex-wrap: wrap; gap: 4px; min-height: 42px; }
  /* Hamburger: sized to sit inside the 42px bar, vertically centred */
  .topnav .hamburger { display: inline-flex; position: fixed; left: 8px; top: 6px; z-index: 2100; background: #1e40af; color: #fff; border-radius: 6px; width: 30px; height: 30px; padding: 0; font-size: 16px; line-height: 1; align-items: center; justify-content: center; }
  .topnav-right { flex-wrap: wrap; gap: 8px; }
  .topnav-right .user-label { display: none; }
  .topnav-right .lang-form label { display: none; }
  .topnav-right .lang-form select { font-size: 0.8rem; }
  .app-content { padding: 12px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  
  /* Form/Flex Responsive Overrides */
  .flex-responsive, [style*="display: flex"] {
    flex-wrap: wrap !important;
  }
  .flex-responsive > *, [style*="display: flex"] > * {
    max-width: 100% !important;
  }

  /* Mobile: hide the horizontal nav and show a slide-down mobile nav when header is toggled */
  /* height: auto cancels the desktop `.topnav-nav { height: 100% }`, which would
     otherwise cap the absolute panel at the height of the bar. */
  .topnav-nav { display: none; position: absolute; left: 0; right: auto; top: 100%; height: auto; width: max-content; max-width: calc(100vw - 16px); z-index: 2050; }
  .topnav.open .topnav-nav { display: block; }
  .topnav-nav .topnav-list { flex-direction: column; align-items: stretch; background: transparent; margin: 0; }
  .topnav-nav a { padding: 10px 16px; display: block; width: 100%; }
  /* In the mobile panel there is room for the word, so show it beside the glyph */
  .topnav-nav a.nav-icon-link { display: flex; align-items: center; }
  .topnav-nav .nav-icon-label { display: inline; }

  /* Mobile dropdowns: make subnavs inline and match topnav color to avoid white overlap */
  .topnav .subnav { position: static; display: none; left: auto; top: auto; background: transparent; color: #fff; box-shadow: none; padding: 0; min-width: auto; }
  .topnav .subnav a { color: #fff; font-weight: 600; padding-left: 28px; }
  .topnav li.dropdown.open > .subnav { display: block; }

  /* disable hover-triggered dropdown on mobile to prevent accidental open/overlap */
  .topnav li.dropdown:hover > .subnav { display: none; }
}

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

/* Proposals 2 card layout */
.proposal2-grid {
  column-width: 320px;              /* auto-create columns of this width */
  column-gap: 10px;
  margin-bottom: 14px;
}

.proposal2-card {
  border: 2px solid #94a3b8;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f1f5f9;
  width: 100%;                      /* fill the column */
  margin-bottom: 10px;              /* vertical gap between cards */
  break-inside: avoid;              /* never split a card across columns */
  box-sizing: border-box;
}

.proposal2-line1 {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.proposal2-name-wrap { display: flex; flex-direction: column; }

.proposal2-name-link {
  font-weight: 700;
  color: #1e40af;
  text-decoration: none;
  line-height: 1.2;
}
.proposal2-name-link:hover { text-decoration: underline; }

.proposal2-line2 {
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 8px;
}
.proposal2-sep { margin: 0 6px; color: #94a3b8; }

.proposal2-auth-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.proposal2-auth-btn {
  padding: 2px 8px;
  font-size: 0.72rem;
  border-radius: 999px;
  min-height: 22px;
  line-height: 1;
}

/* Proposals 2 cards: use same auth button styling as the list view */

.proposal2-hold-date {
  margin-top: 6px;
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.proposal2-assign-select {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1f2937;
  min-width: 180px;
}

.planned-dt-input {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1f2937;
}

.planned-dt-input::-webkit-datetime-edit,
.planned-dt-input::-webkit-datetime-edit-fields-wrapper,
.planned-dt-input::-webkit-datetime-edit-text,
.planned-dt-input::-webkit-datetime-edit-month-field,
.planned-dt-input::-webkit-datetime-edit-day-field,
.planned-dt-input::-webkit-datetime-edit-year-field,
.planned-dt-input::-webkit-datetime-edit-hour-field,
.planned-dt-input::-webkit-datetime-edit-minute-field,
.planned-dt-input::-webkit-datetime-edit-ampm-field {
  font-family: inherit;
}

.proposal2-assign-select:disabled {
  background: #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
}

/* ── Group box: fills column just like a single card ────── */
.proposal2-group-box {
  width: 100%;                      /* fill the column */
  margin-bottom: 10px;
  break-inside: avoid;              /* keep entire group in one column */
  box-sizing: border-box;
}

/* Cards inside a group fill the group box */
.proposal2-group-box .proposal2-card {
  width: 100%;
  max-width: none;
}

/* High-specificity overrides to ensure mobile topnav panel and hamburger are opaque
   (added after user's revert so these rules have final precedence) */
@media (max-width: 720px) {
  /* Force hamburger solid background in Chrome/Edge/Safari */
  header.topnav .hamburger {
    background-color: #1e40af !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    color: #fff !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12) !important;
  }

  /* When the topnav is opened, make the nav panel opaque and cover content */
  header.topnav.open .topnav-nav {
    display: block !important;
    background: #1e3a8a !important;
    padding: 6px !important;
    box-shadow: 0 8px 24px rgba(15,23,42,0.3) !important;
    border-radius: 0 8px 8px 8px !important;
    position: absolute !important;
    left: 0 !important;
    right: auto !important;
    /* Flush with the bottom of the bar, whatever height it ends up being */
    top: 100% !important;
    /* Grow with the menu instead of inheriting the bar's height */
    height: auto !important;
    max-height: calc(100vh - 60px) !important;
    overflow-y: auto !important;
    /* Shrink-to-fit: only as wide as the widest menu entry, never past the viewport */
    width: max-content !important;
    min-width: 180px !important;
    max-width: calc(100vw - 16px) !important;
    z-index: 2050 !important;
  }

  /* UL container inside mobile nav: ensure solid background and readable links */
  header.topnav.open .topnav-nav .topnav-list {
    /* Transparent: the panel paints the background, so no inner box shows through */
    background: transparent !important;
    color: #fff !important;
    gap: 2px !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  header.topnav.open .topnav-nav .topnav-list > li > a {
    color: #fff !important;
    background: transparent !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    display: block !important;
    width: 100% !important;
  }

  /* Make subnav items match mobile panel (no white boxes) */
  header.topnav.open .topnav-nav .subnav {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 4px 0 0 0 !important;
  }
  header.topnav.open .topnav-nav .subnav a {
    color: #fff !important;
    padding-left: 28px !important;
  }
}

/* ─── Responsive: proposal list stacked layout ─── */
@media (max-width: 768px) {
  /* Hide table headers */
  #proposals-container table.compact-table > thead {
    display: none;
  }

  /* Each row becomes a stacked card */
  #proposals-container table.compact-table > tbody > tr {
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 10px 12px;
    background: #fff;
    position: relative;
  }

  /* Step-group header rows keep block layout */
  #proposals-container table.compact-table > tbody > tr.step-group-header {
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    padding: 0;
    background: transparent;
  }
  #proposals-container table.compact-table > tbody > tr.step-group-header > td {
    display: block;
    padding: 10px 6px 4px;
  }

  /* Each cell is a block line */
  #proposals-container table.compact-table > tbody > tr > td {
    display: block;
    width: 100%;
    padding: 3px 0;
    border: none;
    font-size: 0.88rem;
    text-align: left;
    white-space: normal;
    word-break: break-word;
  }

  /* Inline label before each cell value */
  #proposals-container table.compact-table > tbody > tr > td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    font-size: 0.78rem;
    color: #6b7280;
  }

  /* Unit — small badge in top-right corner */
  #proposals-container table.compact-table > tbody > tr > td:first-child {
    position: absolute;
    top: 10px;
    right: 12px;
    width: auto;
    padding: 0;
    font-size: 0.75rem;
    color: #6b7280;
  }
  #proposals-container table.compact-table > tbody > tr > td:first-child::before {
    display: none;
  }

  /* Auth buttons wrap horizontally */
  .step-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  /* Assignment dropdown full width */
  .proposal2-assign-select {
    width: 100%;
    min-width: unset !important;
  }

  /* Group bracket indicator */
  #proposals-container table.compact-table > tbody > tr.proposal-group-row {
    border-left: 3px solid #6366f1;
    margin-left: 4px;
    background: #f8f8ff;
  }
  #proposals-container table.compact-table > tbody > tr.proposal-group-row.group-start {
    border-top: 2px solid #6366f1;
  }
  #proposals-container table.compact-table > tbody > tr.proposal-group-row.group-end {
    border-bottom: 2px solid #6366f1;
  }

  /* ─── Filter: prevent overflow on small screens ─── */
  .list-filter {
    flex-direction: column;
    align-items: stretch;
  }
  .list-filter fieldset {
    min-width: 0;
  }
  .list-filter fieldset form {
    flex-direction: column;
    align-items: stretch;
  }
  .list-filter fieldset form > div {
    min-width: 0 !important;
    width: 100%;
  }
  .list-filter fieldset form > div input[type="text"] {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
}

/* ─── Very small screens (480px and below) ─── */
@media (max-width: 480px) {
  #proposals-container table.compact-table > tbody > tr > td {
    font-size: 0.82rem;
  }
  /* Keep auth buttons horizontal - there's room for them */
  .step-btns .step-value-btn {
    font-size: 0.7rem;
    padding: 3px 6px;
  }
}

/* ─── Responsive: group card table ─── */
@media (max-width: 768px) {
  .card table.compact-table > thead {
    display: none;
  }
  .card table.compact-table > tbody > tr {
    display: block;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 10px;
  }
  .card table.compact-table > tbody > tr > td {
    display: block;
    padding: 2px 0;
    border: none;
    font-size: 0.85rem;
  }
  .card table.compact-table > tbody > tr > td:empty {
    display: none;
  }

  /* Card view responsive */
  .proposal2-card {
    padding: 10px !important;
  }
  .proposal2-card .step-btns {
    flex-wrap: wrap;
    gap: 4px;
  }
  .proposal2-card .proposal2-assign-select {
    width: 100%;
    min-width: unset;
  }
}

/* ── Flash / toast notifications ── */
.flashes {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  pointer-events: none;
  list-style-type: none;
  padding: 0;
  margin: 0;
  max-width: 350px;
}

.flashes .flash {
  padding: 12px 20px;
  margin-bottom: 10px;
  border-radius: 8px;
  font-size: 0.95rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  animation: slideIn 0.25s ease-out forwards;
  transition: opacity 0.25s ease, transform 0.25s ease;
  position: relative;
  background: #fff;
  border-left: 5px solid #d1d5db;
  color: #1e293b;
}

.flashes .flash.success { border-left-color: #10b981; background: #f0fdf4; }
.flashes .flash.danger, .flashes .flash.error { border-left-color: #ef4444; background: #fef2f2; }
.flashes .flash.warning { border-left-color: #f59e0b; background: #fffbeb; }
.flashes .flash.info { border-left-color: #3b82f6; background: #eff6ff; }

.flashes .flash.fade-out {
  opacity: 0;
  transform: translateX(24px);
}

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