/* ---- Phector Capital brand fonts (local, OFL-licensed) ---- */
@font-face { font-family: "Source Sans 3"; src: url("/static/fonts/SourceSans3-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/static/fonts/SourceSans3-Semibold.ttf") format("truetype"); font-weight: 500 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/static/fonts/SourceSans3-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/static/fonts/SourceSerif4-Medium.ttf") format("truetype"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/static/fonts/SourceSerif4-Semibold.ttf") format("truetype"); font-weight: 600 700; font-style: normal; font-display: swap; }

:root {
  /* Phector Capital brand palette (visual brand standards, 2026-09) */
  --navy: #173847; --navy-deep: #102632; --navy-soft: #35637C;
  --orange: #C89B4B; --orange-soft: #F3EBDB;
  --bg: #FBFAF7; --card: #ffffff; --ink: #102632; --muted: #617078;
  --line: #E6E2D8; --green: #157f3d; --amber: #b45309; --red: #b91c1c;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; }
a { color: var(--navy-soft); text-decoration: none; }
a:hover { color: var(--orange); }

/* ---------- top navigation ---------- */
nav { background: var(--navy-deep); color: #fff; display: flex; align-items: stretch;
  padding: 0 22px; height: 68px; gap: 2px;
  border-bottom: 3px solid var(--orange);
  position: sticky; top: 0; z-index: 100; }
nav .brand { display: flex; align-items: center; margin-right: 30px; }
nav .brand img { height: 46px; width: auto; }  /* supplied wordmark ≥160px wide */
nav a.item { color: #BAC4C9; padding: 0 14px; font-size: 13.5px; display: flex;
  align-items: center; border-bottom: 3px solid transparent; margin-bottom: -3px;
  text-transform: uppercase; letter-spacing: 1.2px; font-weight: 600; }
nav a.item:hover { color: #fff; text-decoration: none; }
nav a.item.active { color: #fff; border-bottom-color: var(--orange); }
nav .spacer { flex: 1; }

main { max-width: 1080px; margin: 28px auto 60px; padding: 0 20px; }

/* ---------- headings: navy with a short orange accent bar ---------- */
h1 { font-family: "Source Serif 4", Georgia, serif; font-size: 28px;
  margin: 4px 0 22px; color: var(--ink); font-weight: 500; letter-spacing: -0.01em; }
h1::after { content: ""; display: block; width: 44px; height: 3px;
  background: var(--orange); margin-top: 7px; border-radius: 2px; }
h2 { font-size: 12px; margin: 26px 0 10px; color: var(--navy);
  text-transform: uppercase; letter-spacing: 1.6px; font-weight: 700; }

.flash { background: #F2EFE6; border-left: 3px solid var(--navy-soft); color: var(--navy-deep);
  padding: 11px 14px; border-radius: 0 8px 8px 0; margin-bottom: 18px; font-size: 14px; }

/* ---------- stat cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; box-shadow: 0 1px 2px rgba(27, 51, 73, .05); }
.card .label { color: var(--muted); font-size: 10.5px; margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 1.4px; font-weight: 600; }
.card .big { font-size: 27px; font-weight: 700; color: var(--navy); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(27, 51, 73, .05); }
.panel h2 { margin-top: 0; }

/* ---------- tables: invoice-style headers ---------- */
table.data { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(27, 51, 73, .05); }
table.data th { text-align: left; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--navy); background: #F6F4EE; font-weight: 700;
  padding: 11px 12px; border-bottom: 2px solid var(--navy); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: none; }
table.data td.r, table.data th.r { text-align: right; }
table.data tr.total td { font-weight: 700; background: #F6F4EE; color: var(--navy); }
table.data tr:hover td { background: #FBF8F4; }

/* ---------- forms ---------- */
form.inline { display: inline; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px;
  text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=month], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #D6D1C4; border-radius: 7px;
  font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(233, 126, 48, .45);
  border-color: var(--orange); }
textarea { min-height: 70px; resize: vertical; }
.row { display: flex; gap: 14px; }
.row > div { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; }
.check input { width: auto; }
.check label { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }

/* ---------- buttons ---------- */
button, .btn { background: var(--navy); color: #fff; border: none; padding: 9px 18px;
  border-radius: 7px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-block; }
button:hover, .btn:hover { background: var(--navy-soft); color: #fff; }
.btn.secondary, button.secondary { background: #fff; color: var(--navy); border: 1px solid #D6D1C4; }
.btn.secondary:hover, button.secondary:hover { border-color: var(--navy); background: #fff; color: var(--navy); }
.btn.danger, button.danger { background: #fff; color: var(--red); border: 1px solid #ecc; }
.btn.danger:hover, button.danger:hover { background: #fff5f5; color: var(--red); }
.btn.small, button.small { padding: 5px 11px; font-size: 13px; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.badge.draft { background: var(--orange-soft); color: #7A5A21; }
.badge.sent { background: #DCE7F3; color: var(--navy); }
.badge.paid { background: #d1fae5; color: var(--green); }
.badge.void { background: #EDEFF2; color: var(--muted); }
.badge.hourly { background: #E4EBF3; color: var(--navy); }
.badge.retainer { background: #E9E2F5; color: #5b21b6; }

/* ---------- disclosure (collapsed forms) ---------- */
details.disclosure { margin-bottom: 18px; }
details.disclosure > summary { cursor: pointer; list-style: none; display: inline-flex;
  align-items: center; gap: 8px; background: #fff; color: var(--navy);
  border: 1px solid #D6D1C4; padding: 9px 16px; border-radius: 7px;
  font-weight: 600; font-size: 14px; user-select: none; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: "▸"; font-size: 12px; }
details[open].disclosure > summary::before { content: "▾"; }
details.disclosure > summary:hover { border-color: var(--navy); }
details.disclosure > .panel { margin-top: 10px; }

/* ---------- attention strip ---------- */
.attn { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.attn .chip { display: inline-flex; align-items: center; gap: 9px; padding: 8px 15px;
  border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  box-shadow: 0 1px 2px rgba(27, 51, 73, .05); }
.attn a.chip:hover { border-color: var(--navy); color: var(--navy); }
.attn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex: none; }
.attn .chip.red .dot { background: var(--red); }
.attn .chip.calm { color: var(--muted); font-weight: 400; }
.attn .chip.calm .dot { background: var(--green); }

/* ---------- section tabs ---------- */
.tabs { display: flex; gap: 2px; margin: -6px 0 22px; border-bottom: 2px solid var(--line); }
.tabs a { padding: 9px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--orange); }
.tabs a:hover { color: var(--navy); }

.card .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

.muted { color: var(--muted); font-size: 13px; }
.right { text-align: right; }
.mt { margin-top: 14px; }

/* ---------- sign-in ---------- */
.auth-wrap { max-width: 400px; margin: 70px auto; }
.auth-wrap .panel { padding: 30px; border-top: 4px solid var(--orange); }
.auth-wrap h1 { text-align: center; }
.auth-wrap h1::after { margin-left: auto; margin-right: auto; }
.auth-logo { display: block; margin: 0 auto 14px; width: 240px; height: auto; }
.auth-brand { text-align: center; color: var(--navy); font-weight: 700;
  font-family: "Source Serif 4", Georgia, serif; font-size: 24px;
  margin-bottom: 4px; letter-spacing: .3px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 3px; margin-bottom: 22px; }

/* ---- sortable table headers (v10.9) ---- */
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--orange, #C89B4B); }
table.data th.sortable[data-sorted="asc"]::after { content: " \25B4"; font-size: 10px; }
table.data th.sortable[data-sorted="desc"]::after { content: " \25BE"; font-size: 10px; }
