/* Gerard Billing — app.css
   Extracted from design.html prototype. --brand is overridden inline by index.cfm
   using the accent_color setting from app_settings.
*/

/* =============================================================
   Design tokens
   ============================================================= */
:root {
  --brand: #E25C26;
  --brand-soft: #F4D9C9;
  --brand-deep: #B84617;
  --ink: #1f2328;
  --ink-soft: #5a6068;
  --line: #d9dde2;
  --line-soft: #e8ebef;
  --bg: #ffffff;
  --row-alt: #f3f4f6;
  --row-hover: #fff4ee;
  --tab: #dfe3e7;
  --tab-soft: #ecf0f3;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
  --shadow-pop: 0 8px 24px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --rail: #6a7480;
  --ok: #178a3a;
  --warn: #c0392b;
  --info: #265a9a;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: var(--rail);
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button {
  font-family: inherit;
  font-size: 13px;
  padding: 4px 12px;
  background: #f5f5f5;
  border: 1px solid #888;
  border-radius: 2px;
  cursor: pointer;
  color: var(--ink);
}
button:hover { background: #eaeaea; }
button.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand-deep);
  font-weight: 600;
}
button.primary:hover { background: var(--brand-deep); }
input[type="text"], input[type="date"], input[type="number"], select, textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 3px 6px;
  border: 1px solid #888;
  border-radius: 2px;
  background: #fff;
}
input[type="checkbox"] {
  accent-color: var(--brand);
}

/* =============================================================
   Page chrome — header, branding, nav
   ============================================================= */
