:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1f2430;
  --text-muted: #6b7280;
  --primary: #2f5fdc;
  --primary-text: #ffffff;
  --danger: #c0362c;
  --danger-bg: #fdecea;
  --success: #1e7e34;
  --success-bg: #e9f7ef;
  --warning: #8a5a00;
  --warning-bg: #fff6e0;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .brand {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

.site-header .who {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-header .who strong {
  color: var(--text);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #eef1fb;
  color: var(--primary);
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}

main.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card + .card {
  margin-top: 1rem;
}

.card h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.card p.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  color: inherit;
  text-decoration: none;
}

a.tile:hover {
  border-color: var(--primary);
  text-decoration: none;
}

.tile h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.tile p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.tile.coming-soon {
  opacity: 0.6;
}

.tile .status {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.login-card h1 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.login-card p.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.alert {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f3c8c4;
}

.alert-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #f0dba0;
}

.alert-warning p {
  margin: 0.5rem 0 0;
}

.alert-warning a {
  color: inherit;
  text-decoration: underline;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

.google-btn:hover {
  background: var(--bg);
  text-decoration: none;
}

form.inline {
  display: inline;
}

.employee-picker {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.employee-picker select,
input[type="date"],
input[type="time"],
input[type="text"],
input[type="number"] {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
}

textarea {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
}

.form-row {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
}

.form-row label,
.card > label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.entry-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.88rem;
}

.entry-table th {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
}

.entry-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.entry-table td.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.entry-table input {
  width: 100%;
  min-width: 90px;
}

.totals-row {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.overflow-x {
  overflow-x: auto;
}

#proof-paste-zone {
  margin-top: 0.75rem;
  padding: 1.5rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: text;
}

#proof-paste-zone:focus {
  outline: none;
  border-color: var(--primary);
  color: var(--text);
}

.proof-thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.proof-thumb {
  position: relative;
  width: 120px;
  height: 120px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.proof-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.proof-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

/* Paystub payment proofs show the whole image at its natural aspect ratio
   (no fixed box, no object-fit cropping) — the thumbnail grid used on the
   review page is a different, pre-save widget and is left alone. */
/* The paystub body has used both .paystub-proofs and .proof-thumbnails as this
   container's class. .proof-thumbnails is shared with the review page's
   pre-save thumbnails, so it isn't restyled as a whole — each paystub link
   takes a full row instead, which works under either class. */
.paystub-proofs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.paystub-proofs .proof-thumb-link,
.proof-thumbnails .proof-thumb-link {
  display: block;
  flex: 0 0 100%;
  break-inside: avoid;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
}

.paystub-proofs .proof-thumb-link img,
.proof-thumbnails .proof-thumb-link img {
  display: block;
  width: 100%;
  height: auto;
}
