/* BeneFound — brand: teal #04A396, navy #0A1A31, slate #35445B, line #E5E7EB, bg #F7F8FA */
:root {
  --teal: #04A396;
  --teal-dark: #038579;
  --navy: #0A1A31;
  --slate: #35445B;
  --line: #E5E7EB;
  --bg: #F7F8FA;
  --danger: #B42318;
  --danger-bg: #FEF3F2;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--navy);
  background: var(--bg);
  line-height: 1.5;
}
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 .5em; }
a { color: var(--teal-dark); }

/* ---- buttons / forms ---- */
.btn {
  display: inline-block; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--teal); color: #fff; font: inherit; font-weight: 600;
  padding: .65rem 1.1rem; text-decoration: none;
}
.btn:hover { background: var(--teal-dark); }
.btn-secondary { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--bg); }
.btn-block { display: block; width: 100%; }

label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 .3rem; color: var(--slate); }
input[type=text], input[type=email], input[type=password], select {
  width: 100%; padding: .65rem .75rem; font: inherit; color: var(--navy);
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.field { margin-bottom: 1rem; }

.alert { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .95rem; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #FECDCA; }

/* ---- login ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2rem; box-shadow: 0 4px 16px rgba(10,26,49,.06);
}
.auth-card .logo { display: block; width: 260px; max-width: 100%; margin: 0 auto 1.25rem; }
.auth-card .tagline { text-align: center; color: var(--slate); font-size: .95rem; margin: 0 0 1.5rem; }

/* ---- app shell ---- */
.topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: .6rem 1.5rem;
}
.topbar img { height: 84px; display: block; }
.topbar .who { color: var(--slate); font-size: .9rem; display: flex; align-items: center; gap: .75rem; }
.topbar form { margin: 0; }
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-head h1 { margin: 0; font-size: 1.5rem; }
.empty { text-align: center; color: var(--slate); padding: 2rem 1rem; }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--line); }
table.list th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); }

/* ---- nav ---- */
.topbar-left { display: flex; align-items: center; gap: 1.5rem; }
.topbar nav { display: flex; gap: 1rem; }
.topbar nav a { color: var(--slate); text-decoration: none; font-weight: 600; font-size: .95rem; padding: .35rem 0; border-bottom: 2px solid transparent; }
.topbar nav a:hover { color: var(--navy); }
.topbar nav a.active { color: var(--navy); border-bottom-color: var(--teal); }