.frame {
  max-width: 1380px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(0,0,0,.18);
}
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 28px 8px;
  border-bottom: 1px solid var(--line-soft);
}
.topbar-left {
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.product-mark {
  font-size: 17px;
  color: #585858;
}
.product-mark .strong { font-weight: 700; color: var(--brand); }
.tagline {
  font-style: italic;
  color: #7a7a7a;
  font-size: 13px;
}
.top-links {
  font-weight: 700;
  color: var(--brand);
  font-size: 13px;
}
.top-links a { margin: 0 4px; }
.top-links .sep { color: #b5b5b5; font-weight: 400; }
.top-links .user-name { color: var(--ink); }
.top-links .user-group { color: var(--ink-soft); }

.org-band {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 8px 28px 14px;
}
.org-mark {
  line-height: 1;
}
.org-mark .logo {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  font-weight: 400;
  color: var(--brand);
  letter-spacing: -1px;
}
.org-mark .sub {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #6b6b6b;
  margin-top: 2px;
}
.page-title-block {
  flex: 1;
  padding-left: 4px;
}
.page-title {
  color: var(--brand);
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 4px;
}
.user-meta {
  text-align: right;
  font-size: 13px;
  color: #333;
  border-left: 1px solid var(--line);
  padding-left: 14px;
  min-width: 160px;
}
.user-meta .name { font-weight: 700; }

/* Primary nav (tabs) */
.nav {
  display: flex;
  background: var(--tab-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.nav-item {
  flex: 1 1 0;
  padding: 10px 18px;
  border-right: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  position: relative;
  font-size: 13px;
  color: var(--ink);
}
.nav-item:last-child { border-right: 0; }
.nav-item:hover { background: #f6f8fa; }
.nav-item.active { color: var(--brand-deep); background: #fff; box-shadow: inset 0 -2px 0 var(--brand); }
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  min-width: 220px;
  z-index: 50;
  box-shadow: var(--shadow-pop);
}
.nav-item.open .submenu { display: block; }
.submenu a {
  display: block;
  padding: 8px 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.submenu a:last-child { border-bottom: 0; }
.submenu a:hover { background: var(--brand-soft); color: var(--brand-deep); text-decoration: none; }

/* =============================================================
   Main canvas
   ============================================================= */
main {
  padding: 22px 28px 60px;
  background: #fff;
  min-height: 600px;
}
#content {
  opacity: 1;
  transition: opacity .22s ease;
  will-change: opacity;
}
#content.route-fade-out {
  opacity: 0;
}
.view { display: none; animation: fade .18s ease-out; }
.view.active { display: block; }
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.view-title {
  color: var(--brand);
  font-weight: 700;
  font-size: 15px;
  margin: 4px 0 14px;
}

/* Toolbar above lists */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.toolbar label { color: var(--ink); }
.search-inline { display: flex; gap: 6px; align-items: center; }

/* Fees screen toolbars and quick entry cards */
.fees-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #f7f8fa;
}
.fees-toolbar .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fees-toolbar .field label {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.fees-toolbar .field input,
.fees-toolbar .field select {
  min-width: 0;
}

.qe-toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.qe-toolbar .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.qe-toolbar .field label {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.fee-q-toolbar {
  margin-bottom: 14px;
}
.fee-q-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 18px;
}
.fee-q-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}
.fee-q-loading {
  padding: 14px 12px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
}
.fee-q-row {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(18, 24, 38, 0.03);
  padding: 12px;
}
.fee-q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.fee-q-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.fee-q-index {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 700;
  font-size: 12px;
}
.fee-q-headline {
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
}
.fee-q-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 16px;
}
.fee-q-col {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.fee-q-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.fee-q-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.fee-q-field > label {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.fee-q-control {
  min-width: 0;
}
.fee-q-control input,
.fee-q-control select {
  width: 100%;
  min-width: 0;
}
.fee-q-field.narrow input,
.fee-q-field.narrow select {
  text-align: right;
}
.fee-q-field.inline .fee-q-control {
  display: flex;
  align-items: center;
  min-height: 34px;
}
.fee-q-field.inline .q-check {
  margin: 0;
}
.fee-q-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

@media (max-width: 900px) {
  .qe-toolbar {
    align-items: stretch;
  }
  .fee-q-columns {
    grid-template-columns: 1fr;
  }
  .fee-q-actions {
    margin-left: 0;
    padding-top: 0;
  }
}

/* Tables */
table.data {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: #fff;
}
table.data th {
  text-align: left;
  color: var(--brand);
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 var(--line);
}
table.data th[data-sort],
table.data th.sortable {
  cursor: pointer;
  user-select: none;
}
table.data th.sorted-asc::after,
table.data th.sorted-desc::after {
  display: inline-block;
  margin-left: 6px;
  color: var(--brand-deep);
  font-size: 11px;
}
table.data th.sorted-asc::after { content: "▲"; }
table.data th.sorted-desc::after { content: "▼"; }
table.data td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
table.data tr:nth-child(even) td { background: var(--row-alt); }
table.data tr:hover td { background: var(--row-hover); cursor: pointer; }
table.data th.right, table.data td.right { text-align: right; }
.row-actions {
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.row-actions + .row-actions {
  margin-left: 12px;
}
.direct-actions {
  color: var(--brand);
  font-weight: 600;
  letter-spacing: 4px;
  white-space: nowrap;
}
.direct-actions span,
.direct-actions a {
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 2px;
  text-decoration: none;
  color: var(--brand);
  font-weight: 600;
}
.direct-actions span:hover,
.direct-actions a:hover { background: var(--brand-soft); }
.table-pager {
  margin-top: 10px;
}
.table-pager select {
  min-width: 72px;
}
.row-link { color: var(--brand); font-weight: 600; }
.scroll-top-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 220;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--brand-deep);
  background: var(--brand);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--shadow-pop);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, background .18s ease;
}
.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.scroll-top-btn:hover {
  background: var(--brand-deep);
}
.status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
}
.status-active { background: #d1fae5; color: #065f46; }
.status-inactive { background: #fee2e2; color: #991b1b; }
.status-ACTV { background: #e2f1e7; color: var(--ok); }
.status-BILL { background: #fdecea; color: var(--warn); }
.status-ARCH { background: #e7e9ec; color: #555; }

/* Form layouts (two-column) */
.form-two-col {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 30px;
  padding: 16px 0 24px;
}
.form-two-col .divider {
  background: var(--line);
}
.form-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  margin-bottom: 9px;
  gap: 10px;
}
.form-row label {
  text-align: right;
  color: var(--ink);
}
.form-row label.mandatory {
  font-weight: 700;
}
.form-row input[type="text"], .form-row input[type="date"], .form-row select, .form-row textarea {
  width: 100%;
  max-width: 320px;
}
.form-row textarea { min-height: 60px; resize: vertical; }
.form-row .factors { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-row .factors input { width: 70px; }
.form-actions {
  margin-top: 14px;
  padding-left: 150px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.form-hint {
  font-style: italic;
  color: var(--ink-soft);
  margin-left: 12px;
  font-size: 12px;
}

.field-hint {
  display: block;
  font-size: 12px;
  margin-top: 3px;
  color: var(--ink-soft);
}
.field-hint.is-error {
  color: var(--danger, #c0392b);
}

.client-contacts-section {
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.client-contacts-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.client-contacts-head h3 {
  margin: 0;
  color: var(--brand);
  font-size: 14px;
}

/* Side rail */
.layout-with-side {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
}
.side-rail {
  background: #fff;
  border-right: 1px solid var(--line);
  padding-right: 10px;
}
.side-rail h4 {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.side-rail a {
  display: block;
  padding: 6px 8px;
  color: var(--ink);
  border-radius: 3px;
  font-size: 13px;
  margin-bottom: 2px;
}
.side-rail a:hover, .side-rail a.active {
  background: var(--brand-soft);
  color: var(--brand-deep);
  text-decoration: none;
}

/* Pill totals */
.totals-bar {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  padding: 8px 12px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-top: 0;
  font-weight: 700;
}
.totals-bar .label { color: var(--ink-soft); font-weight: 400; margin-right: 4px; }

/* Project detail (fees view) */
.project-detail-title {
  color: var(--brand);
  font-weight: 700;
  font-size: 15px;
  margin: 8px 0 14px;
}
.detail-actions {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-actions .right { display: flex; gap: 8px; }
#pd-btn-print { margin-left: 12px; }

/* Icon-only table cells — tight padding so edit + delete sit close together */
table.data td:has(> .pencil-btn) {
  padding-left: 4px;
  padding-right: 2px;
  white-space: nowrap;
}
table.data td:has(> .delete-btn) {
  padding-left: 4px;
  padding-right: 2px;
  width: 22px;
}

/* Pencil edit button — editable table rows */
.pencil-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  padding: 1px 5px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.4;
}
.pencil-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.pencil-btn.editing { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* Mark-paid icon button — sits to the right of the pencil edit button */
.mark-paid-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  padding: 1px 5px;
  line-height: 1.4;
  vertical-align: middle;
}
.mark-paid-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.mark-paid-btn img {
  height: 16px;
  width: auto;
  display: block;
}

/* Invoiced-toggle icon button — Fees/Expenses rows on project detail */
.invoiced-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  padding: 1px 5px;
  opacity: 0.4;
}
.invoiced-btn.is-invoiced { opacity: 1; }
.invoiced-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.invoiced-btn img {
  height: 16px;
  width: auto;
  display: block;
}

/* Delete/remove icon button — red X */
.delete-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  padding: 1px 5px;
  color: #b94040;
  font-size: 16px;
  line-height: 1.4;
}
.delete-btn:hover { border-color: #c0392b; color: #c0392b; background: #fdecea; }

/* Editing row highlight */
table.data tr.editing td {
  background: var(--brand-soft) !important;
  border-top: 1px solid var(--brand);
  border-bottom: 1px solid var(--brand);
}

/* AR entry header */
.ar-entry {
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 16px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fafbfc;
  margin-bottom: 14px;
  align-items: center;
}
.ar-entry label { font-weight: 600; font-size: 12px; }
.ar-entry input, .ar-entry select { width: 130px; }

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20,22,25,.45);
  z-index: 200;
  align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  min-width: 360px;
  max-width: 520px;
  padding: 18px 20px 16px;
  border-radius: 3px;
}
.modal h3 {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 15px;
}
.modal .form-row { grid-template-columns: 110px 1fr; }
.modal-actions { display: flex; gap: 8px; padding-top: 6px; }
.modal .red-diamond { color: var(--brand); }
.modal.modal-wide {
  max-width: 700px;
  width: min(700px, calc(100vw - 36px));
}

.modal.adjustment-modal {
  width: min(1080px, calc(100vw - 36px));
  max-width: 1080px;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
}
.modal.adjustment-modal h3 { display: none; }
.modal.adjustment-modal .modal-body {
  padding: 0;
  overflow: hidden;
}
.modal.adjustment-modal .adj-modal-shell {
  background: linear-gradient(180deg, #fcfcfd, #f6f8fb);
}
.modal.adjustment-modal .adj-modal-top {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--bg), var(--surface-2));
}
.modal.adjustment-modal .adj-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.modal.adjustment-modal .adj-title-block {
  min-width: 0;
}
.modal.adjustment-modal .adj-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 700;
}
.modal.adjustment-modal .adj-kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
}
.modal.adjustment-modal .adj-modal-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--brand);
}
.modal.adjustment-modal .adj-modal-message {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}
.modal.adjustment-modal .adj-modal-message.is-error {
  display: block;
  border-color: #e5b8b1;
  background: #fff4f2;
  color: var(--warn);
}
.modal.adjustment-modal .adj-modal-message.is-success {
  display: block;
  border-color: #bedfc8;
  background: #f2fbf4;
  color: var(--ok);
}
.modal.adjustment-modal .adj-project-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 12px;
}
.modal.adjustment-modal .adj-project-badge strong {
  color: var(--ink);
}
.modal.adjustment-modal .adj-type-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.modal.adjustment-modal .adj-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  color: var(--ink-soft);
}
.modal.adjustment-modal .adj-type-pill strong {
  color: var(--ink);
}
.modal.adjustment-modal .adj-type-pill.is-active {
  border-color: var(--brand-soft);
  background: #fff6f1;
  color: var(--brand-deep);
}
.modal.adjustment-modal .adj-modal-body {
  padding: 0;
  overflow: hidden;
  position: relative;
}
/* slide track — not used for layout, just a hook for the JS class */
.modal.adjustment-modal .adj-slide-track {
  position: relative;
}
/* Pane 1: main form — always visible, drives the modal height */
.modal.adjustment-modal .adj-slide-pane {
  padding: 0 24px 20px;
  transition: transform .32s cubic-bezier(.4,0,.2,1), opacity .32s;
}
.modal.adjustment-modal .adj-slide-track.show-sub .adj-slide-pane {
  transform: translateX(-30px);
  opacity: 0;
  pointer-events: none;
}
/* Pane 2: sub-form — absolutely overlays pane 1, slides in from right */
.modal.adjustment-modal .adj-sub-pane {
  position: absolute;
  inset: 0;
  padding: 20px 24px 20px;
  background: var(--bg, #fcfcfd);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  border-left: 1px solid var(--line-soft);
}
.modal.adjustment-modal .adj-slide-track.show-sub .adj-sub-pane {
  transform: translateX(0);
}
.modal.adjustment-modal .adj-sub-pane .adj-back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  cursor: pointer;
  margin-bottom: 16px;
  text-decoration: none;
  user-select: none;
}
.modal.adjustment-modal .adj-sub-pane .adj-back-link:hover { text-decoration: underline; }
.modal.adjustment-modal .adj-sub-pane .adj-sub-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}
.modal.adjustment-modal .adj-sub-pane .adj-sub-subtitle {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.modal.adjustment-modal .adj-sub-msg {
  font-size: 12px;
  min-height: 0;
  margin-bottom: 10px;
  border-radius: 4px;
}
.modal.adjustment-modal .adj-sub-msg.is-error  { color: var(--warn); background: #fdecea; padding: 5px 10px; }
.modal.adjustment-modal .adj-sub-msg.is-success { color: var(--ok);  background: #e8f5ee; padding: 5px 10px; }
.modal.adjustment-modal .adj-sub-field-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.modal.adjustment-modal .adj-sub-field {
  display: grid;
  grid-template-columns: 120px minmax(0,1fr);
  gap: 10px;
  align-items: center;
}
.modal.adjustment-modal .adj-sub-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}
.modal.adjustment-modal .adj-sub-field label.mandatory::after { content: ' *'; color: var(--brand); }
.modal.adjustment-modal .adj-sub-field input,
.modal.adjustment-modal .adj-sub-field select {
  font-size: 12px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: inherit;
  width: 100%;
}
.modal.adjustment-modal .adj-inline-add {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
  margin-left: 4px;
}
.modal.adjustment-modal .adj-inline-add:hover { text-decoration: underline; }
.modal.adjustment-modal .adj-field-with-add {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
}
.modal.adjustment-modal .adj-field-with-add select { flex: 1; min-width: 0; }
.modal.adjustment-modal .adj-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
  padding-top: 20px;
}
.modal.adjustment-modal .adj-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  padding: 16px;
}
.modal.adjustment-modal .adj-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.modal.adjustment-modal .adj-panel-title h2 {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-deep);
}
.modal.adjustment-modal .adj-panel-title span {
  font-size: 12px;
  color: var(--ink-soft);
}
.modal.adjustment-modal .adj-field-list {
  display: grid;
  gap: 12px;
}
.modal.adjustment-modal .adj-field {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.modal.adjustment-modal .adj-field--stack {
  grid-template-columns: 1fr;
  align-items: stretch;
}
.modal.adjustment-modal .adj-field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}
.modal.adjustment-modal .adj-field--stack label {
  text-align: left;
}
.modal.adjustment-modal .adj-field input[type="text"],
.modal.adjustment-modal .adj-field input[type="date"],
.modal.adjustment-modal .adj-field select,
.modal.adjustment-modal .adj-field textarea {
  width: 100%;
}
.modal.adjustment-modal .adj-field textarea {
  min-height: 156px;
  resize: vertical;
}
.modal.adjustment-modal .adj-helper {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.modal.adjustment-modal .adj-toggle-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.modal.adjustment-modal .adj-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--bg), var(--surface-2));
}
.modal.adjustment-modal .adj-toggle input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--brand);
}
.modal.adjustment-modal .adj-toggle strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}
.modal.adjustment-modal .adj-toggle span {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.modal.adjustment-modal .adj-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.modal.adjustment-modal .adj-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.modal.adjustment-modal .adj-actions button {
  padding: 8px 14px;
}
.modal.adjustment-modal .adj-actions .primary {
  padding: 8px 16px;
}
.modal.adjustment-modal .adj-delete-confirm {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  margin-top: 16px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #e5b8b1;
  border-radius: 12px;
  background: #fff4f2;
  color: var(--ink);
}
.modal.adjustment-modal .adj-delete-confirm strong {
  display: block;
  margin-bottom: 2px;
  color: var(--warn);
}
.modal.adjustment-modal .adj-delete-confirm span {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
}
.modal.adjustment-modal .adj-delete-confirm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 920px) {
  .modal.adjustment-modal .adj-modal-head,
  .modal.adjustment-modal .adj-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .modal.adjustment-modal .adj-type-switcher {
    justify-content: flex-start;
  }

  .modal.adjustment-modal .adj-layout {
    grid-template-columns: 1fr;
  }

  .modal.adjustment-modal .adj-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .modal.adjustment-modal .adj-field label {
    text-align: left;
  }
}

