/* ============================================================
   SO Finance Portal — Design System
   Navy + brand blue (from the real Satellite Office logo).
   Amber is kept only as a category color (Liquidation tag) and
   for flash/notice messages - not the primary brand accent.
   Space Grotesk (display) + IBM Plex Sans (body) + IBM Plex Mono
   (IDs, amounts, request numbers).
   ============================================================ */

:root {
  --navy-950: #10192B;
  --navy-800: #1B2A4A;
  --blue-600: #3A66C2;
  --amber-500: #D6A419;
  --amber-100: #FBF0D6;
  --green-600: #2F8F5B;
  --green-100: #E4F5EC;
  --red-600: #C1443B;
  --red-100: #FBEAE8;
  --ink-900: #151A23;
  --ink-500: #5B6472;
  --paper-50: #F7F8FA;
  --paper-0: #FFFFFF;
  --line-200: #E2E5EA;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--paper-50);
  color: var(--ink-900);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--font-mono); }

/* ---------- Flash messages ---------- */
.flash {
  background: var(--amber-100);
  border: 1px solid var(--amber-500);
  color: #6b4e0a;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 0.9rem;
}

/* ============================================================
   Split-screen auth layout (login / register)
   ============================================================ */
.auth-shell {
  display: flex;
  min-height: 100vh;
}

