/* ============================================================
   styles2.css — Dashboard / internal-app stylesheet
   Shares the same color palette/tokens as styles.css (the
   applicant-facing form pages) so the whole thing feels like one
   application, but lays pages out as an app shell -- a fixed
   vertical nav (navbar.php) on the left, page content on the
   right -- instead of the form pages' single centered card.
   ============================================================ */

:root {
  --ink: #e7ebf3;
  --muted: #93a1b7;
  --line: #2a3446;
  --line-light: #1c2433;
  --accent: #3b82f6;
  --accent-light: rgba(59, 130, 246, 0.16);
  --bg: #05070a;
  --card: #0d1117;
  --input-bg: #10141d;
  --error: #f87171;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
}

body {
  display: flex;
  align-items: stretch;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}

/* ---- Left nav (markup lives in navbar.php) ---- */

.app-nav {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-right: 1px solid var(--line-light);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.app-nav-logo {
  display: block;
  margin: 20px 20px 16px;
  padding: 10px 14px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 8px;
  line-height: 0;
}

.app-nav-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.app-nav-links {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.app-nav-links a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-nav-links a:hover {
  background: var(--input-bg);
  color: var(--ink);
}

.app-nav-links a.active {
  background: var(--accent-light);
  color: var(--accent);
}

/* ---- Main content area, to the right of the nav ---- */

.app-main {
  flex: 1;
  min-width: 0;
  padding: 40px 24px 48px;
}

/* ---- Page card ---- */

.card {
  max-width: 1180px;
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line-light);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 12px 32px rgba(0,0,0,0.5);
  overflow: hidden;
}

/* Simple left-aligned title bar instead of the form pages' gradient
   hero + step indicator, so the two don't read as the same template. */
.header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 32px;
  border-bottom: 1px solid var(--line-light);
  background: var(--card);
}

.header h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---- Table ---- */

.table-wrap {
  padding: 0 32px 32px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--line-light);
  color: var(--ink);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--accent-light);
}

tbody tr:hover {
  cursor: default;
}

tr.clickable-row:hover {
  cursor: pointer;
}

.row-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.row-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.muted-cell {
  color: var(--muted);
}