/* ---- messages ---- */
.alert-info { background: #EFF8FF; color: #175CD3; border: 1px solid #B2DDFF; }
.alert-ok   { background: #ECFDF3; color: #067647; border: 1px solid #ABEFC6; }
.alert-warn { background: #FFFAEB; color: #93370D; border: 1px solid #FEDF89; }
.muted { color: var(--slate); }

/* ---- import page ---- */
.card h2 { font-size: 1.15rem; }
.card h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.stats { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .6rem 1rem; min-width: 110px; }
.stat b { display: block; font-size: 1.4rem; }
.stat span { color: var(--slate); font-size: .8rem; }
.err-h { color: var(--danger); }
.warn-h { color: #93370D; }
.issues { margin: 0 0 1rem; padding-left: 1.2rem; font-size: .9rem; }
.issues.err li { color: var(--danger); }
.issues.warn li { color: #93370D; }
.scroll { max-height: 260px; overflow: auto; }
ul.plain { margin: .4rem 0 1rem; padding-left: 1.2rem; font-size: .9rem; }
details { margin: .5rem 0; }
summary { cursor: pointer; color: var(--slate); font-weight: 600; }
.actions { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-start; }
.actions .alert { flex: 1 1 100%; }
label.check { display: block; font-weight: 400; color: var(--navy); margin: .35rem 0; }
label.check input { margin-right: .4rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } .topbar { flex-wrap: wrap; gap: .5rem; } }

/* ---- client form ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.span-2 { grid-column: 1 / -1; }
.hint { font-size: .82rem; color: var(--slate); margin-top: .3rem; }
.table-wrap { overflow-x: auto; }
.btn-sm { padding: .4rem .75rem; font-size: .88rem; }
.link-btn { background: none; border: 0; padding: .3rem .4rem; font: inherit; font-size: .85rem; color: var(--slate); cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--danger); }
.emp { border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; margin-bottom: .9rem; background: #fff; }
.emp-num { display: block; flex: 0 0 100%; font-weight: 700; font-size: .85rem; color: var(--teal-dark); text-transform: uppercase; letter-spacing: .04em; }
.member-row { display: flex; flex-wrap: wrap; gap: .6rem .75rem; align-items: flex-end; }
.member-row .f { flex: 1 1 150px; min-width: 130px; }
.member-row .f-rel { flex: 0 0 130px; min-width: 110px; }
.member-row label { font-size: .78rem; margin-bottom: .2rem; }
.member-row .age { flex: 0 0 62px; padding-bottom: .65rem; font-size: .85rem; color: var(--slate); }
.deps { margin: .6rem 0 .6rem 1.25rem; padding-left: .9rem; border-left: 3px solid var(--line); }
.deps .dep { margin-bottom: .55rem; }
input[type=date] { width: 100%; padding: .65rem .75rem; font: inherit; color: var(--navy); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
input[type=date]:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
code { background: var(--bg); padding: .1rem .35rem; border-radius: 4px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } .deps { margin-left: .4rem; } }

/* ---- census upload ---- */
.census-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; margin-bottom: 1rem; font-size: .9rem; }
.upload-result { border: 1px dashed var(--teal); background: #F3FBFA; border-radius: 10px; padding: .9rem 1rem; margin-bottom: 1rem; }
.upload-result .actions { margin-top: .75rem; }
.upload-result p { margin: .4rem 0; }
.upload-result .err-h { color: var(--danger); display: block; margin-bottom: .4rem; }
.upload-result .warn-h { color: #93370D; }

/* ---- client status ---- */
.tabs { display: flex; gap: 1.25rem; margin-bottom: .9rem; border-bottom: 1px solid var(--line); }
.tabs a { color: var(--slate); text-decoration: none; font-weight: 600; padding: .5rem 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--teal); }
.tabs .count { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 0 .45rem; font-size: .78rem; margin-left: .2rem; }
.badge { display: inline-block; background: #F2F4F7; color: var(--slate); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .55rem; font-size: .72rem; font-weight: 600; vertical-align: middle; margin-left: .35rem; }
tr.inactive td { color: var(--slate); }
tr.inactive td a { color: var(--slate); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline; margin: 0 0 0 .5rem; }
.head-actions { display: flex; gap: .6rem; align-items: center; }
.head-actions form { margin: 0; }

/* ---- quote builder ---- */
.inline-form { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.q-toolbar { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.q-toolbar .q-meta { flex: 1 1 280px; line-height: 1.6; }
.q-toolbar .q-controls { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.q-toolbar .q-controls .field { margin: 0; min-width: 150px; }
.q-toolbar #q-error { flex: 1 1 100%; margin: 0; }
.q-gridcard { padding: 0; overflow: hidden; }
.q-scroll { overflow: auto; max-height: 80vh; }
.q-help { font-size: .85rem; margin-top: .75rem; }

table.qgrid { border-collapse: separate; border-spacing: 0; font-size: .9rem; min-width: 100%; }
table.qgrid th, table.qgrid td { padding: .35rem .55rem; border-bottom: 1px solid var(--line); background: #fff; vertical-align: top; text-align: left; }
table.qgrid thead { position: sticky; top: 0; z-index: 4; }
table.qgrid .sticky { position: sticky; z-index: 2; }
table.qgrid .c0 { left: 0; min-width: 240px; max-width: 240px; width: 240px; border-right: 1px solid var(--line); }
table.qgrid .c1 { left: 240px; min-width: 58px; max-width: 58px; width: 58px; text-align: center; border-right: 2px solid var(--line); color: var(--slate); }
table.qgrid thead .sticky { z-index: 6; }
table.qgrid [class*="k-"] { min-width: 200px; width: 200px; }
table.qgrid .pair-start { border-left: 3px solid #CBD5E1; }
table.qgrid th.k-current, table.qgrid thead td.k-current { background: #EEF2F6; }
table.qgrid th.k-renewal, table.qgrid thead td.k-renewal { background: #E3F5F3; }
table.qgrid th.k-option  { background: #F7F8FA; }
table.qgrid .hd-title th { font-weight: 700; color: var(--navy); border-bottom: 0; white-space: nowrap; }
table.qgrid .hd-title th.corner, table.qgrid .plabel { color: var(--slate); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
table.qgrid .hd-pick th { padding-top: .1rem; padding-bottom: .1rem; border-bottom: 0; }
table.qgrid .hd-msg th { color: var(--danger); font-size: .78rem; font-weight: 600; border-bottom: 1px solid var(--line); }
table.qgrid .add-col { min-width: 150px; background: #fff; }
table.qgrid .filler { width: 100%; min-width: 0; background: #fff; }
table.qgrid .pick { width: 100%; font: inherit; font-size: .85rem; padding: .35rem .4rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--navy); }
table.qgrid select.pick:disabled { background: #F2F4F7; color: #98A2B3; }
table.qgrid .x { float: right; border: 0; background: none; font-size: 1.1rem; line-height: 1; color: var(--slate); cursor: pointer; padding: 0 .2rem; }
table.qgrid .x:hover { color: var(--danger); }
table.qgrid .ratelabel td { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); font-weight: 600; background: #F7F8FA; }
table.qgrid .ratelabel td.sticky { background: #F7F8FA; }
table.qgrid td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.qgrid td.na { color: #98A2B3; text-align: center; }
table.qgrid td.err { color: var(--danger); font-weight: 600; }
table.qgrid .rate-in { width: 100%; text-align: right; font: inherit; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 6px; font-variant-numeric: tabular-nums; }
table.qgrid .rate-in:focus, table.qgrid .pick:focus, table.qgrid .ben-in:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
table.qgrid td.dep .mname { padding-left: 1.3rem; }
table.qgrid .mrel { color: var(--slate); font-size: .8rem; }
table.qgrid .enroll { float: right; font-size: .78rem; padding: .1rem .2rem; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
table.qgrid tr.r-dep td { color: var(--slate); }
table.qgrid tr.totals td { font-weight: 700; background: #F7F8FA; border-top: 1px solid var(--line); }
table.qgrid tr.totals td.sticky { background: #F7F8FA; }
table.qgrid tr.tot-monthly td { border-top: 2px solid var(--navy); }
table.qgrid .incomplete { font-size: .72rem; font-weight: 600; color: #93370D; }
table.qgrid tr.section td { background: var(--navy); color: #fff; font-weight: 700; }
table.qgrid tr.subsection td { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); font-weight: 600; background: #F7F8FA; }
table.qgrid tr.subsection td.sticky { background: #F7F8FA; }
table.qgrid .blabel { font-weight: 600; color: var(--navy); }
table.qgrid .btext { white-space: pre-line; font-size: .85rem; }
table.qgrid .ben-in { width: 100%; resize: vertical; font: inherit; font-size: .85rem; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
