/* Responsive typography and simple defaults */

html {
  /* scales between 16 px (mobile) and 22 px (large desktop) */
  font-size: clamp(1rem, 0.875rem + 0.6vw, 1.375rem);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  margin: 0.5rem;
}

/* Messages / status */

.err { color: #b00020; margin-top: 0.5rem; }
.msg-list { margin: 0 0 0.75rem 0; }
.msg { padding: 0.5rem 0.625rem; border-radius: 0.375rem; margin: 0.375rem 0; }
.msg--error { background: #fdecec; color: #8a1f1f; border: 1px solid #f4c7c7; }
.msg--warning { background: #fff7e6; color: #8a6d3b; border: 1px solid #ffe0a3; }
.msg--info { background: #eef6ff; color: #0b5cad; border: 1px solid #cfe3ff; }
.msg--success { background: #e9f7ef; color: #1e6b3a; border: 1px solid #bfe5cd; }

.info { color: #2e7d32; }
.muted { color: #666; }

/* Headings */

h1, h2 { margin-top: 0; }

/* Tables: common styling */

table {
  --tbl-border: #bbb;
  --cell-pad: 0.1rem 0.1rem;
  font-size: 0.9rem;
  border-collapse: collapse;
  border: 1px solid var(--tbl-border);
  margin: 0.5rem 0;
}

th,
td {
  padding: var(--cell-pad);
  border: 1px solid var(--tbl-border);
}

/* Smaller header text for dense tables (e.g. salary date ranges) */
th.small-header {
  font-size: 0.7em;
  vertical-align: top;
}

/* Salary tables: enforce equal-width numeric columns */
table.budgie-table.salary-table th.salary-col,
table.budgie-table.salary-table td.salary-col {
  width: 4rem;           /* tweak as needed */
  min-width: 4rem;
  max-width: 4rem;
}

td.right,
th.right {
  text-align: right;
}

/* FTE sparkline column in budget project view */
td.fte-sparkline {
  white-space: nowrap;
}
td.fte-sparkline svg {
  display: block;
  width: 15rem;
}

/* Highlighted rows (GLC/project highlight) */

tr.hl {
  font-weight: 600;
  background-color: #ffffcc;
}

/* Normalize form control typography across browsers */

input,
button,
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

/* Table-based forms */

table.form { border-collapse: collapse; border: none; }
table.form td { padding: 0.25rem 0; border: none; }
table.form td.label { vertical-align: top; white-space: nowrap; }
table.switch-form { border: none; margin: 0; }
table.switch-form td { border: none; padding: 2px 0; }

/* Read-only fields */

input[readonly] {
  background-color: #f3f3f3;
}

/* Chart sizing (kept for future use) */

.chartwrap {
  display: block;
  width: min(100%, 56.25rem); /* 900px */
  aspect-ratio: 4 / 3;
  max-height: 42.1875rem;     /* 675px */
}

canvas.chart {
  display: block;
  width: 100%;
  height: 100%;
}

/* Note flags (kept for future use) */

.has-note { position: relative; }
.has-note::before {
  content: "";
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 0.375rem;
  height: 0.375rem;
  background: #c00;
  border-radius: 50%;
}

.has-note-yellow::before { background: #fc0; }
.has-note-red::before    { background: #c00; }

/* Help overlay (kept for future use) */

.qrhelp-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 9998;
}

.qrhelp-panel {
  display: none;
  position: fixed;
  top: 5vh;
  left: 5vw;
  width: 90vw;
  height: 85vh;
  background: #f0fff0;
  border: 2pt solid #aaa;
  z-index: 9999;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
}

.qrhelp-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #f0fff0;
}

.qrhelp-close {
  position: absolute;
  top: 0.375rem;
  right: 0.625rem;
  text-decoration: none;
  font-weight: bold;
  color: #333;
}

/* Help link styling */

a.help-local {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.125rem;
}

sup.help-go {
  font-size: 0.75em;
  margin-left: 0.25em;
}

/* Chart.js font sizing */
canvas.chart,
#reconChart {
  font-size: 0.9rem;  /* scales with html { font-size: clamp(...) } */
}