.auth-panel-brand {
  flex: 1 1 45%;
  background: linear-gradient(160deg, var(--navy-950), var(--navy-800));
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-panel-brand .wordmark {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-panel-brand .wordmark .mark {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: #fff;
  padding: 4px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.auth-panel-brand .wordmark .mark img { width: 100%; height: 100%; object-fit: contain; }

.brand-logo-full {
  display: block;
  height: 64px;
  margin: 0 0 28px;
}

.auth-panel-brand .tagline h1 {
  font-size: 2rem;
  line-height: 1.25;
  max-width: 380px;
  margin-bottom: 10px;
}

.auth-panel-brand .tagline p {
  color: #A9B6D0;
  font-size: 0.95rem;
  max-width: 340px;
}

.auth-panel-form {
  flex: 1 1 55%;
  background: var(--paper-0);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth-card { width: 100%; max-width: 380px; }

.auth-card .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 8px;
}

.auth-card h2 { font-size: 1.6rem; margin-bottom: 28px; }

/* ---------- Pipeline signature element ---------- */
.pipeline { position: relative; height: 170px; margin: 40px 0 10px; }

.pipeline svg { width: 100%; height: 100%; overflow: visible; }

.pipeline-line {
  stroke: rgba(255,255,255,0.18);
  stroke-width: 2;
  fill: none;
}

.pipeline-node circle {
  fill: var(--navy-800);
  stroke: rgba(255,255,255,0.35);
  stroke-width: 1.5;
}

.pipeline-node.is-active circle { fill: var(--blue-600); stroke: var(--blue-600); }

.pipeline-node text {
  fill: #C7D1E6;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.pipeline-dot {
  fill: var(--blue-600);
  filter: drop-shadow(0 0 6px rgba(58, 102, 194, 0.8));
  offset-path: path("M10,20 Q 200,120 390,20");
  animation: travel 7s linear infinite;
}

@keyframes travel {
  0%   { offset-distance: 0%; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pipeline-dot { animation: none; opacity: 1; offset-distance: 50%; }
}

/* ---------- Form elements ---------- */
label {
  display: block;
  margin-bottom: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-900);
}

input[type="text"], input[type="password"], input[type="email"], input[type="date"], input[type="number"], select {
  display: block;
  width: 100%;
  padding: 11px 13px;
  margin-top: 6px;
  border: 1.5px solid var(--line-200);
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--paper-0);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(58, 102, 194, 0.15);
}

button, .btn {
  padding: 11px 20px;
  background: var(--navy-800);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

button:hover, .btn:hover { background: var(--navy-950); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); }
button:disabled, .btn:disabled {
  opacity: 0.5; cursor: not-allowed;
}
button:disabled:hover, .btn:disabled:hover { transform: none; background: var(--navy-800); }

.auth-card p.switch { margin-top: 20px; font-size: 0.88rem; color: var(--ink-500); }

/* ============================================================
   App shell (home / dashboard, once logged in)
   ============================================================ */
.app-topbar {
  background: var(--navy-950);
  color: #fff;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-topbar .wordmark {
  font-family: var(--font-display);
  display: flex; align-items: center; gap: 10px; font-size: 1rem;
}

.app-topbar .wordmark .mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: #fff;
  padding: 3px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.app-topbar .wordmark .mark img { width: 100%; height: 100%; object-fit: contain; }

.app-topbar .who { font-size: 0.85rem; color: #C7D1E6; display: flex; align-items: center; gap: 16px; }
.app-topbar .who a { color: #fff; opacity: 0.85; }
.who-id { display: flex; flex-direction: column; gap: 2px; }
.who-name-row { display: flex; align-items: center; gap: 8px; }
.who-role { font-size: 0.72rem; color: #7C8AAD; font-weight: 500; }

.app-main { max-width: 960px; margin: 0 auto; padding: 48px 24px; }
.app-main.wide { max-width: 1240px; }

.welcome h1 { font-size: 1.7rem; margin-bottom: 6px; }
.welcome .meta { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-500); margin-bottom: 40px; }
.welcome .meta .dept { background: var(--paper-50); border: 1px solid var(--line-200); padding: 2px 8px; border-radius: 5px; }

.request-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.type-card {
  background: var(--paper-0);
  border: 1px solid var(--line-200);
  border-radius: 12px;
  padding: 24px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.type-card:hover { box-shadow: 0 6px 20px rgba(16, 25, 43, 0.08); transform: translateY(-2px); }

.type-card .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  margin-bottom: 14px;
}

.type-card.liquidation .tag { background: var(--amber-100); color: #8a6608; }
.type-card.reimbursement .tag { background: var(--green-100); color: var(--green-600); }
.type-card.payment .tag { background: #E9EEFB; color: var(--blue-600); }

.type-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.type-card p { font-size: 0.85rem; color: var(--ink-500); margin: 0 0 18px; line-height: 1.5; }

/* display:flex + flex-direction:column, with margin-top:auto on the Start
   button below, keeps the button flush with the bottom of every card in
   the row regardless of how many lines each card's description wraps to
   - CSS Grid already stretches the cards themselves to equal height
   (align-items:stretch is the grid default), block layout just didn't
   have anything to make each button follow that shared bottom edge. */
.type-card { cursor: pointer; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.type-card:hover { text-decoration: none; }
.type-card .btn-block { margin-top: auto; }

/* ============================================================
   Request forms (Liquidation / Reimbursement / Request for Payment)
   ============================================================ */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-500);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--ink-500); }

.form-header { margin-bottom: 32px; }
.form-header .tag { display: inline-block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 8px; border-radius: 5px; margin-bottom: 12px; }
.form-header.liquidation .tag { background: var(--amber-100); color: #8a6608; }
.form-header.reimbursement .tag { background: var(--green-100); color: var(--green-600); }
.form-header.payment .tag { background: #E9EEFB; color: var(--blue-600); }
.form-header h1 { font-size: 1.5rem; }
.form-header p { color: var(--ink-500); font-size: 0.9rem; margin-top: 6px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

.panel {
  background: var(--paper-0);
  border: 1px solid var(--line-200);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  font-family: var(--font-body);
  font-weight: 600;
  margin-bottom: 18px;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field-row label { margin-bottom: 0; }

input:read-only {
  background: var(--paper-50);
  color: var(--ink-500);
  cursor: default;
}

.readonly-field {
  background: var(--paper-50);
  border: 1.5px solid var(--line-200);
  border-radius: 7px;
  padding: 11px 13px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink-500);
}

/* ---------- Line item table ---------- */
.faq-item { border-bottom: 1px solid var(--line-200); padding: 4px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  cursor: pointer; padding: 14px 4px; font-weight: 600; font-size: 0.95rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--ink-500); font-weight: 400; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item .faq-answer { padding: 0 4px 16px; color: var(--ink-500); font-size: 0.9rem; line-height: 1.6; }
.faq-answer ul { margin: 8px 0 0; padding-left: 20px; }
.faq-answer li { margin-bottom: 4px; }
.faq-section-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-500); margin: 28px 0 8px; }
.faq-section-title:first-child { margin-top: 0; }
.required-mark { color: var(--red-600); margin-left: 2px; }
.optional-mark { color: var(--ink-500); font-weight: 400; font-size: 0.82em; margin-left: 4px; }
.required-legend { font-size: 0.8rem; color: var(--ink-500); margin: -8px 0 24px; }
.table-scroll { overflow-x: auto; }

table.line-items { border-collapse: collapse; margin-bottom: 14px; min-width: 880px; }
table.line-items th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-500); font-weight: 600; padding: 0 8px 10px; border-bottom: 1.5px solid var(--line-200);
}
table.line-items td { padding: 8px 8px; vertical-align: top; border-bottom: 1px solid var(--line-200); }
table.line-items input, table.line-items select {
  width: 100%; min-width: 100px; padding: 8px 9px; border: 1.5px solid var(--line-200); border-radius: 6px;
  font-family: var(--font-body); font-size: 0.87rem; margin-top: 0;
}
table.line-items td:nth-child(2) input { min-width: 220px; }
table.line-items td:nth-child(6) input { min-width: 160px; }
table.line-items input.amount { font-family: var(--font-mono); text-align: right; }
table.line-items .remove-line {
  background: none; border: none; color: var(--red-600); font-size: 1.1rem; cursor: pointer; padding: 4px 8px;
}
table.line-items .remove-line:hover { background: var(--red-100); border-radius: 5px; transform: none; }

.add-line-btn {
  background: none; border: 1.5px dashed var(--line-200); color: var(--blue-600);
  width: 100%; padding: 10px; border-radius: 7px; font-size: 0.87rem; font-weight: 500;
}
.add-line-btn:hover { background: #F3F6FC; border-color: var(--blue-600); transform: none; }

/* ---------- Summary sidebar ---------- */
.summary-panel { position: sticky; top: 24px; }
.summary-row { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line-200); font-size: 0.88rem; }
.summary-row:last-child { border-bottom: none; }
.summary-row .amount { font-family: var(--font-mono); font-weight: 600; }
.summary-row.total { font-size: 1.05rem; padding-top: 14px; }
.summary-row.total .amount { color: var(--navy-800); }
.summary-row.negative .amount { color: var(--red-600); }
.summary-row.positive .amount { color: var(--green-600); }
.summary-hint { font-size: 0.78rem; color: var(--ink-500); margin-top: 10px; line-height: 1.5; }

.summary-panel .btn-submit { width: 100%; margin-top: 18px; }
.btn-draft {
  width: 100%; margin-top: 8px; background: var(--paper-50); color: var(--ink-900);
  border: 1.5px solid var(--ink-500); font-weight: 600;
}
.btn-draft:hover { background: #E9EEF5; border-color: var(--blue-600); }

/* ---------- Radio / checkbox groups ---------- */
.choice-group { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.choice-chip {
  border: 1.5px solid var(--line-200); border-radius: 20px; padding: 7px 16px; font-size: 0.85rem;
  cursor: pointer; user-select: none; transition: all 0.12s ease;
}
.choice-chip input { display: none; }
.choice-chip:has(input:checked) { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ---------- File dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--line-200); border-radius: 10px; padding: 24px; text-align: center;
  cursor: pointer; transition: border-color 0.12s ease, background 0.12s ease;
}
.dropzone:hover { border-color: var(--blue-600); background: #F8FAFE; }
.dropzone input[type="file"] { display: none; }
.dropzone .dz-title { font-weight: 600; font-size: 0.9rem; }
.dropzone .dz-hint { font-size: 0.78rem; color: var(--ink-500); margin-top: 4px; }
.file-list { margin-top: 12px; font-size: 0.85rem; }
.file-list li { display: flex; justify-content: space-between; padding: 7px 10px; background: var(--paper-50); border-radius: 6px; margin-bottom: 6px; }
.file-list .file-error { color: var(--red-600); font-size: 0.78rem; }

textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line-200); border-radius: 7px;
  font-family: var(--font-body); font-size: 0.9rem; margin-top: 6px; resize: vertical; min-height: 80px;
}
textarea:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(58, 102, 194, 0.15); }

@media (max-width: 860px) {
  .auth-shell { flex-direction: column; }
  .auth-panel-brand { flex: none; padding: 32px; }
  .pipeline { display: none; }
  .request-types { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .summary-panel { position: static; }
  .app-topbar { flex-direction: column; gap: 12px; align-items: flex-start; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Auth panel additions: subtitle, security note, icon badge, input icons
   ============================================================ */
.wordmark-sub { font-size: 0.78rem; color: #7C8AAD; margin-top: 4px; margin-left: 40px; }

.security-note {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.8rem; color: #7C8AAD; line-height: 1.4;
}
.security-note svg { flex-shrink: 0; margin-top: 1px; color: var(--blue-600); }

.auth-icon-badge {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--paper-50); border: 1.5px solid var(--line-200);
  display: flex; align-items: center; justify-content: center;
  color: var(--navy-800); margin-bottom: 18px;
}

.auth-card .subhead { font-size: 0.88rem; color: var(--ink-500); margin: -18px 0 22px; }

.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > svg { position: absolute; left: 12px; color: var(--ink-500); pointer-events: none; }
.input-icon input { padding-left: 36px; }
.input-icon .toggle-visibility {
  position: absolute; right: 8px; background: none; border: none; padding: 6px;
  color: var(--ink-500); cursor: pointer;
}
.input-icon .toggle-visibility:hover { background: none; transform: none; color: var(--blue-600); }

.field-hint { font-size: 0.76rem; color: var(--ink-500); font-weight: 400; margin-top: 5px; display: block; }
.field-hint-error { color: var(--red-600); }

.form-row-between { display: flex; justify-content: space-between; align-items: center; margin: -6px 0 18px; font-size: 0.85rem; }
.checkbox-line { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.checkbox-line input { width: auto; margin: 0; }
.forgot-link { font-size: 0.85rem; }

.auth-card .help-line { margin-top: 14px; font-size: 0.82rem; color: var(--ink-500); }

/* ============================================================
   App shell: nav, avatar, footer
   ============================================================ */
.app-topbar { flex-wrap: wrap; gap: 20px; }
.topbar-left { display: flex; align-items: center; gap: 32px; }
.topnav { display: flex; gap: 22px; }
.topnav a { color: #A9B6D0; font-size: 0.88rem; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 6px; }
.topnav a:hover { color: #fff; text-decoration: none; }
.topnav a.active { color: #fff; border-bottom-color: var(--blue-600); }
.topnav a svg, .nav-dropdown-trigger svg, .user-menu-dropdown a svg { flex-shrink: 0; }

.who { position: relative; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  overflow: hidden; padding: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-picture-preview {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto;
  background: var(--blue-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 1.6rem; font-weight: 600;
  overflow: hidden;
}
.profile-picture-preview img { width: 100%; height: 100%; object-fit: cover; }

.user-menu { position: relative; }
.user-menu-trigger { border: none; cursor: pointer; }
.user-menu-dropdown {
  display: none;
  position: absolute; right: 0; top: 42px;
  background: var(--paper-0); border: 1px solid var(--line-200); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(16, 25, 43, 0.18);
  min-width: 190px; padding: 8px; z-index: 20;
}
.user-menu-dropdown.open { display: block; }
.user-menu-dropdown a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; font-size: 0.87rem; color: var(--ink-900); font-weight: 500;
}
.nav-dropdown .user-menu-dropdown a svg { color: var(--ink-500); }
.user-menu-dropdown a:hover { background: var(--paper-50); text-decoration: none; }
.user-menu-dropdown a:visited { color: var(--ink-900); }
#user-menu-dropdown a { color: var(--ink-900); }
#user-menu-dropdown a:visited { color: var(--ink-900); }
.user-menu-divider { height: 1px; background: var(--line-200); margin: 6px 4px; }
#user-menu-dropdown .user-menu-logout { color: var(--red-600); }

.nav-dropdown .user-menu-dropdown a { color: var(--ink-900); }
.nav-dropdown .user-menu-dropdown a:visited { color: var(--ink-900); }
.nav-dropdown .user-menu-dropdown a:hover { background: var(--paper-50); text-decoration: none; }

.nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-dropdown-trigger {
  background: none; border: none; color: #A9B6D0; font-size: 0.88rem; font-weight: 500;
  padding: 6px 0; cursor: pointer; font-family: var(--font-body);
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-dropdown-trigger:hover { color: #fff; }
.nav-dropdown-trigger.active { color: #fff; }
.nav-badge {
  background: var(--red-600); color: #fff; font-size: 0.68rem; font-weight: 700;
  border-radius: 20px; padding: 1px 6px; margin-left: 3px; vertical-align: 2px;
}
.nav-menu-dropdown { top: 34px; left: 0; right: auto; }
.nav-submenu-trigger:hover { background: var(--paper-50); transform: none; }

.app-footer { text-align: center; color: var(--ink-500); font-size: 0.78rem; padding: 20px 0 40px; }

/* ============================================================
   Dashboard: stat cards, CTA card icons, recent requests, quick links
   ============================================================ */
.welcome-sub { color: var(--ink-500); font-size: 0.92rem; margin: 4px 0 14px; }

.icon-neutral { background: #EAEDF2; color: var(--ink-500); }
.icon-amber   { background: var(--amber-100); color: #8a6608; }
.icon-green   { background: var(--green-100); color: var(--green-600); }
.icon-blue    { background: #E9EEFB; color: var(--blue-600); }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 36px; }
.stat-card { background: var(--paper-0); border: 1px solid var(--line-200); border-radius: 12px; padding: 18px 20px; }
.stat-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.stat-value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--ink-900); }
.stat-label { font-size: 0.8rem; color: var(--ink-500); margin: 2px 0 10px; }
.stat-link { font-size: 0.78rem; font-weight: 500; }

.section-heading { font-size: 1rem; margin-bottom: 16px; }

.type-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; margin-top: 40px; }
.panel-heading-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }

table.recent-requests { width: 100%; border-collapse: collapse; }
table.recent-requests th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-500); font-weight: 600; padding: 0 8px 10px; border-bottom: 1.5px solid var(--line-200);
}
table.recent-requests td { padding: 12px 8px; border-bottom: 1px solid var(--line-200); font-size: 0.88rem; }

.status-pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.76rem; font-weight: 600; }
.status-review     { background: #E9EEFB; color: var(--blue-600); }
.status-needsinfo  { background: var(--amber-100); color: #8a6608; }
.status-approved   { background: var(--green-100); color: var(--green-600); }
.status-forpayment { background: #E9EEFB; color: var(--blue-600); }
.status-rejected   { background: var(--red-100); color: var(--red-600); }
.status-draft       { background: var(--paper-50); color: var(--ink-500); border: 1px solid var(--line-200); }
.ee-incomplete-row { background: var(--red-100) !important; }

.empty-state { text-align: center; color: var(--ink-500); font-size: 0.88rem; padding: 30px 0; }

.quick-links { list-style: none; padding: 0; margin: 0; }
.quick-links li { margin-bottom: 6px; }
.quick-links a { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border-radius: 8px; color: var(--ink-900); font-size: 0.87rem; font-weight: 500; }
.quick-links a:hover { background: var(--paper-50); text-decoration: none; }
.quick-links small { color: var(--ink-500); font-weight: 400; font-size: 0.78rem; }
.ql-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; }

.btn-block { display: block; text-align: center; width: 100%; box-sizing: border-box; margin-top: 4px; }

/* ============================================================
   Form polish: step progress, numbered panels, file chips, sidebar extras
   ============================================================ */
.form-progress { display: flex; align-items: center; margin-bottom: 32px; }
.progress-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0;
  background: none; border: none; cursor: pointer; padding: 0; font-family: var(--font-body);
}
.progress-step:hover { background: none; transform: none; }
.progress-step:hover .num { border-color: var(--blue-600); }
.progress-step:hover .label { color: var(--navy-800); }
.progress-step .num {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600;
  background: var(--paper-50); border: 1.5px solid var(--line-200); color: var(--ink-500);
}
.progress-step.done .num, .progress-step.active .num { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.progress-step .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-500); white-space: nowrap; }
.progress-step.active .label { color: var(--navy-800); font-weight: 600; }
.progress-line { flex: 1; height: 1.5px; background: var(--line-200); margin: 0 10px 20px; }
.progress-line.done { background: var(--blue-600); }

.panel h2.numbered { display: flex; align-items: center; gap: 10px; text-transform: none; font-size: 1.02rem; color: var(--ink-900); }
.panel h2.numbered .step-badge {
  width: 22px; height: 22px; border-radius: 50%; background: var(--blue-600); color: #fff;
  font-family: var(--font-mono); font-size: 0.7rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.panel-subtext { font-size: 0.82rem; color: var(--ink-500); margin: 2px 0 18px; }

.file-chip-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.file-chip { display: flex; align-items: center; gap: 10px; background: var(--paper-50); border: 1px solid var(--line-200); border-radius: 8px; padding: 9px 12px; font-size: 0.85rem; }
.file-chip .fc-size { color: var(--ink-500); font-size: 0.76rem; margin-left: auto; }
.file-chip .fc-view { background: none; border: none; color: var(--blue-600); cursor: pointer; padding: 2px 6px; font-size: 0.78rem; font-weight: 600; }
.file-chip .fc-view:hover { background: #E9EEFB; border-radius: 4px; transform: none; }
.file-chip .fc-remove { background: none; border: none; color: var(--red-600); cursor: pointer; padding: 2px 4px; font-size: 1rem; }
.file-chip .fc-remove:hover { background: var(--red-100); border-radius: 4px; transform: none; }
.file-chip.fc-error .fc-size { color: var(--red-600); }
.attached-badge { font-size: 0.76rem; background: var(--green-100); color: var(--green-600); padding: 3px 10px; border-radius: 20px; font-weight: 600; }

.info-callout { display: flex; gap: 8px; background: #E9EEFB; border-radius: 8px; padding: 11px 13px; font-size: 0.8rem; color: var(--navy-800); margin: 16px 0; line-height: 1.4; }
.info-callout svg { flex-shrink: 0; margin-top: 1px; color: var(--blue-600); }

.guidelines-list { list-style: none; padding: 0; margin: 0 0 14px; }
.guidelines-list li { display: flex; gap: 8px; font-size: 0.84rem; margin-bottom: 9px; color: var(--ink-900); line-height: 1.4; }
.guidelines-list svg { flex-shrink: 0; color: var(--green-600); margin-top: 1px; }

.mini-help-panel { text-align: left; }
.mini-help-panel p { font-size: 0.82rem; color: var(--ink-500); margin: 4px 0 14px; }

.sidebar-trust { display: flex; gap: 8px; font-size: 0.74rem; color: var(--ink-500); margin-top: 16px; line-height: 1.4; }
.sidebar-trust svg { flex-shrink: 0; color: var(--blue-600); }

.attachment-viewer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 25, 43, 0.72);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.attachment-viewer-overlay.open { display: flex; }
.attachment-viewer-box {
  background: var(--paper-0);
  border-radius: 10px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.attachment-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-200);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-900);
}
.attachment-viewer-header button {
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink-500);
  cursor: pointer;
  padding: 2px 6px;
}
.attachment-viewer-header button:hover { color: var(--red-600); transform: none; }
.attachment-viewer-body {
  flex: 1;
  /* Panning is now handled by our own drag logic (translate + scale on
     the image), not the browser's native scrollbars - hidden here avoids
     native scroll fighting with that JS-tracked offset. */
  overflow: hidden;
  background: var(--paper-50);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}
.attachment-viewer-body img { max-width: 100%; max-height: 80vh; display: block; touch-action: none; user-select: none; -webkit-user-drag: none; }
.attachment-viewer-body iframe { width: 100%; height: 75vh; border: none; }

.payee-search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--paper-0);
  border: 1px solid var(--line-200);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(16, 25, 43, 0.12);
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
}
.payee-search-results.open { display: block; }
.payee-search-result {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--line-200);
}
.payee-search-result:last-child { border-bottom: none; }
.payee-search-result:hover { background: var(--paper-50); }
.payee-search-result .psr-email { color: var(--ink-500); font-size: 0.76rem; }

.line-item-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 25, 43, 0.72);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.line-item-modal-overlay.open { display: flex; }
.line-item-modal-box {
  background: var(--paper-0);
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.line-item-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-200);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-900);
}
.line-item-modal-header button {
  background: none; border: none; font-size: 1.3rem; line-height: 1;
  color: var(--ink-500); cursor: pointer; padding: 2px 6px;
}
.line-item-modal-body { padding: 18px; overflow-y: auto; }
.line-item-modal-footer {
  display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line-200);
}
.line-item-modal-footer button { flex: 1; }

/* Card layout for the redesigned line-item tables (Liquidation, and
   Reimbursement-type Payment Order) - always on, at every screen size,
   not just a small-screen fallback. With 8-9 columns of financial data,
   no monitor-independent layout could fit them side-by-side without a
   horizontal scrollbar; cards avoid that entirely and work identically
   well on a desktop monitor or a phone browser. Each row is a card, and
   each field's own label is injected via ::before from its data-label
   attribute (set in line_items.js), rather than a table header. */
table.line-items.redesigned,
table.line-items.redesigned thead,
table.line-items.redesigned tbody,
table.line-items.redesigned th,
table.line-items.redesigned td,
table.line-items.redesigned tr {
  display: block;
  width: 100%;
}
table.line-items.redesigned thead { display: none; }
table.line-items.redesigned tr {
  border: 1px solid var(--line-200);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
table.line-items.redesigned td {
  border-bottom: none;
  padding: 6px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
table.line-items.redesigned td::before {
  content: attr(data-label);
  font-weight: 600;
  font-size: 0.74rem;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
table.line-items.redesigned td[data-label]:empty::before { content: none; }

/* Global loading overlay - shown the moment any form submits or any
   same-tab navigation link is clicked, so a "few seconds before
   anything happens" wait always comes with immediate visual feedback
   instead of an unchanged page that looks unresponsive. */
#global-loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 25, 43, 0.35);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
#global-loading-overlay.open { display: flex; }
.global-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: global-spinner-spin 0.7s linear infinite;
}
@keyframes global-spinner-spin {
  to { transform: rotate(360deg); }
}
