/* =========================================================================
   Design tokens — "Ledger" theme
   A quiet, financial-register aesthetic: ink navy sidebar, paper content
   area, monospace for every number, a single accent used only for the
   thing that matters most (profit vs. loss).
   ========================================================================= */

:root {
  /* -----------------------------------------------------------------------
     Every colour below is either an official Trifecta palette colour or a
     tint/shade mixed from one. Nothing here is picked by eye.

       Yale Blue   #0053A5   primary accent
       French Blue #0067C6   secondary accent
       Cyan        #00A0E2   highlights
       Navy        #101842   dark backgrounds, headings, body text
       Off-white   #F5F3EF   light panels
       White       #FFFFFF

     The one deliberate exception is the risk scale further down — red,
     amber and green. Those are read as meaning, not as decoration: a
     critical finding has to look like a critical finding even to someone
     who has never seen the brand. They stay.
     ----------------------------------------------------------------------- */

  /* Darks — Navy and shades of it */
  --ink:          #101842;   /* Navy, official. Sidebar / headings */
  --ink-soft:     #2D3459;   /* Navy + 12% white */
  --text:         #101842;   /* Navy */
  --text-muted:   #555A76;   /* Navy + 30% off-white. 6.09:1 on paper */

  /* Lights — Off-white and shades of it */
  --paper:        #F5F3EF;   /* Off-white, official. Content background */
  --paper-tint:   #FAF9F7;   /* Off-white + 50% white. Detail rows */
  --paper-card:   #FFFFFF;   /* White, official */
  --panel:        #EEECE8;   /* Off-white shaded 3%. Pills, tab bar */
  --panel-2:      #E9E7E3;   /* Off-white shaded 5%. Badges */
  --line:         #E1E0DC;   /* Off-white shaded 8%. Borders */
  --line-strong:  #D5D3D0;   /* Off-white shaded 13% */

  /* Accents — the three official blues */
  --accent:       #0053A5;   /* Yale Blue, official. Primary accent */
  --accent-hover: #063E82;   /* Yale Blue + 35% navy */
  --accent-soft:  #E6EEF6;   /* Yale Blue + 90% white */
  --accent-2:     #0067C6;   /* French Blue, official */
  --accent-3:     #00A0E2;   /* Cyan, official */

  /* Risk scale — deliberately outside the palette. See note above. */
  --profit:       #1B8A5A;
  --profit-soft:  #E4F5EC;
  --loss:         #C0392B;
  --loss-soft:    #FBE9E7;
  --warn:         #B8860B;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* Checkboxes, radios and progress bars are drawn by the browser, not by us.
   Left alone they use the operating system's accent colour — which on a
   default Windows install is a blue that is close to Yale Blue without being
   it, and sits right next to our buttons where the difference shows. */
input, select, textarea, progress {
  accent-color: var(--accent);
}

/* ---------------------------------------------------------------------- */
/* Shell layout — top header, full-width content                          */
/* ---------------------------------------------------------------------- */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--paper-card);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 10px 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand img.logo {
  height: 34px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  text-align: left;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-item.active {
  background: var(--accent);
  color: #fff;
}

.nav-item--muted {
  color: var(--text-muted);
  font-size: 12.5px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.data-mode {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
  /* Backstop. This badge sits in a fixed corner next to the nav, and the nav
     is what gets squeezed when anything here grows — the first version pushed
     the last menu item behind a scrollbar. Cap it and ellipsis it, so no
     future wording can do that again. The full text is in the tooltip. */
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Live data that has gone stale. Amber deliberately — this is the risk scale,
   not decoration: it means "the numbers on this screen may be out of date",
   which is exactly the thing you want someone to notice before they act on
   them. */
.data-mode--stale {
  color: var(--warn);
  font-weight: 600;
}
.data-mode--stale::before {
  content: "\26A0  ";
}


.content {
  padding: 28px 36px 60px 36px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}



/* ---------------------------------------------------------------------- */
/* Headings / view chrome                                                  */
/* ---------------------------------------------------------------------- */

.view-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}

.view-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.view-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.view-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ---------------------------------------------------------------------- */
/* Cards / summary strip                                                   */
/* ---------------------------------------------------------------------- */

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 26px;
}

.summary-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.summary-card .label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.summary-card .value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}

.summary-card .value.profit { color: var(--profit); }
.summary-card .value.loss { color: var(--loss); }

/* ---------------------------------------------------------------------- */
/* Tables                                                                   */
/* ---------------------------------------------------------------------- */

.table-wrap {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  /* Deliberately NOT overflow:hidden — that makes this a scroll container,
     which stops the sticky header below from pinning to the viewport.
     Corners are rounded on the corner cells instead (see below). */
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-tint);
  white-space: nowrap;
  /* Column headers stay visible while scrolling a long report. Offset by the
     nav height so they pin just below it rather than underneath it; the nav
     measures itself at load and sets --nav-height. */
  position: sticky;
  top: var(--nav-height, 56px);
  z-index: 4;
}

/* The header row sits above rows but below the nav and any modal. */
thead th::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--line);
}

