/* fum: aippaci.in brand kit (projects/aippaci.in/brand/BRAND.md, projects/fum/brand/BRAND.md). Theme follows the OS. */
:root {
  --ink: #193038; --accent: #5F9A78; --badge: #FFFB85; --cta: #FFF06A;
  --muted: rgba(25,48,56,.58); --line: rgba(25,48,56,.12); --line2: rgba(25,48,56,.24);
  --paper: #FFFFFF; --soft: #F5F7F1; --card: #F7F9F3; --hover: rgba(25,48,56,.06);
  --bad: #A8432F; --warn: #8A6A12;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #FFFFFF; --muted: rgba(255,255,255,.55); --line: rgba(255,255,255,.10); --line2: rgba(255,255,255,.22);
    --paper: #0D1A1F; --soft: #081216; --card: rgba(255,255,255,.04); --hover: rgba(255,255,255,.06);
    --bad: #E08A76; --warn: #E3C766;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--soft); min-height: 100vh; display: flex; flex-direction: column;
}
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
main.wrap { flex: 1; padding-top: 40px; padding-bottom: 56px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.brand img { display: block; height: 30px; width: auto; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 14px; border-radius: 999px; }
.nav a:hover { background: var(--hover); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); min-width: 0; }
#who-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

h1 { font-size: 48px; line-height: 1.1; font-weight: 900; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 22px; font-weight: 900; margin: 32px 0 4px; }
.card h2 { margin-top: 0; }
.sub { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 46em; }
.help, .hint { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.hint { display: block; margin: 2px 0 0; font-weight: 400; }
.note { font-size: 14px; min-height: 1.5em; margin: 8px 0 0; }
.note.bad { color: var(--bad); }

.btn-primary, .btn-secondary {
  font: inherit; font-weight: 800; border-radius: 999px; padding: 11px 22px; cursor: pointer; color: var(--ink);
}
.btn-primary { background: var(--badge); border: 1px solid transparent; color: #193038; }
.btn-primary:hover { background: var(--cta); }
.btn-secondary { background: transparent; border: 1px solid var(--line2); }
.btn-secondary:hover { background: var(--hover); }
.btn-small { padding: 6px 14px; font-size: 14px; }
.btn-danger { color: var(--bad); border-color: currentColor; }
a { color: var(--accent); font-weight: 700; }
.btn-link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.signin { max-width: 560px; padding-top: 40px; }
.bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 24px; margin-bottom: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.tile .tile-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tile strong { font-size: 19px; font-weight: 900; overflow-wrap: anywhere; }

.chip { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line2); vertical-align: middle; }
.chip.good { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.chip.warn { color: var(--warn); border-color: currentColor; }

.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { white-space: normal; min-width: 5em; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.acts { text-align: right; white-space: nowrap; }
td.acts button + button { margin-left: 6px; }
tr:last-child td { border-bottom: 0; }
tr.editing td { background: var(--hover); }
.empty { background: var(--paper); border: 1px dashed var(--line2); border-radius: 18px; padding: 20px; color: var(--muted); }

.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 20px; }
.field.wide { grid-column: 1 / -1; }
label { display: block; font-weight: 700; font-size: 14px; margin-top: 8px; }
input[type=text], input[type=number], input[type=date], select, textarea {
  font: inherit; width: 100%; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line2); background: var(--paper); color: var(--ink); margin: 6px 0 4px; display: block;
}
textarea { min-height: 72px; resize: vertical; }
input[aria-invalid="true"] { border-color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-weight: 700; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

.foot { border-top: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: 14px; padding: 18px 0; }

@media (max-width: 640px) {
  h1 { font-size: 40px; }
  .wrap { padding: 0 16px; }
  main.wrap { padding-top: 28px; }
  .top-in { gap: 10px 16px; padding: 10px 0; }
  .nav { order: 3; width: 100%; gap: 2px; }
  .nav a { padding: 6px 10px; font-size: 14px; }
  .card { padding: 18px; border-radius: 18px; }
  .sub { font-size: 16px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  /* rows as cards: every cell on its own line with its column name */
  .rows thead { display: none; }
  .rows tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .rows tr:last-child { border-bottom: 0; }
  .rows td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 14px; white-space: normal; text-align: right; }
  .rows td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 700; text-align: left; }
  .rows td.acts { justify-content: flex-end; padding-top: 8px; }
  .rows td.acts::before { content: none; }
}
