/* UNIL USA eApproval — self-contained styles, no external fonts or CDNs. */

:root {
    --ink: #131722;
    --ink-2: #4a5261;
    --ink-3: #7b8494;
    --line: #e3e7ee;
    --line-2: #eef1f6;
    --bg: #f6f8fb;
    --card: #ffffff;
    --brand: #1a56db;
    --brand-dark: #1442ad;
    --brand-soft: #eef3ff;
    --ok: #0b7a3b;
    --ok-soft: #e9f7ef;
    --warn: #9a6700;
    --warn-soft: #fff8e6;
    --bad: #b42318;
    --bad-soft: #fdeceb;
    --radius: 9px;
    --shadow: 0 1px 2px rgba(19, 23, 34, .06), 0 4px 14px rgba(19, 23, 34, .05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- chrome */

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 58px;
    display: flex;
    align-items: center;
    gap: 26px;
}

.brand {
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .09em;
    color: var(--brand);
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--ink-3); font-weight: 600; }

.nav { display: flex; gap: 4px; flex: 1; }

.nav a {
    padding: 7px 13px;
    border-radius: 7px;
    color: var(--ink-2);
    font-weight: 500;
    white-space: nowrap;
}
.nav a:hover { background: var(--line-2); text-decoration: none; }
.nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.nav .count {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 9px;
    background: var(--bad);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    line-height: 18px;
}

.who { text-align: right; font-size: 12px; color: var(--ink-3); line-height: 1.35; white-space: nowrap; }
.who b { display: block; color: var(--ink); font-size: 13px; font-weight: 600; }

/* ---------------------------------------------------------------- layout */

.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 24px 72px; }
.wrap.narrow { max-width: 760px; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

h1 { font-size: 21px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.sub { color: var(--ink-3); font-size: 13px; margin: 5px 0 0; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 18px;
}
.card.tight { padding: 0; overflow: hidden; }
.card h2 { padding: 0; }
.card.tight h2 { padding: 18px 22px 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- forms */

.field { margin-bottom: 16px; }
.field.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .field.row2 { grid-template-columns: 1fr; } }

label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
label .req { color: var(--bad); margin-left: 2px; }
label .hint { font-weight: 400; color: var(--ink-3); margin-left: 6px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=file], select, textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}
textarea { min-height: 110px; resize: vertical; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, .12);
}

input[readonly], input:disabled, select:disabled { background: var(--line-2); color: var(--ink-3); }

.money { display: grid; grid-template-columns: 96px 1fr; gap: 8px; }

.actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.actions.tight { margin-top: 14px; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { background: var(--line-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { filter: brightness(.93); }
.btn.danger { background: #fff; border-color: #f0c2bd; color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- tables */

table.list { width: 100%; border-collapse: collapse; }

table.list th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
    white-space: nowrap;
}

table.list td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: #fbfcfe; }
table.list td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.list td.tight { white-space: nowrap; color: var(--ink-2); }

.docno { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; color: var(--ink-2); }

.empty { padding: 46px 20px; text-align: center; color: var(--ink-3); }
.empty p { margin: 0 0 14px; }

/* ---------------------------------------------------------------- badges */

.pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.pill.draft { background: var(--line-2); color: var(--ink-2); }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.approved { background: var(--ok-soft); color: var(--ok); }
.pill.rejected { background: var(--bad-soft); color: var(--bad); }
.pill.cancelled { background: var(--line-2); color: var(--ink-3); }
.pill.form { background: var(--brand-soft); color: var(--brand); }

/* ---------------------------------------------------------------- messages */

.msg { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 13.5px; }
.msg.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #bfe5cf; }
.msg.bad { background: var(--bad-soft); color: var(--bad); border: 1px solid #f5c9c5; }
.msg.info { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #ccdcff; }
.msg.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f0dfae; }
.msg ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------------------------------------------------------------- document detail */

.doc-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line-2);
    margin-bottom: 18px;
    flex-wrap: wrap;
}

dl.kv { display: grid; grid-template-columns: 168px 1fr; gap: 0; margin: 0; }
dl.kv dt {
    color: var(--ink-3);
    font-size: 12.5px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-2);
}
dl.kv dd {
    margin: 0;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-2);
    font-size: 13.5px;
}
dl.kv dt:last-of-type, dl.kv dd:last-of-type { border-bottom: 0; }
@media (max-width: 640px) {
    dl.kv { grid-template-columns: 1fr; }
    dl.kv dt { padding-bottom: 0; border-bottom: 0; }
}

.amount-big { font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.body-text { white-space: pre-wrap; line-height: 1.65; margin: 0; }

/* approval line */

.line { list-style: none; margin: 0; padding: 0; }

.line li {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-2);
    align-items: flex-start;
}
.line li:last-child { border-bottom: 0; }

.line .dot {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 26px;
    background: var(--line-2);
    color: var(--ink-3);
}
.line .dot.approved { background: var(--ok-soft); color: var(--ok); }
.line .dot.rejected { background: var(--bad-soft); color: var(--bad); }
.line .dot.current { background: var(--brand); color: #fff; }

.line .meta { flex: 1; min-width: 0; }
.line .meta b { font-weight: 600; }
.line .meta .when { color: var(--ink-3); font-size: 12px; }
.line .meta .note {
    margin-top: 6px;
    padding: 8px 11px;
    background: var(--line-2);
    border-radius: 6px;
    font-size: 12.5px;
    color: var(--ink-2);
    white-space: pre-wrap;
}

.files { list-style: none; margin: 0; padding: 0; }
.files li { padding: 9px 0; border-bottom: 1px solid var(--line-2); display: flex; gap: 10px; align-items: center; }
.files li:last-child { border-bottom: 0; }
.files .size { color: var(--ink-3); font-size: 12px; margin-left: auto; white-space: nowrap; }

/* ---------------------------------------------------------------- sign-in */

.signin { max-width: 380px; margin: 8vh auto; }
.signin .card { padding: 30px; }
.signin .brand { font-size: 15px; text-align: center; display: block; margin-bottom: 4px; }
.signin .tag { text-align: center; color: var(--ink-3); font-size: 12.5px; margin: 0 0 24px; }

/* ---------------------------------------------------------------- print */

@media print {
    .topbar, .actions, .no-print { display: none !important; }
    body { background: #fff; font-size: 11.5px; }
    .wrap { max-width: none; padding: 0; }
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
        margin-bottom: 12px;
        padding: 16px;
    }
    a { color: #000; text-decoration: none; }
    .pill { border: 1px solid #999; }
}
