/* The businesses one login keeps (js/companies.js), in the Bilzy look. The
 * TallyPrime look keeps them under F3 (js/tp-main.js) and hides the title
 * bar's chip (tally.css). */

/* ── The business in use, in the title bar ──────────────────────────── */
.tb-co {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 280px;
  margin: 5px 6px;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  color: #d8ece9;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-app-region: no-drag;
}
.tb-co:hover { background: rgba(255, 255, 255, .13); }
.tb-co-l { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8fc3bd; }
.tb-co b { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: #fff; font-weight: 600; }
.tb-co i { font-style: normal; padding: 0 6px; font-size: 10.5px; font-weight: 700; color: #0b3b37; background: #8fc3bd; border-radius: 9px; }
.tb-co svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4; }
/* Nothing to say on the sign-in screen. */
body:has(#shell[hidden]) .tb-co { display: none; }

/* ── Select Company ─────────────────────────────────────────────────── */
.modal.co-pick { width: min(640px, 94vw); }
.co-find .co-q {
  width: 100%;
  padding: 9px 11px;
  font: var(--font);
  font-size: 13.5px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.co-find .co-q:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 118, 110, .16); }
.co-list { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.co-head {
  display: flex;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
}
.co-count { font-weight: 600; letter-spacing: 0; text-transform: none; opacity: .85; }
.co-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--row-alt); }
.co-act { padding: 2px 0; font: var(--font); font-size: 12.5px; color: var(--accent); background: none; border: 0; cursor: pointer; }
.co-act kbd { margin-left: 4px; font: 10.5px/1 var(--font); color: var(--muted); }
.co-rows { max-height: 46vh; overflow: auto; }
.co-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 60px;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  font: var(--font);
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  border-bottom: 1px solid #eef1f6;
  cursor: pointer;
}
.co-item:hover { background: #eef7f5; }
.co-item.co-sel { background: #e3f2ef; box-shadow: inset 3px 0 0 var(--accent); }
.co-item.co-on .co-name { font-weight: 700; }
.co-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-name i, .co-first { font-style: normal; margin-left: 4px; padding: 0 6px; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; }
.co-gst { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.co-state { font-size: 11px; font-weight: 700; color: #15803d; text-align: right; }
.co-none { margin: 0; padding: 14px 12px; color: var(--muted); }
.co-foot { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

/* ── Company Creation / Alteration ──────────────────────────────────── */
.modal.co-card { width: min(600px, 94vw); }
.co-form { display: grid; gap: 6px; }
.co-row { display: grid; grid-template-columns: 170px 10px minmax(0, 1fr); align-items: center; gap: 6px; margin: 0; }
.co-lbl { font-size: 12.5px; color: var(--muted); }
.co-colon { color: var(--muted); }
.co-in {
  width: 100%;
  margin: 0;
  padding: 7px 9px;
  font: var(--font);
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.co-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 118, 110, .16); }
.co-err { margin: 10px 0 0; }

/* ── Settings → Businesses ──────────────────────────────────────────── */
.s-cos { grid-column: 1 / -1; }
/* Settings → Theme & look (js/theme.js page). */
.s-look { grid-column: 1 / -1; }
.co-page { max-width: 980px; }
.co-lead { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.co-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); }
.co-table th { padding: 7px 10px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; color: var(--muted); background: var(--row-alt); border-bottom: 1px solid var(--line); }
.co-table td { padding: 8px 10px; border-bottom: 1px solid #eef1f6; }
.co-table tr.co-on td { background: #f0f8f6; }
.co-use { margin-left: 6px; padding: 1px 7px; font-size: 10.5px; font-weight: 700; color: #fff; background: #15803d; border-radius: 8px; }
.co-btns { white-space: nowrap; text-align: right; }
.co-btns .ghost { width: auto; margin: 0; padding: 4px 10px; font-size: 12px; }
.co-btns .ghost + .ghost { margin-left: 6px; }
.co-plan { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.co-plan .co-plans { color: var(--accent); font-weight: 600; }
.co-new { margin-top: 14px; }
.co-new .co-make { width: auto; padding: 9px 18px; }

/* Settings → Invoice design → More bill series (js/series.js). */
.s-series { display: grid; gap: 10px; justify-items: start; grid-column: 1 / -1; }
.sr-table { width: 100%; max-width: 640px; border-collapse: collapse; font-size: 12.5px; }
.sr-table th { padding: 6px 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-align: left; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.sr-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.sr-btns { text-align: right; white-space: nowrap; }
.sr-btns .ghost { width: auto; margin: 0; padding: 4px 10px; font-size: 12px; }
.sr-btns .ghost + .ghost { margin-left: 6px; }
.sr-add { width: auto; padding: 8px 16px; }
.modal.sr-card { width: min(520px, 94vw); }
.sr-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
/* Estimates, notes & receipts: one card a paper, its boxes on one wrapping row. */
.s-docnum { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.s-docnum .sr-add { align-self: flex-start; }
.dn-list { display: grid; gap: 8px; max-width: 640px; }
.dn-sub { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.dn-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--card, #fff); }
.dn-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; }
.dn-prev { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent, #0f766e); white-space: nowrap; }
.dn-boxes { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 6px; }
.dn-boxes label { display: grid; gap: 2px; font-size: 11px; color: var(--muted); }
.dn-boxes input { height: 28px; width: 92px; padding: 0 7px; font: inherit; font-size: 12.5px; border: 1px solid var(--line); border-radius: 6px; }
.dn-boxes input[type="number"] { width: 70px; }
.sr-err { margin: 8px 0 0; }
