/*
 * Site-wide look: one size and style for every form control, button, table and heading, whatever classes a page uses.
 * Loaded after Tailwind; !important is used only where page-level utility classes would otherwise differ page to page.
 * Opt out with class="plain" on a table (documents such as payslips and Form 16 keep their own layout).
 */
html { font-size: 15px; }
body { font-size: .9rem; color: #1e293b; }

/* Headings */
main > h1 { font-size: 1.35rem !important; margin-bottom: 1.25rem !important; }
main h2 { letter-spacing: -.01em; }

/* Form controls */
main input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]),
main select,
main textarea {
  font-size: .875rem !important;
  line-height: 1.25rem !important;
  padding: .45rem .7rem !important;
  min-height: 2.3rem;
  border: 1px solid #cbd5e1 !important;
  border-radius: .5rem !important;
  background-color: #fff;
  color: #0f172a;
  box-shadow: none;
}
main select { padding-right: 2rem !important; }
main textarea { min-height: 4.5rem; }
main input::placeholder, main textarea::placeholder { color: #94a3b8; }
main input:focus, main select:focus, main textarea:focus {
  outline: none !important;
  border-color: #ee5a3f !important;
  box-shadow: 0 0 0 3px #ffe0d9 !important;
}
main input:disabled, main select:disabled, main textarea:disabled, main fieldset:disabled input, main fieldset:disabled select { background: #f8fafc; color: #64748b; }
main input[type=checkbox], main input[type=radio] { accent-color: #e54f36; width: 1rem; height: 1rem; }
main input[type=file] { font-size: .85rem; }
main form label { font-size: .85rem; }
main form label > span:first-child:not(:only-child) { font-weight: 500; color: #334155; }

/* Buttons and button-like links: one font, weight and corner radius */
main button, main a[class*="rounded-lg"][class*="px-"] {
  font-size: .85rem !important;
  font-weight: 500;
  line-height: 1.25rem;
  border-radius: .5rem;
}
main button:focus-visible, main a:focus-visible { outline: 2px solid #ee5a3f; outline-offset: 2px; }

/* Tables */
main table:not(.plain) { font-size: .85rem; border-collapse: collapse; }
main table:not(.plain) thead th {
  font-size: .7rem !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b !important;
  background: #f8fafc;
  padding: .7rem 1rem !important;
  white-space: nowrap;
  border-bottom: 1px solid #e2e8f0;
}
main table:not(.plain) thead th a { color: inherit; }
:where(main table:not(.plain)) th { text-align: left; }   /* zero specificity: text-right/center classes still win */
main table:not(.plain) tbody td { padding: .65rem 1rem !important; vertical-align: middle; }
main table:not(.plain) tbody tr + tr { border-top: 1px solid #f1f5f9; }
main table:not(.plain) tbody tr:hover { background: #fafbfc; }
main table:not(.plain) tfoot td { padding: .7rem 1rem !important; }
main table:not(.plain) td form input:not([type=checkbox]) { min-height: 1.9rem; padding: .25rem .5rem !important; font-size: .8rem !important; }
main table:not(.plain) td button { font-size: .78rem !important; }

/* Status pills */
main span.rounded-full[class*="text-xs"] { font-size: .72rem !important; padding: .15rem .6rem !important; font-weight: 500; }

@media print { html { font-size: 15px; } }
