/* ============================================================
   Graham Care Payroll Integration — Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Marcellus&family=Manrope:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Forest-green palette (matches care-planning app) ── */
  --bg:            #f5f2eb;
  --surface:       #faf9f6;
  --surface-hover: #f0ede6;
  --border:        #d4ddd0;
  --border-subtle: #e5ebe1;
  --text:          #1e2e24;
  --text-muted:    #5a6b5e;

  /* Sage green accent (CTAs, highlights) */
  --accent:        #b5c4a8;
  --accent-hover:  #a3b396;
  --accent-fg:     #1e3328;

  /* Dark forest green (header, emphasis, links) */
  --header-bg:     #1a2820;
  --header-text:   #ffffff;
  --header-muted:  rgba(255,255,255,0.78);
  --header-border: rgba(255,255,255,0.12);
  --link:          #2d5a3d;
  --link-hover:    #1e4029;

  /* Status */
  --success:       #3d6b4f;
  --warning:       #c9a227;
  --red:           #b53a2f;
  --green:         #3d6b4f;

  /* Grey scale — warm-tinted */
  --g50:   #f8f7f4;
  --g100:  #f0ede6;
  --g200:  #d4ddd0;
  --g300:  #b8c5b2;
  --g400:  #8a9e86;
  --g500:  #6d8069;
  --g600:  #5a6b5e;
  --g700:  #3d5042;
  --g800:  #1e2e24;
  --g900:  #111d17;

  /* Legacy aliases so existing references keep working */
  --teal:     #2d5a3d;
  --teal-lt:  #f0ede6;
  --teal-mid: #e5ebe1;
  --blue:     #1a2820;

  --r:    8px;
  --sh:   0 1px 3px rgba(26,40,32,.08), 0 4px 16px rgba(26,40,32,.07);

  --font-serif: 'Marcellus', Georgia, 'Times New Roman', serif;
  --font-sans:  'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

/* ── Header ── */
.header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(26,40,32,.35);
  border-bottom: 1px solid var(--header-border);
}
.header-inner {
  max-width: 1040px; margin: 0 auto; padding: 0 20px;
  height: 54px; display: flex; align-items: center; justify-content: space-between;
}
.header-brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 34px; height: 34px; background: var(--accent);
  border-radius: 7px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; letter-spacing: .5px; flex-shrink: 0;
  color: var(--accent-fg);
}
.brand-name    { font-weight: 700; font-size: 14px; font-family: var(--font-serif); letter-spacing: 0.02em; }
.brand-divider { color: var(--header-muted); margin: 0 4px; }
.brand-sub     { font-size: 12px; color: var(--header-muted); }
.header-right  { display: flex; align-items: center; gap: 10px; }

/* ── Header nav links (admin, sign-out) ── */
.header-admin-link {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--header-muted);
  border-radius: var(--r);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.header-admin-link:hover {
  background: rgba(255,255,255,0.08);
  color: var(--header-text);
}
.header-user-name {
  font-size: 0.875rem;
  color: var(--header-muted);
}
.header-signout {
  padding: 0.4rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: var(--r);
  color: var(--accent-fg);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s;
}
.header-signout:hover { background: var(--accent-hover); }

/* ── Xero status pill ── */
.xero-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 20px;
}
.xero-status.connected    { background: rgba(181,196,168,.25); color: var(--accent); }
.xero-status.disconnected { background: rgba(255,255,255,.1);  color: var(--header-muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.xero-status.connected .status-dot { background: var(--accent); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .13s;
  padding: 9px 20px; white-space: nowrap;
  font-family: var(--font-sans);
}
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-outline { background: transparent; border: 1.5px solid rgba(255,255,255,.45); color: var(--header-text); }
.btn-outline:hover { background: rgba(255,255,255,.1); }
.btn-ghost   { background: transparent; color: var(--g600); border: none; }
.btn-ghost:hover { color: var(--g800); background: var(--surface-hover); }

/* Primary / teal → forest green */
.btn-primary,
.btn-teal { background: var(--link); color: #fff; }
.btn-primary:hover:not(:disabled),
.btn-teal:hover:not(:disabled) { background: var(--link-hover); }

.btn-gray { background: var(--surface); color: var(--g600); border: 1px solid var(--border); }
.btn-gray:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--g300); }

.btn-secondary { background: var(--surface); color: var(--g700); border: 1px solid var(--g300); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--g500); color: var(--g900); }

