/* The client portal's look: Slate, warmer and simpler (Ken, 2026-11-05).
 * Approved mockup: https://claude.ai/artifact/AQMLDUiCMFGeZBmRrnZfkM
 *
 * Loaded AFTER ledger.css on client pages. It re-points the Ledger tokens the
 * templates already use (ink, paper, line, accent...) at warm Slate values, so
 * every screen changes at once, and adds the few pieces the new layout needs.
 * Clients read on phones: bigger type (17px root) and 44px touch targets.
 * Semantic status colours stay Slate's: red = problem, yellow ink = due /
 * needs attention, green = done.
 */

:root {
  /* Warm Slate ground and ink */
  --color-ink: #1f1b16;
  --color-paper: #f7f5f1;         /* page ground */
  --color-paper-2: #ffffff;       /* cards, header */
  --color-paper-3: #efeae3;       /* hover, quiet fills */
  --color-muted: #5c554c;         /* secondary text, 6.8:1 on the ground */
  --color-muted-2: #6b645a;       /* small supplementary text, AA on white */
  --color-line: #e5e0d8;          /* hairlines */
  --color-line-strong: #cfc8bd;   /* input and button borders */

  /* Portal accent (Slate §9 --app-portal) */
  --app-portal: #0369a1;
  --accent: var(--app-portal);
  --accent-hover: #075985;
  --accent-soft: #e8f1f7;

  /* Status (Slate semantics) */
  --ok-bg: #dcfce7;   --ok-ink: #166534;
  --due-bg: #fef3c7;  --due-ink: #854d0e;
  --bad-bg: #fee2e2;  --bad-ink: #991b1b;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-serif: var(--font-sans);
  --radius: 10px;
  --radius-lg: 14px;
  --focus-ring: color-mix(in srgb, var(--accent) 30%, transparent);
  --border-emphasis: var(--color-line-strong);
  --surface-toolbar: #faf8f5;
  --color-selection-bg: #cfe3f1;
}

