/* Eliaspresso payroll — brand palette sampled from the master wordmark
   graphic: espresso dark #2B221D, roast brown #634932, warm ink #4A342A,
   cream paper #F6F1E9. Clean-brand system: white/cream surfaces, brown
   type, generous whitespace, steam-script logo on dark. */

/* Self-hosted brand fonts (variable weight). Baloo 2: rounded display for
   headings/nav/buttons; Nunito: warm humanist sans for everything else. */
@font-face {
  font-family: "Baloo 2";
  src: url("fonts/Baloo2.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --display: "Baloo 2", "Trebuchet MS", sans-serif;
  --body: "Nunito", -apple-system, "Segoe UI", sans-serif;
  --espresso: #2b221d;
  --espresso-2: #3a2d24;
  --roast: #634932;
  --ink: #37281f;
  --muted: #8a715c;
  --line: #e7dccb;
  --bg: #f6f1e9;
  --card: #fffdf9;
  --accent: #634932;
  --accent-soft: #efe5d6;
  --danger: #a03422;
  --ok: #3d5b3a;
  --ok-soft: #e6efe3;
  --warn-bg: #fdf3dd;
  --warn-line: #dfc08b;
  --shadow: 0 1px 2px rgba(43, 34, 29, .06), 0 8px 24px -12px rgba(43, 34, 29, .25);
}

* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font: 500 15px/1.55 var(--body);
}
main { max-width: 1100px; margin: 2rem auto 4rem; padding: 0 1.25rem; }
h1 { font-family: var(--display); font-weight: 700; font-size: 1.75rem;
     letter-spacing: -.01em; color: var(--espresso); }
h2 { font-family: var(--display); font-size: 1.08rem; margin-top: 0;
     color: var(--roast); letter-spacing: .02em; font-weight: 700; }
h3 { font-family: var(--display); font-size: 1rem; margin: 1.1rem 0 .4rem; color: var(--roast); }
a { color: var(--roast); }

/* Top navigation — espresso dark with the script wordmark */
.topnav {
  display: flex; align-items: center; gap: 1.35rem;
  background: var(--espresso); padding: .7rem 1.5rem;
  box-shadow: 0 2px 12px rgba(43, 34, 29, .35);
}
.topnav .brand { display: flex; align-items: center; margin-right: .75rem; }
.topnav .brand img { height: 40px; display: block; }
.topnav .brand .word {
  font-family: var(--display); font-weight: 600;
  color: #d9c6ae; font-size: .8rem; letter-spacing: .3em;
  text-transform: uppercase; margin-left: .8rem; padding-left: .9rem;
  border-left: 1px solid rgba(217, 198, 174, .35);
}
.topnav a {
  font-family: var(--display); font-weight: 600;
  text-decoration: none; color: #ecdfcd; font-size: .98rem;
  padding: .38rem .85rem; border-radius: 99px;
  transition: background .15s, color .15s, transform .1s;
}
.topnav a:hover { color: #fff; background: rgba(255, 251, 244, .12); transform: translateY(-1px); }
.navlinks { display: contents; }  /* desktop: links flow in the nav row */
.topnav .logout { margin-left: auto; }
.topnav .logout button { color: #c9b394; border: 1px solid rgba(201, 179, 148, .4);
  background: none; border-radius: 99px; padding: .3rem .9rem; font-size: .88rem; }
.topnav .logout button:hover { color: #fff; border-color: #fff; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.4rem 1.5rem; margin-bottom: 1.4rem; box-shadow: var(--shadow);
}

.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.05rem 1.2rem .95rem; color: var(--muted); box-shadow: var(--shadow);
  border-top: 3px solid var(--roast); font-size: .85rem;
}
.tile .big { display: block; font-family: var(--display); font-size: 1.75rem;
  font-weight: 700; color: var(--espresso);
  letter-spacing: -.01em; margin-bottom: .1rem; font-variant-numeric: tabular-nums; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-family: var(--display); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
td { font-variant-numeric: tabular-nums; }
tr.totals td { font-weight: 700; border-top: 2px solid var(--roast); color: var(--espresso); }
tr.inactive td { color: var(--muted); }
tbody tr:hover td, table tr:hover td { background: rgba(99, 73, 50, .035); }
.register td, .register th { white-space: nowrap; font-size: .85rem; }
.scroll-x { overflow-x: auto; }

label { display: block; margin-bottom: .65rem; font-size: .9rem; color: var(--ink); }
input, select {
  display: block; width: 100%; margin-top: .2rem; padding: .5rem .65rem;
  border: 1px solid var(--line); border-radius: 9px; font: inherit;
  background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--roast);
  box-shadow: 0 0 0 3px rgba(99, 73, 50, .15); }
input.mini { width: 6.5rem; display: inline-block; }
.checkline { display: flex; gap: .5rem; align-items: center; }
.checkline input { width: auto; display: inline; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }

button, .button {
  display: inline-block; padding: .5rem 1.05rem; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--roast);
  font: 600 .95rem/1.5 var(--display); text-decoration: none;
  transition: transform .1s, box-shadow .15s, background .15s;
}
button:hover, .button:hover { box-shadow: 0 3px 10px -4px rgba(43, 34, 29, .4); transform: translateY(-1px); }
button.primary, .button.primary {
  background: linear-gradient(160deg, var(--roast), #4a3423);
  border-color: transparent; color: #fdf8f0;
}
button.danger, .button.danger { color: var(--danger); border-color: rgba(160, 52, 34, .45); background: #fff; }
button.linklike { border: none; background: none; padding: 0; color: var(--roast); text-decoration: underline; box-shadow: none; }
button.linklike:hover { transform: none; box-shadow: none; }
button.linklike.danger { color: var(--danger); }
.actions { display: flex; gap: .65rem; margin: 1.1rem 0; flex-wrap: wrap; }
.inline-form { display: flex; gap: .65rem; align-items: end; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }

.flash {
  background: var(--accent-soft); border: 1px solid #d8c3a5; color: var(--ink);
  border-radius: 10px; padding: .6rem .9rem; margin-bottom: .8rem;
}
.warning { background: var(--warn-bg); border: 1px solid var(--warn-line);
  border-radius: 10px; padding: .65rem 1rem; margin-bottom: 1.1rem; }
.hint { color: var(--muted); font-size: .85rem; }
code { background: var(--accent-soft); border-radius: 5px; padding: .05rem .35rem; }

.badge { font-size: .72rem; padding: .12rem .6rem; border-radius: 99px;
  border: 1px solid var(--line); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.badge.draft { background: var(--warn-bg); border-color: var(--warn-line); color: #7a5a1e; }
.badge.finalized { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.duties li { margin-bottom: .45rem; }
.actions-cell { white-space: nowrap; }
.actions-cell form { display: inline; }
.inline-details { display: inline-block; }
.inline-details summary { cursor: pointer; color: var(--roast); font-size: .85rem; }
.inline-details form { margin-top: .4rem; }
.totp-secret { font-size: 1.05rem; letter-spacing: .12em; word-break: break-all; }

/* Auth pages (login / setup / 2FA) — dark espresso, logo overhead */
body.auth { background: radial-gradient(120% 90% at 50% -10%, #4a382b 0%, var(--espresso) 55%); min-height: 100vh; }
body.auth main { max-width: 460px; margin-top: 4.5rem; }
.auth-logo { display: block; margin: 0 auto 2rem; width: min(320px, 80%); }
body.auth .card { border: none; box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .6); }
body.auth .flash { box-shadow: var(--shadow); }
.auth-foot { text-align: center; color: #a98f74; font-size: .78rem; margin-top: 1.4rem;
  letter-spacing: .3em; text-transform: uppercase; }

/* Pay stubs — printable, with the dark wordmark */
.stub { background: #fff; border: 1px solid var(--espresso); border-radius: 8px;
  padding: 1.2rem 1.4rem; margin-bottom: 1.3rem; page-break-inside: avoid; }
.stub-brand { height: 34px; margin-bottom: .8rem; }
.stub-head { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; margin-bottom: .9rem; flex-wrap: wrap; }
.stub-cols { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 1rem; }
@media (max-width: 800px) { .stub-cols { grid-template-columns: 1fr; } }
.stub table td, .stub table th { font-size: .82rem; padding: .28rem .4rem; }
.stub table tr:hover td { background: none; }
.stub-net { display: flex; justify-content: space-between; margin-top: 1rem; align-items: center;
  background: var(--bg); border-radius: 8px; padding: .5rem .9rem; }
.stub-net .net { font-size: 1.2rem; font-weight: 750; color: var(--espresso); }

/* ---- Mobile ---- */
@media (max-width: 920px) {
  /* Nav becomes two rows: brand + logout, then a swipeable link row */
  .topnav { flex-wrap: wrap; gap: .3rem .5rem; padding: .55rem .8rem .5rem; }
  .topnav .brand { margin-right: auto; }
  .topnav .brand img { height: 32px; }
  .topnav .brand .word { display: none; }
  .topnav .logout { margin-left: 0; }
  .navlinks {
    display: flex; order: 3; width: 100%; gap: .15rem;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; margin-top: .25rem;
  }
  .navlinks::-webkit-scrollbar { display: none; }
  .navlinks a { flex: 0 0 auto; font-size: .92rem; padding: .3rem .7rem; }
}

@media (max-width: 700px) {
  main { margin-top: 1.1rem; padding: 0 .8rem; }
  h1 { font-size: 1.4rem; }
  .card { padding: 1rem .95rem; overflow-x: auto; }  /* wide tables swipe */
  .tiles { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .tile { padding: .85rem .95rem .75rem; }
  .tile .big { font-size: 1.35rem; }
  input, select { font-size: 16px; }  /* stops iOS focus-zoom */
  input.mini { width: 5.2rem; }
  .pagehead { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .stub-net { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .stub-head { flex-direction: column; gap: .5rem; }
  .inline-form { align-items: stretch; }
  .inline-form input, .inline-form select { width: 100%; }
  body.auth main { margin-top: 2.5rem; }
  .auth-logo { width: min(240px, 70%); margin-bottom: 1.4rem; }
}

@media print {
  .no-print, .topnav, .flashes { display: none !important; }
  body { background: #fff; }
  main { max-width: none; margin: 0; }
  .stub { border-radius: 0; margin-bottom: .5rem; box-shadow: none; }
  .stub-net { background: none; border-top: 2px solid #000; border-radius: 0; }
}