.btn-clear {
  background: none; border: none; cursor: pointer;
  color: var(--g400); font-size: 13px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; line-height: 1;
  transition: color .12s, background .12s;
}
.btn-clear:hover { color: var(--red); background: #f9e8e7; }

/* ── Main layout ── */
.main {
  max-width: 1040px; margin: 0 auto; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}

/* ── Org / Pay Run bar ── */
.period-bar {
  background: var(--surface); border-top: none; border-left: none; border-right: none;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--sh);
}
.period-fields {
  max-width: 1040px; margin: 0 auto; padding: 10px 20px;
  display: flex; gap: 14px; flex-wrap: nowrap; align-items: center;
}
.field-inline { display: flex; align-items: center; gap: 7px; }
.field-inline.field-grow { flex: 1; min-width: 200px; }
.period-fields select:disabled { opacity: 0.65; cursor: default; pointer-events: none; }
.field-inline label {
  font-size: 11px; font-weight: 700; color: var(--g600);
  text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
}
.field-inline input, .field-inline select {
  padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 13px; color: var(--text); background: var(--surface);
  height: 32px; transition: border-color .13s;
}
.field-inline.field-grow select { width: 100%; }
.field-inline input:focus, .field-inline select:focus {
  outline: none; border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(45,90,61,.1);
}

/* ── Cards grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* ── Import card ── */
.import-card {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--sh);
  border: 1px solid var(--border);
  padding: 22px 22px 22px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.import-card.loading { opacity: .55; pointer-events: none; }

/* Card that spans the full grid width */
.card-full { grid-column: 1 / -1; }