html { font-size: 17px; }
body {
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .font-serif { font-family: var(--font-sans); font-weight: 600; letter-spacing: -0.01em; }
main h1, main h2, main h3 { font-weight: 600; }   /* beats Tailwind's reset (font-weight: inherit) */
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
/* Tailwind's reset (injected later) sets a{color:inherit}; links in the page body
   must still read as links, so win on specificity. Buttons and folders opt out. */
main a:not(.tp-btn):not(.tp-btn-secondary):not(.tp-btn-icon):not(.tp-folder):not(.tp-card):not([class*="bg-"]):not([class*="text-"]) { color: var(--accent); }
main a:not(.tp-btn):not(.tp-btn-secondary):not(.tp-btn-icon):not(.tp-folder):not(.tp-card):not([class*="bg-"]):not([class*="text-"]):hover { color: var(--accent-hover); text-decoration: underline; }
@media (max-width: 640px) { .tp-nav a { padding: 0 10px; } }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

/* Radii: friendlier than Ledger's 4px. */
.rounded, .rounded-md { border-radius: var(--radius) !important; }
.rounded-lg, .rounded-xl, .rounded-2xl { border-radius: var(--radius-lg) !important; }
.shadow-sm { box-shadow: none !important; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.tp-header { background: #fff; border-bottom: 1px solid var(--color-line); }
.tp-header-inner {
  max-width: 1120px; margin: 0 auto; padding: 10px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px;
}
.tp-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-ink); }
.tp-brand:hover { color: var(--color-ink); }
.tp-brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.tp-brand-name strong { font-size: 1rem; font-weight: 700; }
.tp-brand-name span { font-size: 0.75rem; color: var(--color-muted); }
.tp-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.tp-nav a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 8px; color: #3d372f; font-size: 0.9rem; font-weight: 500; text-decoration: none;
}
.tp-nav a:hover { background: var(--color-paper-3); color: var(--color-ink); }
.tp-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tp-badge {
  min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.tp-account { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 0.85rem; }
.tp-account select {
  min-height: 40px; padding: 0 10px; border: 1px solid var(--color-line-strong); border-radius: 8px;
  background: #fff; font: inherit; color: var(--color-ink);
}

/* ── Page bits ──────────────────────────────────────────────────────────── */
.tp-main { max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; }
.tp-h1 { margin: 0 0 4px; font-size: 1.65rem; font-weight: 600; letter-spacing: -0.01em; }
.tp-lede { margin: 0; color: var(--color-muted); }
.tp-card { background: #fff; border: 1px solid var(--color-line); border-radius: var(--radius-lg); padding: 24px; }
.tp-card-title { margin: 0 0 12px; font-size: 1.05rem; font-weight: 600; }
.tp-label-muted { margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--color-muted); }
.tp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 14px 0; border-top: 1px solid #efeae3; }
.tp-row:first-child { border-top: 0; }
.tp-row-main { flex: 1 1 280px; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.tp-meta { font-size: 0.85rem; color: var(--color-muted); }
.tp-new { font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.tp-stack { display: flex; flex-direction: column; gap: 24px; }
.tp-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.tp-pill-ok { background: var(--ok-bg); color: var(--ok-ink); }
.tp-pill-due { background: var(--due-bg); color: var(--due-ink); }
.tp-pill-bad { background: var(--bad-bg); color: var(--bad-ink); }

/* ── Buttons and fields ─────────────────────────────────────────────────── */
.tp-btn, .tp-btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: var(--radius);
  font: inherit; font-size: 0.95rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.tp-btn { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.tp-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.tp-btn-secondary { background: #fff; color: var(--color-ink); border: 1px solid var(--color-line-strong); }
.tp-btn-secondary:hover { background: var(--color-paper-3); color: var(--color-ink); }
.tp-btn-icon {
  width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--color-line); background: #fff;
  color: #3d372f; display: inline-flex; align-items: center; justify-content: center;
}
.tp-btn-icon:hover { background: var(--color-paper-3); color: var(--color-ink); }
.tp-field { display: flex; flex-direction: column; gap: 6px; }
.tp-field label { font-size: 0.9rem; font-weight: 500; }
.tp-input, .tp-field input[type="text"], .tp-field input[type="email"], .tp-field select, .tp-field textarea {
  min-height: 46px; box-sizing: border-box; padding: 0 14px; border: 1px solid var(--color-line-strong);
  border-radius: var(--radius); font: inherit; color: var(--color-ink); background: #fff; width: 100%;
}
.tp-field textarea { padding: 12px 14px; min-height: 110px; resize: vertical; }

/* ── Documents: folder list + folder ────────────────────────────────────── */
.tp-docs { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.tp-folders {
  flex: 1 1 260px; max-width: 100%; background: #fff; border: 1px solid var(--color-line);
  border-radius: var(--radius-lg); padding: 12px; display: flex; flex-direction: column; gap: 2px;
}
.tp-folders-group { padding: 14px 10px 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted); }
.tp-folders-year { padding: 10px 10px 2px 12px; font-size: 0.9rem; font-weight: 600; }
.tp-folder {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px;
  border-radius: 8px; color: #3d372f; font-size: 0.9rem; font-weight: 500; text-decoration: none;
}
.tp-folder.sub { padding-left: 24px; }
.tp-folder:hover { background: var(--color-paper-3); color: var(--color-ink); }
.tp-folder[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tp-folder .count { margin-left: auto; font-size: 0.8rem; color: var(--color-muted); font-weight: 500; }
.tp-folder-pane {
  flex: 999 1 560px; min-width: 0; background: #fff; border: 1px solid var(--color-line);
  border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 16px;
}
.tp-drop {
  border: 2px dashed var(--color-line-strong); border-radius: 12px; padding: 20px; background: #fbfaf7;
  display: flex; flex-direction: column; gap: 14px;
}
.tp-empty { margin: 0; padding: 18px 0; color: var(--color-muted); font-size: 0.9rem; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.tp-footer { border-top: 1px solid var(--color-line); padding: 20px 16px; text-align: center; font-size: 0.8rem; color: var(--color-muted); }

@media (max-width: 640px) {
  .tp-main { padding: 24px 16px 40px; }
  .tp-header-inner { padding: 10px 16px; }
  .tp-card, .tp-folder-pane { padding: 18px; }
}
