/* PayGuardPro */
:root {
  --bg: #f4f6fb; --surface: #fff; --surface-2: #f8f9fc; --text: #101828; --muted: #5d6679; --border: #e3e7ef;
  --accent: #2f5fe8; --accent-hover: #244dc4; --accent-soft: #eaf0ff; --accent-text: #fff;
  --brand-1: #0b1b3a; --brand-2: #12305f; --teal: #14b8a6;
  --danger: #c4321f; --danger-soft: #fdeceb; --ok: #127a4a; --ok-soft: #e4f6ec; --warn: #9a6200; --warn-soft: #fff4dc;
  --err-bg: #fdecea; --ok-bg: #e4f6ec;
  --radius: 14px; --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c111d; --surface: #151b2b; --surface-2: #111726; --text: #e8ecf5; --muted: #98a2b8; --border: #263049;
    --accent: #7c9cff; --accent-hover: #9bb4ff; --accent-soft: #1b2645; --accent-text: #0b1530;
    --danger: #ff8f84; --danger-soft: #3a1c1a; --ok: #6fdba6; --ok-soft: #133024; --warn: #f5c062; --warn-soft: #362a12;
    --err-bg: #3a1c1a; --ok-bg: #133024;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 15.5px/1.55 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-size: .9em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; }

/* Header */
header { background: linear-gradient(100deg, var(--brand-1), var(--brand-2)); color: #fff; position: sticky; top: 0; z-index: 10; }
header .bar { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand .pro { color: #7dd3c8; }
.context { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #dbe4ff; white-space: nowrap; }
header nav { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
header nav a, header nav button.link {
  color: #c9d4ee; padding: 7px 11px; border-radius: 8px; font-size: .92rem; font-weight: 500; text-decoration: none;
}
header nav a:hover, header nav button.link:hover { color: #fff; background: rgba(255, 255, 255, .1); text-decoration: none; }
header nav a.active { color: #fff; background: rgba(255, 255, 255, .16); }
header nav .sep { width: 1px; height: 20px; background: rgba(255, 255, 255, .2); margin: 0 6px; }

main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 16px 56px; flex: 1; }
footer { color: var(--muted); font-size: .82rem; text-align: center; padding: 18px 16px 26px; }
footer img { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

h1 { font-size: 1.6rem; line-height: 1.25; letter-spacing: -.02em; margin: 0 0 18px; }
h2 { font-size: 1.08rem; letter-spacing: -.01em; margin: 30px 0 12px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 30px 0 12px; }
.section-head h2 { margin: 0; }
.section-head .btn { padding: 6px 12px; font-size: .86rem; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card > h1:first-child { margin-top: 0; }
.narrow { max-width: 440px; margin: 48px auto; }
.muted { color: var(--muted); }
.notice { background: var(--accent-soft); border: 1px solid transparent; border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); }
.table-wrap > table { border: 0; }
td { overflow-wrap: anywhere; }
td:last-child { white-space: nowrap; overflow-wrap: normal; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: var(--surface-2); }
tr.inactive td { color: var(--muted); }
tr.inactive td:not(:last-child) { opacity: .6; }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.off { color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.bad { color: var(--danger); background: var(--danger-soft); }

/* Buttons */
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: .93rem; font-weight: 600;
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover, button:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 1px; }
button:disabled { opacity: .55; cursor: default; }
.btn.secondary, button.secondary { background: var(--surface); color: var(--accent); border-color: var(--border); }
.btn.secondary:hover, button.secondary:hover { background: var(--accent-soft); border-color: var(--accent); }
button.danger, .btn.danger { background: var(--surface); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); color: var(--danger); }
button.danger:hover, .btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
a.danger { color: var(--danger); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: inherit; }
button.link:hover { background: none; text-decoration: underline; }
td .btn, td button { padding: 5px 12px; font-size: .85rem; }

/* Forms */
form p { margin: 0 0 16px; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input, select, textarea {
  font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=file] { padding: 18px; border-style: dashed; background: var(--surface-2); cursor: pointer; }
.inline { display: inline; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.filters > * { flex: 1 1 160px; }
.filters > .actions { flex: 0 0 auto; }
.filters label { font-size: .8rem; color: var(--muted); }
.helptext { display: block; color: var(--muted); font-size: .84rem; margin-top: 4px; font-weight: 400; }
.errorlist { color: var(--danger); margin: 4px 0 10px; padding-left: 18px; font-size: .9rem; }

/* Flash messages */
.messages { list-style: none; padding: 0; margin: 0 0 18px; }
.messages li { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; background: var(--ok-soft); color: var(--ok); font-weight: 500; border: 1px solid color-mix(in srgb, var(--ok) 20%, transparent); }
.messages li.error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 20%, transparent); }

/* Sign-in and other single-card pages */
body.auth { background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent), var(--bg); }
body.auth header { background: transparent; position: static; }
body.auth header .brand { color: var(--text); }
body.auth header .brand .pro { color: var(--teal); }
body.auth header .context { background: var(--accent-soft); color: var(--accent); }
body.auth .narrow { margin-top: 24px; }
.auth-mark { display: block; width: 48px; height: 48px; margin: 0 auto 14px; }
.auth-card { text-align: left; }
.auth-card h1 { text-align: center; font-size: 1.4rem; }
.auth-card .sub { text-align: center; margin: -8px 0 22px; }
.auth-card button[type=submit] { width: 100%; padding: 11px; }

/* Landing */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; padding: 32px 0 24px; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -.03em; margin-bottom: 14px; }
.hero h1 span { background: linear-gradient(90deg, var(--accent), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 34rem; }
.features { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.features li { display: flex; gap: 10px; align-items: flex-start; }
.features svg { flex: 0 0 20px; width: 20px; height: 20px; color: var(--teal); margin-top: 2px; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 8px; } }

/* Employee documents */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.doc { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.doc .top { display: flex; gap: 12px; align-items: center; }
.doc .icon { flex: 0 0 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.doc .icon.w2 { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal); }
.doc .icon svg { width: 20px; height: 20px; }
.doc .title { font-weight: 600; }
.doc .actions { margin-top: auto; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