/* The wrapper can no longer clip (that would break sticky), so the corner
   cells carry the radius themselves. */
thead tr:first-child th:first-child { border-top-left-radius: var(--radius); }
thead tr:first-child th:last-child  { border-top-right-radius: var(--radius); }
tbody tr:last-child td:first-child  { border-bottom-left-radius: var(--radius); }
tbody tr:last-child td:last-child   { border-bottom-right-radius: var(--radius); }

/* Nested drill-down tables scroll with their parent row, so pinning them
   would leave a stray header floating mid-page. */
.detail-row thead th,
.bundle-detail thead th {
  position: static;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr.clickable { cursor: pointer; transition: background 0.1s ease; }
tbody tr.clickable:hover { background: var(--accent-soft); }

.num { font-family: var(--font-mono); text-align: right; white-space: nowrap; }
.num.profit { color: var(--profit); font-weight: 600; }
.num.loss { color: var(--loss); font-weight: 600; }

/* margin health tab on P&L rows */
.margin-tab {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 8px;
}
.margin-tab.good { background: var(--profit); }
.margin-tab.warn { background: var(--warn); }
.margin-tab.bad { background: var(--loss); }

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--panel-2);
  color: var(--text-muted);
}
.pill.active { background: var(--profit-soft); color: var(--profit); }
.pill.inactive { background: var(--loss-soft); color: var(--loss); }
.pill.status-complete { background: var(--profit-soft); color: var(--profit); }
.pill.status-progress { background: var(--accent-soft); color: var(--accent); }
.pill.status-new { background: var(--panel-2); color: var(--text-muted); }
.pill.status-waiting { background: #FBF3DE; color: var(--warn); }

/* .pill.warn has been written into the Users screen since invitations shipped
   and this stylesheet has never defined it — so every "Invited" badge has
   rendered as the plain grey pill, indistinguishable from "Not invited", the
   one state it most needed to differ from. A browser applies no rule for a
   class it has no rule for, silently, which is what makes this class of defect
   survive. Time Off found the same shape in four table wrappers.
   Registry rule 57. */
.pill.warn { background: #FBF3DE; color: var(--warn); }
.pill.danger { background: var(--loss-soft); color: var(--loss); }

/* The clock beside an invitation — deliberately quieter than the pill it sits
   next to, because "18 hrs left" is detail about a state, not a state. */
.pill-note {
  display: inline-block;
  margin-left: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.priority-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.priority-Low { background: var(--text-muted); }
.priority-Medium { background: var(--accent-2); }
.priority-High { background: var(--warn); }
.priority-Critical { background: var(--loss); }

/* ---------------------------------------------------------------------- */
/* Buttons / inputs                                                        */
/* ---------------------------------------------------------------------- */

.btn {
  border: 1px solid var(--line);
  background: var(--paper-card);
  color: var(--text);
  border-radius: var(--radius);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-danger {
  background: var(--loss);
  border-color: var(--loss);
  color: #fff;
}
.btn-danger:hover { background: #A6301F; }

select, input[type="text"] {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-body);
  background: var(--paper-card);
  color: var(--text);
}

/* ---------------------------------------------------------------------- */
/* Company detail / breadcrumb                                             */
/* ---------------------------------------------------------------------- */

.breadcrumb {
  font-size: 12.5px;
  color: var(--accent);
  margin-bottom: 10px;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
}
.breadcrumb:hover { text-decoration: underline; }

.detail-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.info-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.info-card dt {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 12px;
}
.info-card dt:first-child { margin-top: 0; }
.info-card dd { margin: 2px 0 0 0; font-size: 13.5px; }

.section-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  margin: 28px 0 12px 0;
}

/* ---------------------------------------------------------------------- */
/* Admin panel                                                              */
/* ---------------------------------------------------------------------- */

.admin-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 620px;
}
.admin-card p { color: var(--text-muted); font-size: 13.5px; line-height: 1.6; }
.admin-card code {
  background: var(--panel);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}
.tab {
  padding: 8px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
}
.tab.active { background: var(--ink); color: #fff; }

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------------------- */
/* Date range picker                                                        */
/* ---------------------------------------------------------------------- */

.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-range select {
  min-width: 168px;
}

.date-range .custom-dates {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-range input[type="date"] {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 13px;
  font-family: var(--font-body);
  background: var(--paper-card);
  color: var(--text);
}

/* ---------------------------------------------------------------------- */
/* Contract match badges                                                    */
/* ---------------------------------------------------------------------- */

.match-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
}
.match-badge.match { background: var(--profit-soft); color: var(--profit); }
.match-badge.mismatch { background: var(--loss-soft); color: var(--loss); }
.match-badge.no_billing { background: var(--panel-2); color: var(--text-muted); }
.match-badge.no_price { background: #FBF3DE; color: var(--warn); }

.contract-services-table th, .contract-services-table td { font-size: 13px; }

.autotask-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 14px;
}
.autotask-link:hover { border-color: var(--accent); }

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .nav { order: 3; width: 100%; }
  .topbar-right { margin-left: auto; }
  .content { padding: 20px; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .date-range { width: 100%; }
}

/* ---------------------------------------------------------------------- */
/* Auth screens (login / setup / reset password)                            */
/* ---------------------------------------------------------------------- */

.auth-shell {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px 30px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(20,33,58,0.06);
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px 0;
}

.auth-card .auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.5;
}

.form-field {
  margin-bottom: 14px;
}

.form-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="tel"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: var(--font-body);
  background: var(--paper-card);
  color: var(--text);
}

.form-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-error {
  background: var(--loss-soft);
  color: var(--loss);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

.form-success {
  background: var(--profit-soft);
  color: var(--profit);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

/* The sentence under a checkbox that explains what ticking it does. Muted and
   small on purpose: it is there for the person meeting the option for the
   first time, and must not compete with the label it belongs to. */
.field-hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Amber, not red. Nothing has been refused and nobody has done anything wrong
   — somebody has to be told something, or has to decide something. Borrowed
   from Time Off, which needed exactly this distinction and found that reusing
   .form-error for it broke a browser check three screens away. */
.needs-attention {
  background: #FBF3DE;
  color: var(--warn);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

.auth-card .btn-primary {
  width: 100%;
  padding: 10px;
  font-size: 13.5px;
  margin-top: 4px;
}

.auth-link-row {
  text-align: center;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.auth-link-row a, .link-button {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
}
.auth-link-row a:hover, .link-button:hover { text-decoration: underline; }

.dev-link-box {
  background: #FBF3DE;
  border: 1px solid #E9D9A8;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  word-break: break-all;
  margin-top: 10px;
  color: #6B5B10;
}

/* ---------------------------------------------------------------------- */
/* User menu                                                                */
/* ---------------------------------------------------------------------- */

.user-menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-menu .user-name-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}
.user-menu .user-name-btn:hover { background: var(--accent-soft); color: var(--accent); }

.user-menu .logout-btn {
  font-size: 12.5px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
}
.user-menu .logout-btn:hover { color: var(--loss); }

/* ---------------------------------------------------------------------- */
/* MFA setup                                                                */
/* ---------------------------------------------------------------------- */

.mfa-qr-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: center;
  margin: 14px 0;
}
.mfa-qr-box svg { width: 180px; height: 180px; }

.mfa-secret-box {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 8px 12px;
  text-align: center;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  word-break: break-all;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

.user-table td.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Clickable summary widgets (Invoices page paid/outstanding filters) */
.summary-card--click {
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.summary-card--click:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.summary-card--active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ---------------------------------------------------------------------- */
/* External link badge — signals "this leaves the app / opens AutoTask"    */
/* ---------------------------------------------------------------------- */
.ext-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent);
  font-size: 10px;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.ext-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}
/* When the badge follows a text link, keep them visually paired */
a + .ext-link { margin-left: 4px; }

/* ---------------------------------------------------------------------------
   The dashboard (build 33)

   The portal home was a grid of app tiles until build 32. It is a widget
   dashboard now, and the tiles live inside the first widget rather than being
   the page — navigation did not go away, it got smaller.
   --------------------------------------------------------------------------- */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

/* One column below this, rather than two squeezed ones. A half-width widget
   at 480px is not half a widget, it is an unusable one. */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}

.dash-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px 18px 18px;
  min-width: 0;                 /* lets a wide table inside shrink rather than
                                   push the whole grid sideways */
}

.dash-card--full { grid-column: 1 / -1; }
.dash-card--half { grid-column: auto; }

.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.dash-controls { display: flex; gap: 4px; flex-shrink: 0; }

.dash-ctl {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text-muted);
  border-radius: 5px;
  width: 26px;
  height: 26px;
  line-height: 1;
  cursor: pointer;
  font-size: 14px;
}
.dash-ctl:hover { color: var(--ink); border-color: var(--accent); }