/* ── Card top row (icon + number) ── */
.card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 14px;
}
.card-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.card-icon svg { width: 22px; height: 22px; }
.hours-icon   { background: #dbeafe; color: #2563eb; }
.accomm-icon  { background: #f3e8ff; color: #9333ea; }
.hastee-icon  { background: #fff7ed; color: #c2410c; }
.expenses-icon{ background: #dcfce7; color: #16a34a; }

.card-num {
  font-size: 11px; font-weight: 800; color: var(--g400);
  background: var(--bg); border-radius: 5px;
  padding: 2px 7px; letter-spacing: .3px;
}

/* ── Card text ── */
.card-title {
  font-size: 15px; font-weight: 700; color: var(--g800);
  margin-bottom: 6px;
}
.card-desc {
  font-size: 12.5px; color: var(--link); line-height: 1.55;
}

/* Pushes footer to bottom when no drop zone */
.card-spacer { flex: 1; min-height: 16px; }

/* ── Drag-and-drop zone ── */
.drop-zone {
  margin-top: 16px;
  border: 2px dashed var(--g200); border-radius: 8px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; color: var(--g400); font-size: 13px;
  transition: border-color .15s, background .15s, color .15s;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--link); background: var(--teal-lt); color: var(--link);
}
.drop-zone strong { color: var(--g800); }
.drop-zone.drag-over strong { color: var(--link); }

/* ── File info row (after upload) ── */
.file-info {
  margin-top: 8px; display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; background: var(--g50); border-radius: 6px;
  border: 1px solid var(--g200);
}
.file-name {
  flex: 1; font-size: 12px; color: var(--g600);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Card footer (action buttons) ── */
.card-footer {
  display: flex; gap: 8px; align-items: center;
  padding: 16px 0 22px;
}

/* ── Expenses card header (title + buttons side by side) ── */
.card-expenses-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 20px;
  margin-bottom: 4px;
}
.card-expenses-header .card-footer { padding: 0; flex-shrink: 0; }

/* ── Preview area ── */
.preview-area {
  border-top: 1px solid var(--g100);
  margin: 12px -22px 0;
  max-height: 340px;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 0 0 12px 12px;
}
.preview-area table {
  min-width: 100%;
}
.preview-loading-note {
  font-size: 13px; color: var(--g400);
  padding: 14px 22px;
  margin: 0;
  font-style: italic;
}
.preview-label {
  font-size: 11px; font-weight: 700; color: var(--g400);
  text-transform: uppercase; letter-spacing: .4px;
  padding: 10px 22px 6px;
}
.preview-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  text-align: left; padding: 7px 22px;
  background: var(--g50); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px; color: var(--g400);
  border-bottom: 1px solid var(--g200);
}
.data-table td {
  padding: 7px 22px; border-bottom: 1px solid var(--g100); color: var(--g600);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--g50); }

/* ── Expense table ── */
.expense-body { overflow-x: auto; border-top: 1px solid var(--g100); margin: 0 -22px; }
.expense-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.expense-table th {
  text-align: left; padding: 8px 14px;
  background: var(--g50); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px; color: var(--g400);
  border-bottom: 1px solid var(--g200);
}
.expense-table td { padding: 5px 8px; border-bottom: 1px solid var(--g100); vertical-align: middle; }
.expense-table tr:last-child td { border-bottom: none; }
.expense-table input, .expense-table select {
  width: 100%; padding: 5px 8px;
  border: 1.5px solid var(--g200); border-radius: 5px;
  font-size: 12px; color: var(--g800); background: var(--surface);
}
.expense-table input:focus, .expense-table select:focus {
  outline: none; border-color: var(--link);
  box-shadow: 0 0 0 2px rgba(45,90,61,.08);
}
.expense-table .amount-cell { font-weight: 600; color: var(--g800); padding: 5px 14px; }
.expense-table .empty-row td {
  text-align: center; padding: 24px; color: var(--g400);
  font-size: 12px; font-style: italic;
}
.btn-remove {
  background: none; border: none; color: var(--g400);
  font-size: 14px; cursor: pointer; padding: 4px 8px; border-radius: 4px;
}
.btn-remove:hover { color: var(--red); background: #fef2f2; }

/* ── Reconciliation section ── */
.reconcile-icon { background: #fef9c3; color: #ca8a04; }

.reconcile-body { border-top: 1px solid var(--g100); margin: 0 -22px; }

.reconcile-summary {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 22px; border-bottom: 1px solid var(--g100);
}
.rec-badge {
  padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
}
.badge-blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-gray { background: var(--bg); color: var(--g600); border: 1px solid var(--g200); }

.reconcile-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.reconcile-table th {
  text-align: left; padding: 8px 14px;
  background: var(--g50); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px; color: var(--g400);
  border-bottom: 1px solid var(--g200);
}
.reconcile-table td {
  padding: 7px 14px; border-bottom: 1px solid var(--g100);
  vertical-align: middle;
}
.reconcile-table tr:last-child td { border-bottom: none; }

/* Row state colours */
.rec-row-disc     { background: #fffbeb; }
.rec-row-disc td  { border-bottom-color: #fde68a; }
.rec-row-dbonly   { background: #eff6ff; }
.rec-row-xeroonly { background: var(--g50); }
.rec-row-disc:hover, .rec-row-dbonly:hover, .rec-row-xeroonly:hover { filter: brightness(.98); }

/* Difference cell */
.diff-nonzero { font-weight: 700; color: #b45309; }
.diff-zero    { color: #16a34a; }
.diff-na      { color: var(--g300); }

/* Status badges inside table */
.status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 700;
}

/* Amended hours input */
.amend-input {
  width: 90px; padding: 5px 8px;
  border: 1.5px solid #fbbf24; border-radius: 5px;
  font-size: 12px; font-weight: 600; color: var(--g800);
  background: var(--surface);
}
.amend-input:focus {
  outline: none; border-color: var(--link);
  box-shadow: 0 0 0 2px rgba(45,90,61,.1);
}

/* ── Results panel ── */
.results-panel { animation: fadeUp .18s ease; padding: 0; }
@keyframes fadeUp { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
.results-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--g100);
}
.results-title { font-size: 13px; font-weight: 700; }
#results-body { padding: 16px 20px; }
.results-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.summary-badge { padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge-green { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-amber { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.badge-red   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.results-section { margin-bottom: 14px; }
.results-section h4 {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--g400); margin-bottom: 6px;
}

/* ── Toasts ── */
#toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 6px; z-index: 9999;
}
.toast {
  padding: 10px 16px; border-radius: 8px; font-size: 12px; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.15); animation: toastIn .18s ease; max-width: 360px;
  display: flex; align-items: flex-start; gap: 10px;
}
.toast-msg { flex: 1; }
.toast-close {
  background: none; border: none; cursor: pointer; font-size: 14px; line-height: 1;
  padding: 0; opacity: 0.7; color: inherit; flex-shrink: 0; margin-top: 1px;
}
.toast-close:hover { opacity: 1; }
@keyframes toastIn { from { opacity:0; transform:translateX(16px); } to { opacity:1; transform:none; } }
.toast-success { background: #1c2b1e; color: #bbf7d0; }
.toast-error   { background: #2b1c1c; color: #fecaca; }
.toast-warning { background: #2b2310; color: #fde68a; }
.toast-info    { background: #1c2132; color: #bfdbfe; }

/* ── Page routing ── */
.page          { display: none; }
.page.active   { display: block; }

/* ── Tab navigation bar ── */
.tab-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0;
  gap: 0;
  position: sticky; top: 56px; z-index: 90;
  box-shadow: 0 1px 0 var(--border-subtle);
}
.tab-nav-inner {
  max-width: 1040px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 0; width: 100%;
}
.tab-btn {
  background: none; border: none; cursor: pointer;
  padding: 14px 20px 12px;
  font-size: 13px; font-weight: 600; color: var(--g400);
  border-bottom: 2.5px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--g700); }
.tab-btn.active {
  color: var(--link);
  border-bottom-color: var(--link);
}

/* ── Data status badge (on Hours card) ── */
.data-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 8px 0 0;
  background: rgba(45,90,61,.08);
  border: 1px solid rgba(45,90,61,.2);
  color: var(--link);
  font-size: 11.5px; font-weight: 600;
  padding: 5px 10px; border-radius: 20px;
  width: fit-content;
}
.data-status-badge::before {
  content: "✓"; font-weight: 800;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
  font-size: 13px; color: var(--g400);
}
.breadcrumb span { color: var(--g600); font-weight: 600; }
.breadcrumb-back {
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--link); font-weight: 600;
  padding: 0; display: flex; align-items: center; gap: 4px;
  transition: opacity .15s;
}
.breadcrumb-back:hover { opacity: .75; }

/* ── Run Payroll — page header ── */
.run-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.run-header-text { flex: 1; }
.run-title { font-size: 22px; font-weight: 700; color: var(--g900); margin: 0 0 4px; }
.run-desc  { font-size: 13px; color: var(--g400); margin: 0; }

/* ── Run pipeline container ── */
.run-pipeline { display: flex; flex-direction: column; gap: 0; margin-bottom: 36px; }

/* ── Individual step card ── */
.run-step {
  display: flex; gap: 0; align-items: stretch;
  background: var(--surface); border: 1.5px solid var(--g200);
  border-radius: var(--r); margin-bottom: 12px;
  box-shadow: var(--sh); overflow: hidden;
  transition: border-color .18s, box-shadow .18s;
}
.run-step.step-running {
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(45,90,61,.12);
}

/* ── Left spine (step number + connector line) ── */
.step-spine {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0; width: 52px; flex-shrink: 0;
  background: var(--g50);
  border-right: 1.5px solid var(--g200);
}
.step-bubble {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--link); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.step-line {
  flex: 1; width: 2px; background: var(--g200);
  margin-top: 8px; min-height: 20px;
}

/* ── Step body (content area) ── */
.step-body { flex: 1; padding: 18px 20px; }
.step-top  { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.step-info { flex: 1; }
.step-title { font-size: 15px; font-weight: 700; color: var(--g900); margin: 0 0 4px; }
.step-desc  { font-size: 13px; color: var(--text-secondary); margin: 0 0 6px; line-height: 1.5; }
.step-note  { font-size: 11.5px; color: var(--g400); margin: 0 0 8px; font-style: italic; line-height: 1.4; }

/* ── Step controls (badge + button) ── */
.step-controls { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding-top: 2px; }

/* ── Step status badges ── */
.step-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; white-space: nowrap; letter-spacing: .3px;
}
.step-badge.pending  { background: var(--bg); color: var(--g500); }
.step-badge.running  { background: #dbeafe; color: #1d4ed8; }
.step-badge.done     { background: #dcfce7; color: #166534; }
.step-badge.warn     { background: #fef9c3; color: #854d0e; }
.step-badge.error    { background: #fee2e2; color: #991b1b; }
.step-badge.info     { background: #fef3c7; color: #92400e; }

/* ── Step results panel ── */
.step-results {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--g200); font-size: 12.5px;
}
.step-summary {
  font-weight: 700; color: var(--link); margin-bottom: 8px; font-size: 13px;
}
.step-summary.step-bypassed { color: #92400e; }
.step-result-group { margin-bottom: 10px; }
.step-result-group ul { margin: 4px 0 0 16px; padding: 0; line-height: 1.7; }
.step-result-group.muted  { color: var(--g400); }
.step-result-group.error-group { color: #991b1b; }
.step-running-msg  { color: var(--link); font-style: italic; }
.step-error-msg    { color: #991b1b; padding: 8px; background: #fee2e2; border-radius: 4px; }
.step-note-text    { font-size: 12px; color: var(--g500); margin: 0 0 8px; line-height: 1.5; }
.note-text         { color: var(--g400); font-style: italic; }

/* ── Result tables (Hastee / Accommodation preview) ── */
.result-table {
  width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px;
}
.result-table th, .result-table td {
  text-align: left; padding: 4px 10px;
  border-bottom: 1px solid var(--g100);
}
.result-table th { font-weight: 700; color: var(--g500); font-size: 11px; text-transform: uppercase; }
.result-total { font-weight: 700; text-align: right; padding: 6px 10px 0; font-size: 13px; }

/* ── CSV upload row in step ── */
.step-csv-row {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
}
.csv-filename-badge {
  font-size: 11.5px; color: var(--link); background: var(--g50);
  border: 1px solid var(--g200); border-radius: 4px; padding: 2px 8px;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Module shortcuts below the pipeline ── */
.module-shortcuts { margin-top: 8px; }
.shortcuts-heading { font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--g400); margin: 0 0 10px; }
.shortcuts-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.shortcut-card {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1.5px solid var(--g200);
  border-radius: 8px; padding: 8px 16px;
  font-size: 13px; font-weight: 600; color: var(--g700);
  cursor: pointer; transition: border-color .15s, color .15s;
}
.shortcut-card:hover { border-color: var(--link); color: var(--link); }
.shortcut-card svg   { color: var(--g400); transition: color .15s; }
.shortcut-card:hover svg { color: var(--link); }

/* ── Mono helper ── */
.mono { font-family: monospace; font-size: 11px; background: var(--g50);
  padding: 1px 5px; border-radius: 3px; }

/* ── Placeholder pages ── */
.placeholder-page {
  max-width: 520px; margin: 60px auto; text-align: center;
  background: var(--surface); border: 1.5px solid var(--g200);
  border-radius: var(--r); padding: 48px 40px;
  box-shadow: var(--sh);
}
.placeholder-icon {
  width: 72px; height: 72px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.placeholder-title {
  font-size: 22px; font-weight: 700; color: var(--g900);
  margin: 0 0 10px;
}
.placeholder-desc {
  font-size: 14px; color: var(--g400); margin: 0 0 18px;
}
.placeholder-list {
  list-style: none; padding: 0; margin: 0 0 28px;
  text-align: left; display: inline-block;
}
.placeholder-list li {
  font-size: 13px; color: var(--g600); padding: 5px 0 5px 22px;
  position: relative;
}
.placeholder-list li::before {
  content: "✓"; position: absolute; left: 0;
  color: var(--link); font-weight: 700;
}
.placeholder-badge {
  display: inline-block;
  background: rgba(45,90,61,.1); color: var(--link);
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; padding: 6px 16px; border-radius: 20px;
  border: 1.5px solid rgba(45,90,61,.25);
}

/* ── New Employee Form ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group-full { grid-column: 1 / -1; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .4px; }
.form-group .req { color: #e53e3e; }
.form-section-heading {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--link); border-bottom: 1.5px solid var(--teal);
  padding-bottom: 4px; margin-top: 6px;
}
.pension-note {
  display: flex; align-items: flex-start; gap: 8px;
  background: #f0fdf4; border: 1px solid #86efac; border-radius: 6px;
  padding: 8px 12px; font-size: 12px; color: #166534;
}
.pension-note-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.form-group input,
.form-group select {
  height: 36px; padding: 0 10px;
  border: 1.5px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text-primary);
  font-size: 13px;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus { outline: none; border-color: var(--link); }

/* ── Responsive ── */
@media (max-width: 680px) {
  .header-inner { padding: 0 14px; }
  .brand-divider, .brand-sub { display: none; }
  .main { padding: 12px; gap: 10px; }
  .period-fields { flex-direction: column; gap: 8px; padding: 10px 14px; }
  .field-inline.field-grow { width: 100%; }
  .cards-grid { grid-template-columns: 1fr; }
  .card-full  { grid-column: 1; }
  .card-expenses-header { flex-direction: column; }
}

/* ── Login page ── */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 2rem;
}
.login-card {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh);
  padding: 3rem 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
/* removed: .brand-logo-lg (element no longer used) */
.login-title  { font-size: 1.6rem; font-weight: 700; margin: 0 0 0.2rem; font-family: var(--font-serif); letter-spacing: 0.01em; }
.login-sub    { font-size: 0.9rem; color: var(--link); font-weight: 600; margin-bottom: 1rem; }
.login-desc   { color: var(--g600); font-size: 0.9rem; margin-bottom: 2rem; }
.login-error  { color: var(--red); font-size: 0.85rem; margin-top: 1rem; }
.btn-ms {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #2f2f2f;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.65rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  justify-content: center;
}
.btn-ms:hover { background: #1a1a1a; }

/* ── Admin page ── */
.page-header-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-title { font-size: 1.4rem; font-weight: 700; font-family: var(--font-serif); letter-spacing: 0.01em; }
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--g200);
  margin-bottom: 1.5rem;
}
.admin-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--g600);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.admin-tab.active  { color: var(--link); border-bottom-color: var(--link); }
.admin-tab:hover   { color: var(--g800); }
.admin-add-form    { background: var(--surface-hover); border: 1px solid var(--border-subtle); border-radius: var(--r); padding: 1rem; margin-bottom: 1.25rem; }
.field-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--g200);
  color: var(--g600);
  font-weight: 600;
  white-space: nowrap;
}
.data-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--g100); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--g50); }
.badge-admin { background: var(--teal-mid); color: var(--link); padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-user  { background: var(--bg); color: var(--g600); padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn-ghost.btn-danger { color: var(--red); }
.btn-ghost.btn-danger:hover { color: var(--red); background: #fef2f2; }

/* Xero org card */
.xero-org-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.xero-org-card.inactive { opacity: 0.55; }
.xero-org-info { flex: 1; }
.xero-org-name { font-weight: 600; font-size: 0.95rem; }
.xero-org-id   { font-size: 0.78rem; color: var(--g400); font-family: monospace; margin-top: 0.1rem; }
.xero-org-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Sync Staff List page ── */
.sync-staff-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.sync-summary-bar {
  display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem;
}
.sync-badge {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 0.75rem 1.25rem;
  display: flex; flex-direction: column; align-items: center; min-width: 110px;
  box-shadow: var(--sh);
}
.sync-badge-num   { font-size: 1.75rem; font-weight: 700; color: var(--g900); line-height: 1; }
.sync-badge-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 0.25rem; }
.sync-badge-ok   .sync-badge-num { color: var(--link); }
.sync-badge-warn .sync-badge-num { color: #b45309; }
.sync-badge-warn { border-color: #fde68a; background: #fffbeb; }
.sync-section-title {
  font-size: 1rem; font-weight: 700; margin: 0 0 0.75rem;
}
.sync-section-warn { color: #b45309; }
.sync-section-ok   { color: var(--link); }
.row-warn td { background: #fffbeb !important; }
.row-warn:hover td { background: #fef3c7 !important; }
.row-xero-only td { color: var(--g400); }

/* Sync compare table */
.sync-compare-table .sync-col-group-header th { padding-bottom: 0; border-bottom: none; }
.sync-col-group {
  text-align: center; font-size: 0.7rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px;
  border-radius: 4px 4px 0 0;
}
.sync-col-group-planday      { background: #e8f4ea; color: var(--link); border-bottom: 2px solid var(--link); }
.sync-col-group-planday-calc { background: #f0f9f1; color: var(--link); border-bottom: 2px solid var(--link); }
.sync-col-group-xero         { background: #e8f0fb; color: #1a56db;     border-bottom: 2px solid #3b82f6; }
.sync-compare-table:not(.sync-hours-table) td.sync-col-planday-end { border-right: 2px solid var(--g200); }
.sync-compare-table:not(.sync-hours-table) th:nth-child(5) { border-right: 2px solid var(--g200); }
.sync-status {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.sync-status-ok   { background: #dcfce7; color: #166534; }
.sync-status-warn { background: #fef3c7; color: #92400e; }
.sync-status-muted { background: var(--g100); color: var(--g500); }
.sync-col-xero-empty, .sync-col-pd-empty { color: var(--g300); }

/* ── Sync Staff Hours page ────────────────────────────── */
/* Keep action buttons pinned to the right of the header, never wrapping below */
#page-sync-staff-hours .sync-staff-header { flex-wrap: nowrap; align-items: flex-start; }
#page-sync-staff-hours .sync-staff-header > div:first-child { flex: 1; min-width: 0; }
.sync-hours-actions { display: flex; gap: 0.5rem; align-items: flex-start; flex-shrink: 0; margin-top: 0.25rem; }
.sync-btn-group { display: inline-flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.sync-btn-age   { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; display: block; text-align: center; }

.sync-hours-table .num-col { text-align: right; font-variant-numeric: tabular-nums; }
.sync-hours-table thead th,
.sync-hours-table thead th.num-col,
.sync-pay-table thead th,
.sync-pay-table thead th.num-col { text-align: center; }

/* Divider after the last Planday column */
.sync-hours-table td.sync-col-planday-end,
.sync-hours-table th.sync-col-planday-end { border-right: 2px solid var(--g200); }

/* Highlight the PD Total column lightly */
.sync-hours-table .hours-pd-total-col { background: rgba(16,185,129,.05); font-weight: 600; }

/* Totals footer row */
.hours-totals-row td { font-weight: 600; border-top: 2px solid var(--g200); background: var(--g50); }
