/* All My Friends Books — consignor portal
 *
 * One stylesheet, no build step, no framework. The whole site is five pages of
 * tables and two forms, and a toolchain would be more moving parts than markup.
 *
 * Palette and fonts are lifted from allmyfriendsbooks.com so an author arriving
 * from an email recognises where they are: teal header, olive text, warm cream
 * page. Wingman is the brand display face and is used only for headings and
 * chrome, never for prose or for anything a person types into — it is all-caps
 * and unreadable at body size.
 */

@font-face {
    font-family: "Wingman";
    src: url("../fonts/TAYWingman.otf") format("opentype");
    font-display: swap;
}
@font-face {
    font-family: "DM Sans";
    src: url("../fonts/DMSans.ttf") format("truetype");
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "DM Sans";
    src: url("../fonts/DMSans-Italic.ttf") format("truetype");
    font-style: italic;
    font-display: swap;
}

:root {
    --teal:    #84cdc0;
    --olive:   #4e5630;
    --cream:   #fef4f0;
    --ink:     #211d1d;
    --muted:   #7b7768;
    --line:    #e2dcd4;
    --card:    #ffffff;
    --good:    #2f6f4f;
    --warn:    #8a5a1a;
    --bad:     #9b2c2c;
    --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: Wingman, var(--font-body);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

/* Form controls do NOT inherit font-family, and `font: inherit` on this site
   reaches past the browser default to the display face — which renders everything
   a person types in all-caps Wingman. Name the body font explicitly. This exact
   bug shipped to the public site once. */
input, select, textarea, button {
    font-family: var(--font-body);
    font-size: 1rem;
}

a { color: var(--olive); }
a:hover { color: var(--ink); }

/* ── Chrome ──────────────────────────────────────────────────────────────── */

.masthead {
    background: var(--teal);
    border-bottom: 1px solid rgba(0,0,0,.08);
}
.masthead-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: .9rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.brand {
    font-family: var(--font-display);
    font-size: 1.25rem;
    letter-spacing: .02em;
    color: var(--olive);
    text-decoration: none;
}
.brand span { display: block; font-family: var(--font-body); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #37502f; }
.whoami { font-size: .88rem; color: #37502f; }
.whoami a { color: #37502f; }

.tabs {
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.tabs-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    gap: .25rem;
    overflow-x: auto;
}
.tabs a {
    padding: .8rem .9rem;
    text-decoration: none;
    color: var(--muted);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    font-size: .95rem;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--olive); border-bottom-color: var(--olive); font-weight: 600; }

main { max-width: 960px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

h1 { font-family: var(--font-display); font-size: 1.6rem; margin: 0 0 .35rem; color: var(--olive); letter-spacing: .01em; }
h2 { font-size: 1.05rem; margin: 2rem 0 .6rem; color: var(--olive); }
h2:first-of-type { margin-top: 1rem; }
.lede { color: var(--muted); margin: 0 0 1.5rem; }

.site-foot {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2.5rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .85rem;
}

/* ── Cards and figures ───────────────────────────────────────────────────── */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .9rem;
}
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.1rem;
}
.card .label { font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.card .figure { font-size: 1.85rem; font-weight: 600; color: var(--olive); line-height: 1.2; margin-top: .2rem; }
.card .sub { font-size: .82rem; color: var(--muted); margin-top: .15rem; }
.card.headline { border-color: var(--olive); border-width: 2px; }

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.1rem 1.2rem;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
/* Wide tables scroll inside their own box. The page body must never scroll
   sideways — on a phone that makes every other column unreachable. */

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; min-width: 520px; }
th, td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .92rem; }
th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.title-cell { font-weight: 500; }
.title-cell small { display: block; font-weight: 400; color: var(--muted); }

.pill { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .74rem; letter-spacing: .03em; }
.pill.paid    { background: #e6f1ea; color: var(--good); }
.pill.unpaid  { background: #f6ecda; color: var(--warn); }
.pill.new     { background: #e4eef6; color: #1f5578; }
.pill.ack     { background: #f6ecda; color: var(--warn); }
.pill.declined{ background: #f6e4e4; color: var(--bad); }

.empty { padding: 2rem 1.2rem; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 10px; }

/* ── Forms and buttons ───────────────────────────────────────────────────── */

label { display: block; font-weight: 600; font-size: .9rem; margin-top: 1rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
    display: block;
    width: 100%;
    margin-top: .3rem;
    padding: .55rem .65rem;
    border: 1px solid #cfc9c0;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px rgba(78,86,48,.18); }
textarea { min-height: 5rem; resize: vertical; }

.btn {
    display: inline-block;
    margin-top: 1.25rem;
    padding: .6rem 1.1rem;
    border: 0;
    border-radius: 6px;
    background: var(--olive);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: #3b421f; color: #fff; }
.btn[disabled] { background: #b6b3a4; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--olive); border: 1px solid var(--olive); }
.btn.secondary:hover { background: rgba(78,86,48,.08); color: var(--olive); }

.note { padding: .7rem .9rem; border-radius: 6px; font-size: .92rem; margin: 0 0 1.1rem; }
.note.error   { background: #f8e6e6; color: #7a2020; border: 1px solid #e2b7b7; }
.note.ok      { background: #e6f1ea; color: #1f5136; border: 1px solid #b6d6c3; }
.note.info    { background: #e4eef6; color: #1f4d6b; border: 1px solid #b6cddc; }

/* ── The signed-out pages ────────────────────────────────────────────────── */

.auth-wrap { max-width: 420px; margin: 3rem auto; padding: 0 1.25rem; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.75rem 1.6rem; }
.auth-wrap h1 { text-align: center; }
.auth-wrap .lede { text-align: center; }
.auth-links { margin-top: 1.25rem; font-size: .88rem; text-align: center; color: var(--muted); }

@media (max-width: 560px) {
    .masthead-inner { padding: .75rem 1rem; }
    main { padding: 1.1rem 1rem 2.5rem; }
    .card .figure { font-size: 1.6rem; }
}