/* Reports filters card */
.report-card {
  max-width: 720px;
  margin: 10px auto 0;
  padding: 18px 22px;
  border: 1px solid var(--line-soft);
  background: #fcfcfd;
  border-radius: 3px;
}

/* Footer */
footer {
  text-align: center;
  color: var(--brand);
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
}

/* =============================================================
   Project Summary Report (matches printable PDF layout)
   ============================================================= */
.summary-report {
  background: #fff;
  padding: 8px 0 40px;
  color: #1c1c1c;
  font-size: 12px;
  line-height: 1.4;
}
.summary-report .report-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}
.sr-head {
  border-bottom: 1px solid #c8c8c8;
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.sr-head .sr-logo {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  color: var(--brand);
  line-height: 1;
}
.sr-head .sr-logo-sub {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #6b6b6b;
  margin-top: 2px;
}
.sr-head .sr-project-title {
  color: var(--brand);
  font-size: 17px;
  font-weight: 700;
  margin: 14px 0 6px;
}
.sr-head .sr-date {
  font-weight: 700;
  color: #1c1c1c;
  margin-bottom: 14px;
}
.sr-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 30px;
  margin-bottom: 18px;
}
.sr-meta .row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  font-size: 12px;
}
.sr-meta .row .lbl { color: #1c1c1c; }
.sr-meta .row .val { color: #1c1c1c; }

.sr-section {
  margin-top: 18px;
}
.sr-section-title {
  font-weight: 700;
  color: #1c1c1c;
  border-bottom: 1px dashed #999;
  padding-bottom: 2px;
  margin-bottom: 0;
  font-size: 12px;
  letter-spacing: .5px;
}
table.sr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
table.sr-table th {
  text-align: left;
  font-weight: 700;
  color: #1c1c1c;
  padding: 6px 6px 4px;
  border-bottom: 1px solid #c8c8c8;
  background: #fff;
  vertical-align: bottom;
}
table.sr-table th.right, table.sr-table td.right { text-align: right; }
table.sr-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}
table.sr-table tr.totals-row td {
  border-top: 1px solid #c8c8c8;
  border-bottom: 0;
  font-weight: 700;
  padding-top: 8px;
}
table.sr-table .check-col { width: 22px; text-align: center; color: #1c1c1c; }
table.sr-table .date-col  { width: 88px; white-space: nowrap; }
table.sr-table .code-col  { width: 60px; }
table.sr-table .who-col   { width: 50px; }
table.sr-table .num-col   { width: 80px; }
table.sr-table .empty-row td {
  color: var(--ink-soft);
  font-style: italic;
  padding: 6px;
}

/* Summary roll-up table */
table.sr-summary {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  margin-top: 6px;
}
table.sr-summary th, table.sr-summary td {
  padding: 4px 8px;
  text-align: right;
  border-bottom: 1px solid #f0f0f0;
}
table.sr-summary th:first-child, table.sr-summary td:first-child {
  text-align: left;
  font-weight: 700;
}
table.sr-summary thead th {
  font-weight: 700;
  border-bottom: 1px solid #c8c8c8;
}
table.sr-summary tr.grand td {
  border-top: 1px solid #c8c8c8;
  border-bottom: 0;
  font-weight: 700;
  padding-top: 8px;
}
.text-neg { color: var(--warn); }
.sr-footer-url {
  text-align: left;
  font-size: 10px;
  color: #6b6b6b;
  margin-top: 30px;
  border-top: 1px solid #e0e0e0;
  padding-top: 6px;
  display: flex;
  justify-content: space-between;
}

/* Print styles — when printed, hide chrome, expand the report */
@media print {
  body { background: #fff; }
  .frame { box-shadow: none; max-width: none; }
  .topbar, .org-band, nav.nav, footer, .report-toolbar,
  .pd-pane:not(#pd-summary) { display: none !important; }
  main { padding: 0 !important; }
  .summary-report { padding: 0; font-size: 11px; }
  .sr-section { page-break-inside: avoid; }
  table.sr-table tr { page-break-inside: avoid; }
}

/* =============================================================
   Setup module — shared layout
   ============================================================= */
.setup-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}
.setup-sidebar {
  background: #fafbfc;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 12px 8px;
  position: sticky;
  top: 12px;
}
.setup-sidebar h5 {
  margin: 0 6px 6px;
  color: var(--brand);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.setup-sidebar a {
  display: block;
  padding: 7px 10px;
  color: var(--ink);
  border-radius: 3px;
  margin-bottom: 1px;
  font-size: 13px;
}
.setup-sidebar a:hover { background: #eef1f4; text-decoration: none; }
.setup-sidebar a.active {
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 600;
}
.setup-pane {
  min-width: 0;
}
.setup-pane .help-blurb {
  background: #fff7ed;
  border-left: 3px solid var(--brand);
  padding: 10px 14px;
  margin-bottom: 16px;
  color: #5a3110;
  font-size: 12.5px;
  line-height: 1.5;
  border-radius: 0 3px 3px 0;
}
.setup-pane h3.section-h {
  color: var(--brand);
  font-weight: 700;
  font-size: 14px;
  margin: 18px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--line);
}
.setup-pane .panel {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.inline-form {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.inline-form .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inline-form .field label {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* User Groups: two-column permission picker */
.ug-permissions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}
.ug-permissions .col {
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: #fff;
}
.ug-permissions .col-head {
  padding: 8px 12px;
  background: #f1f3f5;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.ug-permissions .col-body {
  max-height: 340px;
  overflow: auto;
  padding: 6px 8px;
}
.ug-permissions .opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 13px;
}
.ug-permissions .opt:hover { background: var(--row-hover); }
.ug-permissions .check-all {
  color: var(--brand);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

/* Project numbering preview */
.pn-builder {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.pn-part {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  border-radius: 3px;
}
.pn-part .part-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 13px;
}
.pn-part label {
  display: block;
  padding: 3px 0;
  cursor: pointer;
  font-size: 13px;
}
.pn-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pn-preview {
  background: #1f2328;
  color: #f3d8c4;
  padding: 14px 18px;
  border-radius: 3px;
  font-family: "Menlo", "Consolas", monospace;
  font-size: 16px;
  letter-spacing: 2px;
  margin-top: 14px;
}
.pn-preview .lbl { color: #8d949c; font-size: 11px; letter-spacing: 1px; display: block; margin-bottom: 6px; }

/* Code chips */
.code-chip {
  display: inline-block;
  padding: 2px 7px;
  background: #eef1f4;
  border-radius: 3px;
  font-family: "Menlo", "Consolas", monospace;
  font-size: 11.5px;
  color: #2a3036;
  font-weight: 600;
}
.billing-tabs {
  display: inline-flex;
  margin-bottom: 14px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.billing-tabs .bt {
  padding: 7px 18px;
  cursor: pointer;
  background: #f5f6f8;
  border-right: 1px solid var(--line);
  font-size: 13px;
}
.billing-tabs .bt:last-child { border-right: 0; }
.billing-tabs .bt.active { background: var(--brand); color: #fff; font-weight: 600; }
.billing-tabs .bt:hover:not(.active) { background: var(--brand-soft); }
.bc-pane { display: none; }
.bc-pane.shown { display: block; }
.color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 6px;
}

/* =============================================================
   Utility / misc
   ============================================================= */
.text-right { text-align: right; }
.text-muted { color: var(--ink-soft); }
.monospace { font-family: "Menlo", "Consolas", monospace; }
.hidden { display: none !important; }

/* Alerts */
.alert {
  padding: 8px 12px;
  border-radius: 3px;
  margin-bottom: 12px;
  font-size: 13px;
}
.alert-error { background: #fdecea; color: var(--warn); border: 1px solid #f5c6c2; }
.alert-success { background: #e2f1e7; color: var(--ok); border: 1px solid #b8dfc4; }

/* =============================================================
   Login screen — exact from design.html
   ============================================================= */
.login-shell {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #6a7480 0%, #4a5360 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 30px 60px rgba(0,0,0,.3);
  width: 100%;
  max-width: 420px;
  padding: 36px 40px 30px;
}
.login-brand {
  text-align: center;
  margin-bottom: 22px;
}
.login-brand .product {
  font-size: 13px;
  color: #888;
  margin-bottom: 4px;
}
.login-brand .product .strong { font-weight: 700; color: var(--brand); }
.login-brand .logo {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 50px;
  color: var(--brand);
  line-height: 1;
  margin-top: 8px;
}
.login-brand .sub {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #6b6b6b;
  margin-top: 2px;
}
.login-form .field {
  margin-bottom: 14px;
}
.login-form label {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 14px;
}
.login-form input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.login-form button.login-btn {
  width: 100%;
  padding: 11px;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 3px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: .3px;
}
.login-form button.login-btn:hover { background: var(--brand-deep); }
.login-error {
  background: #fdecea;
  color: var(--warn);
  padding: 8px 12px;
  border-radius: 3px;
  font-size: 12.5px;
  margin-bottom: 12px;
  display: none;
}
.login-error.show { display: block; }
.login-demo {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.6;
}
.login-demo b { color: var(--ink); }
.login-demo code {
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 2px;
  font-family: "Menlo","Consolas",monospace;
  font-size: 11px;
}

/* Tab panels used by billing codes view */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* =============================================================
   Projects module — new project form, project record, rollup tables
   ============================================================= */

/* New project two-column grid */
.np-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 16px 0 24px;
}

/* Project record two-column grid */
.pr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 40px;
  padding-top: 8px;
}
.pr-grid .form-row label { width: 120px; }

/* Project rollup tables (Summary / Analysis / Invoices) */
.pr-rollup {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.pr-rollup th {
  color: var(--brand);
  font-weight: 700;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .3px;
  text-align: left;
}
.pr-rollup th.right { text-align: right; }
.pr-rollup td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line-soft);
}
.pr-rollup td.right { text-align: right; font-variant-numeric: tabular-nums; }
.pr-rollup td.rowlabel { color: var(--brand); font-weight: 600; }
.pr-rollup tr.totals td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }
.pr-rollup tr.totals td.right { border-top: 1px solid var(--line); }
.pr-rollup button {
  font-size: 11.5px;
  padding: 3px 12px;
}

/* Project detail report recap (Summary / Analysis / Invoices) — matches views/projects/print/index.cfm exactly */
.recap {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid #ccc;
}
table.recap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 24px;
}
table.recap-table th,
table.recap-table td {
  border: none;
  padding: 5px 12px;
  text-align: right;
  white-space: nowrap;
}
table.recap-table th:first-child,
table.recap-table td:first-child {
  text-align: left;
  white-space: normal;
}
table.recap-table th.nb,
table.recap-table td.nb { text-align: left; white-space: normal; }
table.recap-table thead th {
  background: #d9d9d9;
  color: #E25C26;
  font-weight: 700;
}
table.recap-table thead th:first-child {
  color: #1c2b39;
  font-weight: 700;
  text-transform: uppercase;
}
table.recap-table tbody td:first-child {
  color: #E25C26;
  font-weight: 600;
}
table.recap-table tbody tr:nth-child(even) td {
  background: #f2f2f2;
}
table.recap-table tr.recap-total td {
  font-weight: 700;
  color: #1c2b39;
  padding-top: 12px;
}
table.recap-table tr.recap-total td:first-child {
  color: #1c2b39;
}
table.recap-table .recap-neg { color: #d6336c; font-weight: 700; }
table.recap-table .recap-pos { color: #2f9e44; font-weight: 700; }
table.recap-table tr.recap-total td.recap-neg { color: #d6336c; }
table.recap-table tr.recap-total td.recap-pos { color: #2f9e44; }
.recap-foot {
  text-align: center;
  color: #E25C26;
  font-size: 12px;
  padding-top: 8px;
  border-top: 1px solid #ccc;
}

.adj-section {
  margin-bottom: 22px;
}
.adj-section h3 {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 4px;
}
.adj-section .adj-blurb {
  color: var(--ink-soft);
  font-size: 12px;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* pd-pane: each sub-view within project detail */
.pd-pane { display: block; }

/* Misc helpers (if not already present) */
.muted { color: var(--ink-soft); }
.text-warn { color: var(--warn); }
.text-ok   { color: var(--ok); }

/* Scrollable table wrapper */
.scroll-wrap { max-height: none; overflow-x: auto; overflow-y: visible; border: 1px solid var(--line); }
.scroll-wrap table.data { border: 0; }

/* Section headings */
.section-h {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin: 14px 0 8px;
}

/* Project detail title */
.project-detail-title {
  color: var(--brand);
  font-weight: 700;
  font-size: 15px;
  margin: 8px 0 14px;
}

/* Toggle-on button state (active pane button) */
button.toggle-on {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.tab-panel.active { display: block; }

/* =============================================================
   Contact directory (Vendors list & Employee rolodex)
   ============================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.contact-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  transition: box-shadow .15s, transform .15s;
  cursor: pointer;
  position: relative;
}
.contact-card:hover {
  box-shadow: var(--shadow-pop);
  transform: translateY(-1px);
  border-color: var(--brand);
}
.contact-card .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.contact-card .cc-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.contact-card .cc-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.2;
}
.contact-card .cc-role {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.contact-card .cc-line {
  font-size: 12px;
  color: var(--ink);
  margin: 3px 0;
  display: flex;
  gap: 6px;
  align-items: center;
}
.contact-card .cc-line .lbl { color: var(--ink-soft); width: 50px; flex-shrink: 0; font-size: 11px; }
.contact-card .cc-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 700;
  letter-spacing: .5px;
}

/* Client contact manager */
.contact-block {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
  display: grid;
  grid-template-columns: 30px 1fr 1fr 1fr 1fr 1.3fr auto;
  gap: 10px;
  align-items: center;
}
.contact-block.primary-contact {
  border-color: var(--brand);
  background: #fffaf6;
}
.contact-block .primary-flag {
  color: var(--brand);
  font-weight: 700;
  font-size: 18px;
  text-align: center;
  cursor: pointer;
}
.contact-block .primary-flag.off { color: #ddd; }
.contact-block input[type="text"] {
  width: 100%;
  font-size: 12.5px;
}
.contact-block .remove-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
}
.contact-block .remove-btn:hover {
  background: #fdecea;
  color: var(--warn);
  border-color: var(--warn);
}

/* Vendor detail panel */
.vendor-detail {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0;
  margin-top: 14px;
  display: grid;
  grid-template-columns: 320px 1fr;
  overflow: hidden;
}
.vendor-detail .left {
  background: #fafbfc;
  border-right: 1px solid var(--line-soft);
  padding: 18px;
}
.vendor-detail .right { padding: 18px; }
.vendor-detail h4 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--ink);
}
.vd-spend-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.vd-spend-row:last-child { border-bottom: 0; }
.vd-spend-row .num { font-weight: 700; }

/* Directory toolbar */
.directory-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.view-toggle button {
  background: #fff;
  border: 0;
  padding: 6px 12px;
  cursor: pointer;
  border-right: 1px solid var(--line);
  font-size: 12px;
}
.view-toggle button:last-child { border-right: 0; }
.view-toggle button.active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

/* Employee card extras */
.emp-card .emp-stat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--ink-soft);
}
.emp-card .emp-stat b { color: var(--ink); font-weight: 600; }

/* ---- AR / Receivables ---- */
.subtabs { display: flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.subtab { padding: 5px 14px; font-size: 13px; cursor: pointer; color: var(--ink); border-right: 1px solid var(--line); white-space: nowrap; }
.subtab:last-child { border-right: 0; }
.subtab.active { background: var(--brand); color: #fff; font-weight: 600; }
.subtab:hover:not(.active) { background: var(--brand-soft); }

.ar-group-opt { padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--ink); border-bottom: 1px solid var(--line-soft); }
.ar-group-opt:last-child { border-bottom: 0; }
.ar-group-opt:hover { background: var(--brand-soft); color: var(--brand-deep); }
.ar-group-opt.active { font-weight: 700; color: var(--brand-deep); }

tr.ar-paid-row td { color: var(--ink-soft); }
tr.ar-paid-row td.ar-pay-cell { color: var(--ok); font-weight: 700; }
tr.ar-group-header td { background: #f1f3f5 !important; font-weight: 700; font-size: 12px; color: var(--brand); letter-spacing: .3px; padding: 5px 10px; }


/* =============================================================
   Reports
   ============================================================= */
.report-stat-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	margin-bottom: 18px;
}
.report-stat-card {
	border: 1px solid var(--line);
	padding: 12px 14px;
	border-radius: 3px;
	background: #fafbfc;
}
.report-stat-card .stat-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .5px;
	color: var(--ink-soft);
	margin-bottom: 4px;
}
.report-stat-card .stat-value {
	font-size: 20px;
	font-weight: 700;
	color: var(--brand);
}
.report-stat-card .stat-sub {
	font-size: 11px;
	color: var(--ink-soft);
	margin-top: 2px;
}
.report-section-head {
	color: var(--brand-deep);
	font-size: 13px;
	font-weight: 700;
	margin: 16px 0 6px;
	padding: 6px 10px;
	background: #fff7ed;
	border-left: 3px solid var(--brand);
}