.empty-state {
  padding: 48px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---- Applicant detail page ---- */

.detail-actions {
  max-width: 1180px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.back-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.detail-actions .back-button {
  margin-bottom: 0;
}

.pdf-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s ease;
  border: none;
}

.pdf-button:hover {
  opacity: 0.88;
}

.detail-page-title {
  max-width: 1180px;
  margin: 0 auto 20px;
}

.detail-page-title h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---- Status: badge (applicant.php), dot (dashboard.php), and the
   change-status dropdown ---- */
/* .status-progress/.status-approved/.status-denied match the
   applicant.status values 0/1/2, and get reused by both the badge and
   the dot. !important here is deliberate: these are small, self-
   contained color swatches that must never lose their fill to some
   unrelated rule elsewhere winning the cascade. */

.status-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-badge.status-progress {
  background-color: rgba(234, 179, 8, 0.16) !important;
  color: #eab308 !important;
}

.status-badge.status-approved {
  background-color: rgba(34, 197, 94, 0.16) !important;
  color: #22c55e !important;
}

.status-badge.status-denied {
  background-color: rgba(248, 113, 113, 0.16) !important;
  color: #f87171 !important;
}

/* Dashboard table: a plain color dot, no text -- solid color rather
   than the badge's tinted background so it still reads clearly at
   that size. */
.status-dot {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.status-progress { background-color: #eab308 !important; }
.status-dot.status-approved { background-color: #22c55e !important; }
.status-dot.status-denied   { background-color: #f87171 !important; }

/* Custom dropdown (applicant.php) -- a small button showing only a
   down-arrow, plus its own popup menu with the real labels. Built by
   hand instead of styling a native <select>, because hiding a native
   select's own selected-value text is not reliable cross-browser (it
   was showing through after a pick, and the wrapping <form>'s default
   block layout was pushing it onto its own line). */
.status-dropdown {
  position: relative;
  display: inline-flex;
}

.status-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--muted);
  cursor: pointer;
}

.status-dropdown-toggle:hover,
.status-dropdown-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.status-dropdown-toggle svg {
  display: block;
  pointer-events: none;
}

.status-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 150px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.status-dropdown-option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.status-dropdown-option:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.status-dropdown-option[aria-selected="true"] {
  color: var(--accent);
}

.detail-card {
  max-width: 1180px;
  margin: 0 auto 20px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line-light);
  overflow: hidden;
}

.detail-card-header {
  padding: 16px 32px;
  border-bottom: 1px solid var(--line-light);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.detail-card-body {
  padding: 24px 32px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 32px;
}

.detail-item label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.detail-item .detail-value,
.detail-value {
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.5;
}

.detail-value.muted {
  color: var(--muted);
  font-style: italic;
}

.detail-list {
  margin: 0;
  padding-left: 20px;
}

.detail-list li {
  margin-bottom: 4px;
}

.essay-block {
  margin-bottom: 20px;
}

.essay-block:last-child {
  margin-bottom: 0;
}

.essay-block label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

.essay-block .essay-text {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink);
}

@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-card-body { padding: 20px; }
  .detail-card-header { padding: 14px 20px; }
}

@media (max-width: 860px) {
  body { flex-direction: column; }

  .app-nav {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .app-nav-logo {
    margin: 12px 12px 12px 16px;
    flex-shrink: 0;
    width: 140px;
  }

  .app-nav-links {
    flex-direction: row;
    padding: 0 16px 0 0;
    gap: 4px;
  }

  .app-nav-links a {
    white-space: nowrap;
  }

  .app-main { padding: 24px 16px 32px; }
  .header { padding: 20px 20px; }
  .table-wrap { padding: 0 12px 24px; overflow-x: auto; }
  table { min-width: 640px; }
}

/* ---- Nav footer: signed-in user + log out (navbar.php) ---- */

.app-nav-footer {
  margin-top: auto;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-nav-user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-nav-user-role {
  font-size: 12px;
  color: var(--muted);
}

.app-nav-logout {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.app-nav-logout:hover {
  color: var(--accent);
}

@media (max-width: 860px) {
  .app-nav-footer {
    margin-top: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-top: none;
    border-left: 1px solid var(--line-light);
    padding: 12px 16px;
  }
}

/* ---- Form fields: shared by login.php and account.php's
   add-account form. (The applicant-facing steps have their own
   version of these in styles.css -- this is styles2.css's, themed to
   match the dashboard's dark app shell instead.) ---- */

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: white;
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="date"],
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Date pickers (settings.php, Create Invitation popup): dark calendar
   popup and a light calendar icon so it shows on the dark input. */
.field input[type="date"] {
  color-scheme: dark;
}

.field input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.75;
}

.field input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Helper text under a field. */
.field-hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* Links inside notes and hints (e.g. "set a default in Settings"). */
.form-dialog-note a,
.field-hint a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.form-dialog-note a:hover,
.field-hint a:hover {
  text-decoration: underline;
}

.form-errors {
  border: 1px solid var(--error);
  background: rgba(248, 113, 113, 0.1);
  color: var(--error);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13.5px;
}

.form-success {
  border: 1px solid #22c55e;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13.5px;
}

.login-submit {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.login-submit:hover {
  opacity: 0.88;
}

/* ---- Standalone login page (login.php) -- no nav, just a centered
   card, since there's nothing to navigate to before signing in. ---- */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background-image: url("../PBSFALoginPhoto.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.login-card {
  width: 100%;
  max-width: 380px;
  /* background: var(--card); */
  background:rgba(212, 212, 212, 0.295);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 12px 32px rgba(0,0,0,0.5);
  padding: 32px 28px;
  text-align: center;
}

.login-logo {
  width: 160px;
  margin: 0 auto 20px;
  display: block;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 700;
}

.login-subtitle {
  margin: 0 0 24px;
  color: white;
  font-size: 13px;
}

.login-card form {
  text-align: left;
}

/* ---- Masked SSN last-4 + reveal toggle ---- */
/* Used on dashboard.php (table cell) and applicant.php (Personal
   Information detail-item). JS lives in ssn_toggle.js -- one
   delegated listener handles every instance on the page. */

.ssn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ssn-toggle-text {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.ssn-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}

.ssn-toggle-btn:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.ssn-eye-icon {
  display: block;
  pointer-events: none;
}

/* Slashed eye = currently hidden (click to show). Plain eye = currently
   shown (click to hide again). */
.ssn-toggle.revealed .ssn-eye-slash {
  display: none;
}

.search-form{
  padding: 10px;
  margin-left: 20px;
}

.search-btn{
  background-color: #3b82f6;
  border: none;
  padding: 6px;
  border-radius: 10px;
}

.search-btn:hover{
  background-color: #224681;
}

.search-input{
  border: 2px solid #3b82f6;
  border-radius: 10px;
  background-color: transparent;
  padding: 6px;
  color: white;
}

.clear-btn{
  background-color: white;
  padding: 6px;
  border-radius: 10px;
  color: black;
  text-decoration: none;
  font-size: 12px;
}

/* ---- Dashboard status filter (dashboard.php) ----
   Sits in the search form; sized to match the search input. */
.status-filter {
  display: inline-block;
  min-width: 160px;
  vertical-align: middle;
  margin: 0 6px;
}

.search-form .styled-select {
  padding: 6px 34px 6px 10px;
  border: 2px solid var(--accent);
  border-radius: 10px;
}

/* .applicant-navbar{
  margin-left: 13%;
} */

.app-subnav {
  max-width: 1180px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

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

.app-subnav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.app-subnav-links a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.app-subnav-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.app-subnav-links a.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.app-subnav-actions .back-button {
  margin-bottom: 0;
}

.vertline{
  border-left: 1px solid #5f656d; /* 1px thick, solid, color */
  height: 35px; /* Adjust height as needed */
  width: 1px;    /* Optional, ensures exact width */
}

/* ---- Subnav <button class="pdf-button"> (applicant_navbar.php) ----
   Input Grades and the Download PDF toggle. Scoped under
   .app-subnav-links so they match the other subnav pills. */
.app-subnav-links button.pdf-button {
  background: var(--input-bg);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  line-height: normal;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.app-subnav-links button.pdf-button:hover,
.app-subnav-links button.pdf-button[aria-expanded="true"] {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Download PDF dropdown + Reference PDF flyout (applicant_navbar.php)
   Selectors are scoped under .app-subnav-links so the generic
   ".app-subnav-links a" pill style doesn't leak into the menu items. */
.pdf-menu {
  position: relative;
  display: inline-flex;
}

.pdf-menu .pdf-button svg {
  display: block;
  pointer-events: none;
}

.pdf-menu-panel,
.pdf-submenu-panel {
  position: absolute;
  z-index: 20;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.pdf-menu-panel {
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
}

.pdf-menu-panel[hidden],
.pdf-submenu-panel[hidden] {
  display: none;
}

.pdf-submenu {
  position: relative;
}

/* Flyout opens to the LEFT of the main menu, lined up with its row. */
.pdf-submenu-panel {
  top: -6px;
  right: calc(100% + 8px);
  min-width: 240px;
}

.app-subnav-links .pdf-menu-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: normal;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.app-subnav-links a.pdf-menu-item:hover,
.app-subnav-links button.pdf-menu-item:hover,
.app-subnav-links .pdf-submenu-toggle[aria-expanded="true"] {
  background: var(--accent-light);
  color: var(--accent);
  border: none;
}

.pdf-submenu-caret {
  display: inline-block;
  width: 12px;
  margin-right: 4px;
  font-size: 15px;
  line-height: 1;
}

/* Pending: red until the reference(s) have submitted. */
.app-subnav-links .pdf-menu-item-pending,
.app-subnav-links button.pdf-menu-item-pending:hover,
.app-subnav-links .pdf-submenu-toggle.pdf-menu-item-pending[aria-expanded="true"] {
  color: var(--error);
  background: rgba(248, 113, 113, 0.10);
}

.app-subnav-links .pdf-menu-item-disabled {
  cursor: not-allowed;
  margin-top: 2px;
}

.pdf-menu-item-disabled small {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  opacity: 0.85;
}

/* ---- Applicant notes (notes.php) ---- */
.note-flash {
  max-width: 1180px;
  margin: 0 auto 16px;
}

.note-flash-info {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.note-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
}

.note-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.note-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.note-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.note-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.note-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.note-btn-primary:hover {
  color: #fff;
  opacity: 0.88;
}

.note-btn-danger:hover {
  border-color: var(--error);
  color: var(--error);
}

.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.note-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-light);
}

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

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

.note-item [hidden] {
  display: none !important;
}

.note-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.note-author {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.note-you,
.note-date,
.note-edited {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
}

.note-edited {
  font-style: italic;
  margin-left: 4px;
}

.note-text {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.note-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.note-actions form {
  margin: 0;
}

.note-edit-form {
  margin-top: 4px;
}

/* ---- Popup forms (<dialog>) ----
   Shared by Input Grades (applicant_navbar.php), Add Account and
   Reset Password (account.php), and Create Invitation (invitations.php). */
.form-dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
}

.form-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.form-dialog h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.form-dialog-note {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.form-dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 16px;
}

.form-dialog .field input,
.form-dialog .field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}

.form-dialog .field input:focus,
.form-dialog .field select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-dialog-error {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--error);
}

.form-dialog-error[hidden] {
  display: none;
}

.form-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-dialog-actions .back-button {
  margin-bottom: 0;
  cursor: pointer;
  font-family: inherit;
}

.form-dialog-actions .pdf-button {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

@media (max-width: 560px) {
  .form-dialog-grid { grid-template-columns: 1fr; }
}

.form-dialog .form-errors ul {
  margin: 8px 0 0 20px;
  padding: 0;
}

/* Narrower popup for single-column forms (account, password, invitation). */
.form-dialog.form-dialog-narrow {
  width: min(440px, calc(100vw - 32px));
}

/* Button(s) on the right side of a card header that open a popup. */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-actions .pdf-button,
button.pdf-button {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

button.back-button {
  cursor: pointer;
  font-family: inherit;
}

/* Copyable invitation link in the success banner (invitations.php). */
.copy-link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 8px;
}

.copy-link-row code {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  word-break: break-all;
  user-select: all;
}

.copy-link-row .back-button {
  margin-bottom: 0;
  white-space: nowrap;
}


/* Banners placed directly in a card (account.php, invitations.php) line
   up with the table's 32px side padding instead of touching the edges. */
.card > .form-success,
.card > .form-errors {
  margin: 16px 32px 0;
}

/* ---- Edit account page (edit_account.php) ---- */

.edit-account {
  max-width: 820px;
  margin: 0 auto;
}

.edit-account-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.edit-account-title h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.edit-account-badges {
  display: flex;
  gap: 8px;
}

.you-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
}

.edit-section {
  background: var(--card);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 12px 32px rgba(0,0,0,0.5);
  margin-bottom: 20px;
  overflow: hidden;
}

.edit-section-header {
  padding: 16px 28px;
  border-bottom: 1px solid var(--line-light);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.edit-section-body {
  padding: 24px 28px;
}

.edit-section-danger {
  border-color: rgba(248, 113, 113, 0.35);
}

.edit-section-danger .edit-section-header {
  color: var(--error);
  border-bottom-color: rgba(248, 113, 113, 0.2);
}

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

.edit-section-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.edit-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13.5px;
}

.readonly-value {
  padding: 10px 0;
  font-size: 14px;
  color: var(--ink);
}

.flash-list {
  margin: 0;
  padding-left: 18px;
}

/* Role picker + its button on one line */
.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-form .field {
  margin-bottom: 0;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.inline-form .pdf-button {
  height: 41px;
}

/* ---- Styled dropdown: dark, full-size, custom arrow ---- */
.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.field select.styled-select,
select.styled-select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  padding: 10px 38px 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color-scheme: dark; /* dark option list in Chrome/Edge/Firefox */
  transition: border-color 0.15s ease;
}

select.styled-select:hover {
  border-color: var(--accent);
}

select.styled-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

select.styled-select option {
  background: var(--input-bg);
  color: var(--ink);
}

select.styled-select:disabled,
.pdf-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Password field with show/hide toggle ---- */
.password-wrap {
  position: relative;
}

.field .password-wrap input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--accent);
}

.password-toggle .eye-closed,
.password-toggle.is-visible .eye-open {
  display: none;
}

.password-toggle.is-visible .eye-closed {
  display: block;
}

/* ---- Red destructive button ---- */
.danger-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #dc2626;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.danger-button:hover {
  background: #b91c1c;
}

@media (max-width: 720px) {
  .edit-grid { grid-template-columns: 1fr; }
  .edit-section-header,
  .edit-section-body { padding-left: 20px; padding-right: 20px; }
}

/* ---- Applicant scoring page ---- */

.app-main > h1 {
  max-width: 1180px;
  margin: 0 auto 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.score-legend {
  max-width: 1180px;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 13.5px;
}

.save-message {
  max-width: 1180px;
  margin: 0 auto 16px;
  border: 1px solid #22c55e;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
}

.scoring-card {
  max-width: 1180px;
  margin: 0 auto 12px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
}

.score-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.score-box {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Each option is a pill; the real radio is hidden but still works
   with the keyboard and screen readers. */
.score-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.score-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.score-option:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.score-option:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.score-option:has(input:focus-visible) {
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* N/A sits slightly apart and uses a muted fill when selected */
.score-option:last-child {
  margin-left: 8px;
  font-size: 12.5px;
}

.score-option:last-child:has(input:checked) {
  background: var(--line);
  border-color: var(--muted);
  color: var(--ink);
}

.save-button {
  display: block;
  margin: 24px auto 0;
  max-width: 1180px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.save-button:hover {
  opacity: 0.88;
}

@media (max-width: 720px) {
  .scoring-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
  }
  .score-box { flex-wrap: wrap; }
}

/* ---- Settings page (settings.php) ----
   A form placed directly in a .card gets the same 32px side padding
   as the card's header, and its fields stay a sensible width instead
   of stretching across the whole card. */
.settings-form {
  padding: 24px 32px 28px;
}

.settings-form .field {
  max-width: 320px;
}

.settings-form + .header {
  border-top: 1px solid var(--line-light);
}

@media (max-width: 860px) {
  .settings-form { padding: 20px; }
  .settings-form .field { max-width: none; }
}


/* ---- Start a New Application Year (settings.php) ----
   Collapsible red section; opens with the arrow. The two confirmation
   popups reuse .form-dialog. */
.danger-zone {
  margin: 8px 24px 28px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: var(--radius);
  background: rgba(248, 113, 113, 0.05);
  padding: 20px 22px;
}

.danger-zone > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.danger-zone > summary::-webkit-details-marker {
  display: none;
}

.danger-zone h1 {
  margin: 0;
  font-size: 18px;
  color: var(--error);
}

.danger-zone-sub {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.danger-zone-arrow {
  flex-shrink: 0;
  color: var(--error);
  transition: transform 0.2s ease;
}

.danger-zone[open] .danger-zone-arrow {
  transform: rotate(180deg);
}

.danger-zone-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(248, 113, 113, 0.25);
}

.danger-zone-body > p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.wipe-box {
  max-width: 520px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  background: var(--card);
}

.wipe-box h3 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.wipe-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

.wipe-box li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line-light);
}

.wipe-box li:last-child {
  border-bottom: none;
}

.wipe-box li span:last-child {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

button.danger-button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: var(--error);
  color: #0d1117;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

button.danger-button:hover {
  opacity: 0.9;
}

button.danger-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.step-pill {
  display: inline-block;
  margin-bottom: 10px;
  padding: 2px 10px;
  border: 1px solid rgba(248, 113, 113, 0.5);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--error);
}

.wipe-summary {
  margin: 0 0 18px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.7;
}

.ack-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.ack-row input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--error);
}