.dash-hint { color: var(--text-muted); font-size: 13px; margin: 0 0 12px 0; }
.dash-error { color: var(--warn); font-size: 13px; margin: 0; }

/* The app launcher — what the big tiles became */
.launcher {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.launcher-app {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  background: var(--paper);
}
.launcher-app:hover { border-color: var(--accent); }

.launcher-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

/* The parts calculator */
.pricing-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.pricing-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.pricing-row input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
  font-family: var(--font-mono);
  width: 120px;
}

.pricing-result { margin-top: 14px; }

.pricing-out {
  display: flex;
  gap: 26px;
  align-items: baseline;
  flex-wrap: wrap;
}
.pricing-out strong {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--ink);
}

.summary-value {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--ink);
  margin: 2px 0;
}

/* The margin ladder editor (build 34) */
.tiers { width: 100%; border-collapse: collapse; }
.tiers th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0 10px 8px 0;
}
.tiers td { padding: 5px 10px 5px 0; vertical-align: middle; }
.tiers input {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 14px;
}

/* The gear on a widget card. Rendered only when the server says this person
   may configure the widget — see widgets.build(). */
.dash-gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 15px;
}

/* What the app IS, under its name — replacing the permission level that used
   to sit there. A new starter wants to know what Financials does; nobody has
   ever wanted to be told they are a viewer. */
.launcher-what {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
