/* Basil Portal: phone first; a bottom tab bar on phones, tabs in the header on wider screens. */
:root {
  --ink: #1d2330; --quiet: #5b6475; --line: #dde1e8; --bg: #f5f6f8; --card: #fff;
  --brand: #1f4e78; --brand-2: #2d6aa3; --ok: #1b7a3d; --ok-bg: #e5f4ea; --warn: #8a5a00; --warn-bg: #fff4d6;
  --err: #a42020; --err-bg: #fde7e7; --wait: #6b3fa0; --wait-bg: #efe7fa;
  --tabbar: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e9ef; --quiet: #a3abba; --line: #2e3542; --bg: #12161d; --card: #1a1f28;
    --brand: #1f4e78; --brand-2: #7fb3e6; --ok: #6fd08f; --ok-bg: #173323; --warn: #f0c45a; --warn-bg: #352a10;
    --err: #ff8b8b; --err-bg: #3a1a1a; --wait: #c6a6f0; --wait-bg: #2a2040;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg);
       -webkit-text-size-adjust: 100%; }
a { color: var(--brand-2); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
.card h2 { margin-top: 0; }
p.lead { color: var(--quiet); margin: 0 0 1.2rem; }
.muted { color: var(--quiet); }
.small, small { font-size: .85rem; }
.big { font-size: 1.35rem; font-weight: 700; margin: 0; }
.err-text { color: var(--err); }

header.top { background: var(--brand); color: #fff; padding-top: env(safe-area-inset-top); }
header.top .bar { max-width: 960px; margin: 0 auto; padding: .6rem 1rem; display: flex; gap: 1rem; align-items: center; }
header.top a { color: #fff; text-decoration: none; }
.brand { display: flex; gap: .6rem; align-items: center; font-weight: 700; line-height: 1.15; }
.brand img { border-radius: 7px; box-shadow: 0 0 0 1px rgba(255,255,255,.45); }
.brand small { display: block; font-weight: 400; font-size: .78rem; opacity: .85; }
header .out { margin: 0 0 0 auto; }
header button.link { color: #fff; }

nav.tabs { display: flex; gap: .3rem; margin-left: auto; }
nav.tabs a { padding: .35rem .75rem; border-radius: 6px; background: rgba(255,255,255,.12); font-size: .92rem; }
nav.tabs a.on { background: #fff; color: var(--brand); font-weight: 600; }
nav.tabs .ic { display: none; }
@media (max-width: 720px) {
  body.signed-in main { padding-bottom: calc(var(--tabbar) + 2rem + env(safe-area-inset-bottom)); }
  body.signed-in footer { padding-bottom: calc(var(--tabbar) + 1rem + env(safe-area-inset-bottom)); }
  nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; margin: 0; gap: 0; background: var(--card);
             border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  nav.tabs a { flex: 1; border-radius: 0; background: none; color: var(--quiet); text-align: center; font-size: .75rem;
               height: var(--tabbar); display: flex; flex-direction: column; align-items: center; justify-content: center; }
  nav.tabs a.on { background: none; color: var(--brand-2); }
  nav.tabs .ic { display: block; font-size: 1.3rem; line-height: 1.2; }
  .brand small { display: none; }
}

main { max-width: 960px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
footer { max-width: 960px; margin: 0 auto; padding: 1rem; color: var(--quiet); font-size: .8rem; text-align: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.cards .card { margin-bottom: 0; }
.auth { max-width: 440px; margin: 1.5rem auto; }
ul.tight { margin: .3rem 0; padding-left: 1.2rem; }
ul.tight li { margin: .3rem 0; }

.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; }
.flash.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.flash.error { background: var(--err-bg); border-color: transparent; color: var(--err); }
.notice { padding: .75rem 1rem; border-radius: 10px; background: var(--warn-bg); color: var(--warn); margin-bottom: 1rem; }

/* tappable lists: payslips, documents, requests */
ul.rows { list-style: none; margin: 0 0 1rem; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
ul.rows li { border-bottom: 1px solid var(--line); }
ul.rows li:last-child { border-bottom: 0; }
ul.rows a, ul.rows.plain li { display: flex; gap: 1rem; align-items: center; padding: .85rem 1rem; color: var(--ink); text-decoration: none; min-height: 56px; }
ul.rows a:hover { background: var(--bg); }
ul.rows span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
ul.rows small { display: block; color: var(--quiet); }
ul.rows .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
ul.rows .go { color: var(--brand-2); white-space: nowrap; font-size: .9rem; }
ul.rows form { margin: 0; }

dl.details { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: .45rem 1rem; margin: 0 0 .8rem; }
dl.details dt { color: var(--quiet); font-size: .9rem; }
dl.details dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { dl.details { grid-template-columns: 1fr; gap: 0; } dl.details dd { margin-bottom: .55rem; } }

.badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge.pending { background: var(--wait-bg); color: var(--wait); }
.badge.accepted { background: var(--ok-bg); color: var(--ok); }
.badge.rejected { background: var(--err-bg); color: var(--err); }
.badge.withdrawn { background: var(--bg); color: var(--quiet); border: 1px solid var(--line); }

/* forms: big touch targets, 16px text so iPhones don't zoom in */
form.stack label { display: block; font-weight: 600; font-size: .9rem; margin: .9rem 0 .3rem; }
.hint { color: var(--quiet); font-size: .82rem; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=file], select {
  width: 100%; font: inherit; font-size: 16px; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); color: var(--ink); min-height: 46px; }
input:focus, select:focus { outline: 2px solid var(--brand-2); outline-offset: 1px; }
input.code { font-size: 1.6rem; letter-spacing: .4rem; text-align: center; font-variant-numeric: tabular-nums; }
label.check { display: flex !important; gap: .6rem; align-items: flex-start; font-weight: 400 !important; }
label.check input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: none; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-top: 1.1rem; }
.btn, button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .55rem 1.1rem;
  border-radius: 9px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; }
button.wide { width: 100%; }
button.secondary { background: var(--card); color: var(--brand-2); border-color: var(--brand-2); }
button.danger { background: var(--card); color: var(--err); border-color: var(--err); }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--brand-2); font-weight: 400; text-decoration: underline; }
button:disabled { opacity: .6; cursor: default; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 4.2rem; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); min-height: 34px; padding: .2rem .6rem;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); font-size: .8rem; font-weight: 500; }
[hidden] { display: none !important; }