.name-target {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input-bg);
  font-family: ui-monospace, Consolas, monospace;
  color: var(--ink);
}

.match-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.match-hint.ok {
  color: #4ade80;
}

.new-year-next {
  margin-top: 8px;
}

.new-year-next a {
  color: var(--accent);
}

@media (max-width: 860px) {
  .danger-zone { margin: 8px 16px 20px; }
}


/* ---- Settings page: Invitation Deadline section (settings.php) ----
   One section, two numbered cards: 1) default for new invitations,
   2) apply that default to unfinished invitations (2-step popup). */

.page-messages {
  padding: 16px 32px 0;
}

.settings-section {
  padding: 24px 32px 8px;
}

.settings-section > h2 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
}

.settings-parts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.settings-part {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: var(--input-bg);
}

.settings-part h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
}

.settings-part .field {
  margin-bottom: 14px;
}

.settings-part .part-actions {
  margin-top: auto;
}

.settings-part button {
  cursor: pointer;
  font-family: inherit;
}

.settings-part button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.part-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

/* "14 unfinished invitations -> March 15, 2027" */
.apply-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  background: var(--card);
  font-size: 13px;
}

.apply-preview .big {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.apply-preview .arrow,
.apply-preview .muted {
  color: var(--muted);
}

.apply-preview .muted {
  font-size: 12px;
}

/* Outline button so Apply reads differently from Save. */
.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
}

.secondary-button:hover:not(:disabled) {
  background: var(--accent-light);
}

/* Blue variants for the (non-destructive) Apply popups. */
.step-pill.step-pill-info {
  border-color: rgba(59, 130, 246, 0.5);
  color: var(--accent);
}

.ack-row.ack-info input {
  accent-color: var(--accent);
}

.confirm-box {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  background: var(--input-bg);
  font-size: 14px;
}

.confirm-box div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line-light);
}

.confirm-box div:last-child {
  border-bottom: none;
}

.confirm-box span:first-child {
  color: var(--muted);
}

.confirm-box span:last-child {
  font-weight: 600;
}

.confirm-strong {
  color: var(--ink);
}

.section-divider {
  margin: 24px 32px 16px;
  border: none;
  border-top: 1px solid var(--line-light);
}

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

@media (max-width: 860px) {
  .page-messages,
  .settings-section { padding-left: 16px; padding-right: 16px; }
  .section-divider { margin-left: 16px; margin-right: 16px; }
}
