/* Genetidoc Payout Calculator. Same palette and components as the other Genetidoc tools. */
:root {
  --blue: #3E3E7E; --blue-d: #2e2e63; --blue-l: #eceefc; --blue-m: #c9cdf6; --accent: #5E6CE6;
  --pink: #E84E85; --pink-l: #fdeaf1; --cream: #FFF3E8; --mist: #F7F9FC;
  --ink: #232a3d; --ink-2: #35405B; --ink-3: #7b8794; --line: #e3e8ee; --bg: #f5f7fb; --card: #fff;
  --green: #1b8a5a; --green-l: #e5f5ed; --red: #c62828; --red-l: #fdecec; --amber: #9a5b00; --amber-l: #fff4e0;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
h1 { font-size: 22px; margin: 0; color: var(--blue); }
h2 { font-size: 15px; margin: 0; color: var(--blue); }
h3 { font-size: 13.5px; margin: 0; color: var(--ink-2); }
.boot { padding: 60px; text-align: center; color: var(--ink-3); }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: #f0f2f8; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-d); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 2px 3px; font-weight: 500; }
.btn.link:hover { text-decoration: underline; background: none; }
.btn:focus-visible, .input:focus-visible, .side a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input, select.input, textarea.input { width: 100%; border: 1px solid #d3d9e4; border-radius: 8px; padding: 7px 10px; background: #fff; outline: none; min-width: 0; }
textarea.input { resize: vertical; min-height: 64px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--blue-l); }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; min-width: 0; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.form .full { grid-column: 1 / -1; }
.check { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--blue-l) 0%, var(--cream) 100%); padding: 16px; }
.login-card { width: 380px; max-width: 100%; background: #fff; border-radius: 14px; padding: 32px; box-shadow: 0 10px 40px rgba(62,62,126,.14); }
.login-card img { height: 46px; }
.error { color: var(--red); font-size: 13px; min-height: 18px; margin: 6px 0; }

/* layout */
.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 18px; position: sticky; top: 0; z-index: 20; }
.topbar .logo { height: 28px; }
.topbar .brand-name { color: var(--blue); font-weight: 600; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.side { background: #fff; border-right: 1px solid var(--line); padding: 10px 10px 30px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.side .grp { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 5px; font-weight: 600; }
.side a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.side a:hover { background: #f0f2f8; }
.side a.on { background: var(--blue-l); color: var(--blue); }
.side a .count { font-size: 11px; background: var(--red-l); color: var(--red); border-radius: 99px; padding: 0 7px; font-weight: 600; }
.side a .soon { font-size: 10px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; }
.page { padding: 22px 22px 60px; max-width: 1280px; width: 100%; display: flex; flex-direction: column; gap: 16px; }
.mobile-nav { display: none; }
.head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.sub { color: var(--ink-3); margin: 3px 0 0; max-width: 75ch; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.kpi .l { font-size: 12px; color: var(--ink-3); }
.kpi .v { font: 600 18px var(--mono); color: var(--blue); margin-top: 2px; font-variant-numeric: tabular-nums; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.step:hover { border-color: var(--accent); }
.step .no { font: 500 11px var(--mono); color: var(--ink-3); }
.empty { text-align: center; padding: 34px 20px; color: var(--ink-3); background: #fff; border: 1px dashed #cfd6e3; border-radius: 12px; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: #eef1f6; color: var(--ink-2); white-space: nowrap; }
.pill.blue { background: var(--blue-l); color: var(--blue); }
.pill.green { background: var(--green-l); color: var(--green); }
.pill.amber { background: var(--amber-l); color: var(--amber); }
.pill.red { background: var(--red-l); color: var(--red); }
.pill.pink { background: var(--pink-l); color: #b8285c; }

/* notes */
.note { border-radius: 8px; padding: 9px 12px; font-size: 13px; background: var(--blue-l); color: var(--ink-2); }
.note.warn { background: var(--amber-l); color: #6b4300; }
.note.bad { background: var(--red-l); color: var(--red); }
.note.good { background: var(--green-l); color: var(--green); }

/* tables */
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.tbl.scroll { max-height: 560px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 11px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
th { background: #f9fafc; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); font-weight: 600; position: sticky; top: 0; white-space: nowrap; z-index: 1; }
tbody tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-family: var(--mono); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.neg td.n { color: var(--red); }
tr.off td { opacity: .55; }
tfoot td { font-weight: 600; background: #f9fafc; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 12px; cursor: pointer; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--blue); border-color: var(--blue); }
.tree { list-style: none; padding-left: 18px; margin: 4px 0; border-left: 1px dashed var(--line); }
.tree li { padding: 3px 0; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(20,22,45,.45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 30px 14px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 600px; max-width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.modal.wide { width: 1000px; }
.modal-head { padding: 15px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-head .t { font-weight: 600; font-size: 16px; color: var(--blue); }
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; align-items: center; flex-wrap: wrap; }
.drop { border: 2px dashed #c4cbe6; border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; background: #fafbff; color: var(--ink-2); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--blue-l); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 8px; z-index: 200; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 90vw; }
.toast.err { background: var(--red); }

/* tablet / phone */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mobile-nav { display: block; }
  .page { padding: 16px; }
  .topbar .brand-name { display: none; }
}
