/* ASIM — clean, minimal business UI on top of Bootstrap 5 */
:root {
  --ink: #1d2125;
  --ink-2: #4a5159;
  --muted: #7b838c;
  --line: #e7e9ec;
  --line-2: #f0f2f4;
  --surface: #ffffff;
  --canvas: #fafbfb;
  /* Brand shades are overridden per company from Settings (templates/partials/_brand_css.html). */
  --brand: #FD5903;
  --brand-rgb: 253, 89, 3;
  --brand-600: var(--brand);
  --brand-700: #C94A10;
  --brand-50: #FFF4EA;
  --brand-100: #FFE3CC;
  --on-brand: #FFFFFF;
  --success: #067647;
  --success-bg: #ECFDF3;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .04);
  --sidebar-w: 240px;
  --sidebar-collapsed-w: 68px;
  --sb-bg: #FFFFFF;
  --sb-text: #4A5159;
  --sb-icon: #4A5159;
  --sb-active-bg: var(--brand-50);    /* a soft tint of the brand color unless the company picks its own */
  --sb-active-text: var(--brand-700);

  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--surface);
  --bs-border-color: var(--line);
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: var(--brand-rgb);
  --bs-link-hover-color: var(--brand-700);
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-focus-ring-color: rgba(var(--brand-rgb), .2);
}

body { font-size: .9375rem; background: var(--canvas); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted, .form-text { color: var(--muted) !important; }
.tabular { font-variant-numeric: tabular-nums; }
[data-lucide] { width: 18px; height: 18px; stroke-width: 1.9; vertical-align: -3px; }
.icon-sm[data-lucide], svg.icon-sm { width: 15px; height: 15px; vertical-align: -2px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--sb-bg); color: var(--sb-text);
  border: 1px solid color-mix(in srgb, var(--sb-text) 14%, var(--sb-bg)); border-radius: 16px;
  margin: 12px 0 12px 12px; height: calc(100vh - 24px); position: sticky; top: 12px; z-index: 1040;
  display: flex; flex-direction: column; padding: 14px 12px 12px;
  transition: width .18s ease, flex-basis .18s ease, padding .18s ease;
}

/* Workspace header: logo, name and tagline, opening a small menu. */
.ws { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid color-mix(in srgb, var(--sb-text) 14%, var(--sb-bg)); }
.ws-button {
  width: 100%; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 8px; border: 0; border-radius: 10px;
  background: transparent; color: var(--sb-text); text-align: left;
}
.ws-button:hover, .ws-button[aria-expanded="true"] { background: color-mix(in srgb, var(--sb-text) 7%, var(--sb-bg)); }
.ws-button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ws-text { flex: 1; }
.ws-chevron[data-lucide], svg.ws-chevron { flex: 0 0 auto; margin-left: auto; color: color-mix(in srgb, var(--sb-text) 60%, var(--sb-bg)); }
.ws-menu { min-width: 216px; }
.brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-mark {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; background: var(--brand); color: var(--on-brand);
  display: grid; place-items: center; font-weight: 700; font-size: .9rem; letter-spacing: .02em; overflow: hidden;
}
.asim-logo-mark { width: 32px; height: 32px; flex: 0 0 32px; display: block; object-fit: contain; }
/* The logo sits in the header row: its chosen size, but never taller than the row. */
.brand-logo { display: block; flex: 0 1 auto; min-width: 0; max-width: 100%; max-height: min(var(--logo-h, 40px), 40px); height: auto; object-fit: contain; object-position: left center; }
.ws-button:has(.brand-text) .brand-logo { max-width: 55%; }
.brand-name { font-weight: 700; line-height: 1.2; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: .7rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: color-mix(in srgb, var(--sb-text) 65%, var(--sb-bg)); }
.sidebar-muted { color: color-mix(in srgb, var(--sb-text) 65%, var(--sb-bg)); }

/* Navigation */
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav-side { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.nav-side a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--sb-text); font-weight: 500;
  white-space: nowrap;
}
.nav-side a [data-lucide], .nav-side a svg { flex: 0 0 18px; color: var(--sb-icon); }
.nav-side a:hover { background: color-mix(in srgb, var(--sb-text) 7%, var(--sb-bg)); color: var(--sb-text); }
.nav-side a:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.nav-side a.active { background: var(--sb-active-bg); color: var(--sb-active-text); font-weight: 600; }
.nav-side a.active [data-lucide], .nav-side a.active svg { color: var(--sb-active-text); }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-side a { position: relative; }
.nav-link .nav-badge-inline { display: inline-block; margin-left: 4px; vertical-align: 1px; }
.status-dot-warning { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; margin-left: 4px; vertical-align: 2px; }
.subscribers-aside { background: var(--line-2, #f4f5f7); border-radius: 12px; padding: 18px; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #e5484d; color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Footer: Settings, then the signed-in person, then "Powered by". */
.sidebar-footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--sb-text) 14%, var(--sb-bg)); font-size: .85rem; }
.sidebar-footer .nav-side { font-size: .9375rem; margin-bottom: 8px; }
.profile-button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 10px;
  background: transparent; color: var(--sb-text); text-align: left; min-width: 0;
}
.profile-button:hover, .profile-button[aria-expanded="true"] { background: color-mix(in srgb, var(--sb-text) 7%, var(--sb-bg)); }
.profile-button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.profile-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-role { font-size: .75rem; color: color-mix(in srgb, var(--sb-text) 65%, var(--sb-bg)); }
.profile-more[data-lucide], svg.profile-more { flex: 0 0 auto; color: color-mix(in srgb, var(--sb-text) 60%, var(--sb-bg)); }
.profile-menu { min-width: 216px; }
.ws-menu .dropdown-item, .profile-menu .dropdown-item { display: flex; align-items: center; gap: 8px; }
.sidebar .avatar { width: 34px; height: 34px; flex: 0 0 34px; font-size: .78rem; background: color-mix(in srgb, var(--sb-text) 11%, var(--sb-bg)); color: var(--sb-text); }
.sidebar-powered { text-align: center; font-size: .72rem; padding-top: 8px; color: color-mix(in srgb, var(--sb-text) 60%, var(--sb-bg)); }
/* The sidebar's own text color, not the brand's: a brand color can disappear against a custom background. */
.sidebar-powered strong { color: var(--sb-text); font-weight: 700; }

/* Collapsed (desktop): 68px of icons. Labels become tooltips (see app.js). */
@media (min-width: 992px) {
  html.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-w); flex-basis: var(--sidebar-collapsed-w); padding: 14px 8px 12px; }
  html.sidebar-collapsed .sidebar .ws-text,
  html.sidebar-collapsed .sidebar .ws-chevron,
  html.sidebar-collapsed .sidebar .nav-label,
  html.sidebar-collapsed .sidebar .profile-text,
  html.sidebar-collapsed .sidebar .profile-more,
  html.sidebar-collapsed .sidebar .sidebar-powered { display: none; }
  html.sidebar-collapsed .sidebar .ws-button,
  html.sidebar-collapsed .sidebar .nav-side a,
  html.sidebar-collapsed .sidebar .profile-button { justify-content: center; padding-left: 0; padding-right: 0; }
  html.sidebar-collapsed .sidebar .nav-badge { position: absolute; top: 2px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px; font-size: .62rem; line-height: 16px; }
  html.sidebar-collapsed .sidebar .brand-logo { max-width: 40px; max-height: 32px; object-position: center; }
}

/* Settings → Appearance */
.appearance-section + .appearance-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 767.98px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.theme-card {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease;
}
.theme-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.theme-card:has(.theme-radio:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .16); }
.theme-card:has(.theme-radio:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.theme-radio { position: absolute; opacity: 0; pointer-events: none; }
.theme-card:has(.theme-radio:checked)::after {
  content: ""; position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
/* A thumbnail of the sidebar in the theme's colors. */
.theme-swatch {
  display: grid; gap: 5px; align-content: start; height: 72px; padding: 9px 8px; border-radius: 8px; margin-bottom: 4px;
  background: var(--sw-bg); border: 1px solid color-mix(in srgb, var(--sw-text) 16%, var(--sw-bg));
}
.theme-swatch > span { display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--sw-text) 30%, var(--sw-bg)); }
.theme-swatch .sw-head { width: 55%; height: 8px; background: var(--sw-text); opacity: .85; margin-bottom: 3px; }
.theme-swatch .sw-pill { height: 12px; border-radius: 4px; background: var(--sw-active-bg); box-shadow: inset 3px 0 0 var(--sw-active-text); }
.theme-swatch .sw-short { width: 60%; }
.theme-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--ink); }
.theme-desc { font-size: .75rem; line-height: 1.35; color: var(--muted); }
.theme-options { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
/* `hidden` must beat Bootstrap's .row and friends, or a Light owner sees Custom's pickers. */
.theme-options [hidden] { display: none !important; }
.theme-options-part { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.primary-preview { display: flex; align-items: center; gap: 10px; margin-top: 12px; width: var(--sidebar-w); pointer-events: none; }

/* Settings → Appearance live preview */
.sidebar-preview { position: static !important; transform: none !important; margin: 0; height: 520px; width: var(--sidebar-w); box-shadow: var(--shadow); pointer-events: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-weight: 600;
  color: var(--ink-2); font-size: .8rem; flex: 0 0 32px;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; background: rgba(250, 251, 251, .92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line); padding: 12px 28px; display: flex; gap: 12px; align-items: center;
}
.search-box { position: relative; flex: 1; max-width: 460px; }
.search-box [data-lucide], .search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 38px; border-radius: 10px; background: var(--surface); }
.usage-pill-slot { margin-left: auto; }
.usage-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px 6px 10px; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); text-decoration: none; line-height: 1.1;
}
.usage-pill:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.usage-pill-body { display: grid; grid-template-columns: auto 56px; column-gap: 8px; align-items: center; }
.usage-pill-label { grid-column: 1 / -1; font-size: .62rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.usage-pill-value { font-size: .85rem; font-weight: 600; color: var(--bs-body-color); font-variant-numeric: tabular-nums; }
.usage-pill-value span { color: var(--muted); font-weight: 500; }
.usage-pill-bar { height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--muted) 20%, transparent); overflow: hidden; }
.usage-pill-bar span { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.usage-pill.is-warn .usage-pill-bar span { background: #e0a100; }
.usage-pill.is-full { border-color: #f1b5b5; }
.usage-pill.is-full .usage-pill-bar span { background: #d63939; }
@media (max-width: 575.98px) {
  .usage-pill { padding: 6px 9px; }
  .usage-pill-label, .usage-pill-bar { display: none; }
  .usage-pill-body { display: block; }
}
.content { padding: 28px; max-width: 1320px; width: 100%; margin: 0 auto; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed; left: 0; top: 0; margin: 0; height: 100vh; height: 100dvh; border-width: 0 1px 0 0; border-radius: 0 16px 16px 0;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 10px 40px rgba(0,0,0,.12);
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 20, 25, .35); z-index: 1030; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px; }
}

/* ---------- Page header ---------- */
.page-header { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-subtitle { color: var(--muted); margin: 2px 0 0; }
.breadcrumb-lite { font-size: .8125rem; color: var(--muted); margin-bottom: 4px; }
.breadcrumb-lite a { color: var(--muted); }
.breadcrumb-lite a:hover { color: var(--ink); }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-header h2, .card-title-sm { font-size: 1rem; font-weight: 600; margin: 0; }
.card-body { padding: 20px; }
.section-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }

.stat-card { padding: 18px 20px; display: flex; gap: 14px; align-items: center; height: 100%; color: inherit; transition: border-color .15s; }
a.stat-card:hover { border-color: #cfd4d9; }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); flex: 0 0 42px; }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.amber { background: #fff7e6; color: #b45309; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .85rem; }

/* ---------- Project page ---------- */
.project-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; height: 100%; }
.project-stat .stat-value { font-size: 1.35rem; }
.project-hint { display: flex; align-items: center; gap: 5px; }
.project-hint[hidden] { display: none; }
.quote-earlier tr { background: var(--canvas); }
.quote-earlier td { font-size: .875rem; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn-sm { border-radius: 8px; }
.btn-primary {
  --bs-btn-color: var(--on-brand); --bs-btn-hover-color: var(--on-brand); --bs-btn-active-color: var(--on-brand);
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-700); --bs-btn-hover-border-color: var(--brand-700);
  --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
.btn-light { --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--line-2); --bs-btn-hover-border-color: #d5dade; --bs-btn-color: var(--ink); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-700); }
.btn-icon { padding: 6px; width: 34px; height: 34px; }
.btn-lg-action { padding: 10px 18px; font-size: .95rem; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: var(--line); padding: .5rem .75rem; }
/* Keep room for the dropdown arrow, which the shared padding above would otherwise cover. */
.form-select { padding-right: 2.25rem; background-position: right .75rem center; }
.form-select-sm { padding: .3rem 2rem .3rem .6rem; background-position: right .5rem center; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .15); }
.form-control-sm, .form-select-sm { border-radius: 8px; }
.form-label { font-weight: 500; font-size: .85rem; color: var(--ink-2); margin-bottom: 5px; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: #b42318; font-size: .8125rem; }
.ts-wrapper.form-select { padding: 0 !important; border: 0; }
.ts-wrapper .ts-control, .ts-wrapper.form-select .ts-control, .ts-wrapper.single.input-active .ts-control { border: 1px solid var(--line) !important; border-radius: 10px !important; background: var(--surface) !important; min-height: 40px; padding: .45rem .75rem !important; }
.ts-wrapper.form-select.focus .ts-control, .ts-wrapper.focus .ts-control { border-color: var(--brand) !important; box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .15) !important; }
.ts-wrapper.form-select.invalid:not(.focus) .ts-control { border-color: var(--line) !important; box-shadow: none !important; }
select:disabled.form-select { background-color: var(--canvas); color: var(--muted); }
.ts-dropdown { border-radius: 10px; border-color: var(--line); box-shadow: 0 10px 30px rgba(16,24,40,.08); }
.ts-dropdown .active { background: var(--brand-50); color: var(--ink); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: 12px 16px; border-bottom-color: var(--line-2); }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f8faf9; }
.table tbody tr:last-child td { border-bottom: 0; }
tr.row-link { cursor: pointer; }
.doc-number { font-weight: 600; color: var(--ink); white-space: nowrap; }
.doc-number:hover { color: var(--brand); }
.cell-sub { font-size: .8rem; color: var(--muted); }

/* ---------- Status badges ---------- */
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-secondary { background: #f1f3f5; color: #59636e; }
.status-info { background: #eaf2fe; color: #1d5fc4; }
.status-success { background: var(--success-bg); color: var(--success); }
.status-danger { background: #fdecec; color: #b42318; }
.status-warning { background: #fff5e0; color: #a15c07; }
.status-dark { background: #eceef0; color: #30363d; text-decoration: line-through; }
.tag { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); }
.tag-green { background: var(--success-bg); color: var(--success); }
.tag-red { background: #fdecec; color: #b42318; }

/* ---------- Filters ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.filter-bar .form-control, .filter-bar .form-select { font-size: .875rem; }
.filter-bar .grow { flex: 1 1 220px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state [data-lucide], .empty-state svg { width: 36px; height: 36px; color: #c2c8ce; margin-bottom: 10px; }

/* ---------- Tabs ---------- */
.nav-underline { gap: 22px; border-bottom: 1px solid var(--line); padding: 0 20px; }
.nav-underline .nav-link { color: var(--muted); padding: 14px 0; font-weight: 500; border-bottom-width: 2px; }
.nav-underline .nav-link.active, .nav-underline .nav-link:hover { color: var(--ink); }
.nav-underline .nav-link.active { border-bottom-color: var(--brand); }
.count-pill { font-size: .7rem; background: var(--line-2); border-radius: 999px; padding: 1px 7px; margin-left: 4px; color: var(--ink-2); }

/* ---------- Document view ---------- */
.doc-meta dt { font-size: .75rem; color: var(--muted); font-weight: 500; }
.doc-meta dd { margin-bottom: 12px; white-space: pre-line; }
.totals { max-width: 360px; margin-left: auto; }
.totals-row { display: flex; justify-content: space-between; padding: 6px 0; font-variant-numeric: tabular-nums; }
.totals-row.grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-weight: 700; font-size: 1.15rem; }
.prewrap { white-space: pre-line; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: center; }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: #d0d5da; flex: 0 0 10px; }
.timeline .dot.approved { background: var(--success); box-shadow: 0 0 0 4px var(--success-bg); }
.timeline li.current { font-weight: 600; }

/* Activity: the history card on estimates, jobs and invoices */
.activity-list { list-style: none; margin: 0; padding: 6px 16px 10px; }
.activity-item { position: relative; display: flex; gap: 10px; padding: 7px 0; }
.activity-item:not(:last-child)::before { content: ""; position: absolute; left: 11px; top: 30px; bottom: -7px; width: 1px; background: var(--line); }
.activity-icon { width: 23px; height: 23px; flex: 0 0 23px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2, #f2f4f7); color: var(--muted, #6b737b); }
.activity-item.success .activity-icon { background: var(--success-bg); color: var(--success); }
.activity-item.danger .activity-icon { background: #fdecec; color: #b42318; }
.activity-item.warning .activity-icon { background: #fff4e5; color: #b54708; }
.activity-body { min-width: 0; display: flex; flex-direction: column; font-size: .84rem; line-height: 1.35; }
.activity-meta { font-size: .74rem; color: var(--muted, #6b737b); margin-top: 2px; }

/* Schedule: approved estimates that have no job yet */
.ready-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; padding: 12px 16px 16px; }
.ready-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px dashed rgba(var(--brand-rgb), .45); border-radius: 10px; background: rgba(var(--brand-rgb), .04); }
.ready-item .btn { white-space: nowrap; flex: 0 0 auto; }
.ready-title { font-weight: 600; font-size: .88rem; }

/* Profitability report chart */
.margin-chart { width: 100%; height: auto; display: block; }
.margin-chart .grid-line { stroke: var(--line); stroke-width: 1; }
.margin-chart .zero-line { stroke: #b9bdc3; stroke-width: 1; }
.margin-chart .axis-label { font-size: 10px; fill: var(--muted); }
.margin-chart .bar.good { fill: #2bb86b; }
.margin-chart .bar.ok { fill: #f5a524; }
.margin-chart .bar.bad { fill: #d93b3b; }
.margin-chart .target-line { stroke: var(--ink, #16213a); stroke-width: 1.5; stroke-dasharray: 5 4; }
.margin-chart .target-label { font-size: 10.5px; font-weight: 600; fill: var(--ink, #16213a); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
/* Interactive version (static/js/margin-chart.js) */
.margin-chart-wrap { position: relative; }
.margin-chart .axis-label { font-size: 11px; }
.margin-chart .bar-hit { cursor: pointer; outline: none; }
.margin-chart .bar-zone { fill: transparent; }
.margin-chart .bar { transition: opacity .15s ease, filter .15s ease; }
.margin-chart .bar.planned { fill-opacity: .55; }
.margin-chart.has-focus .bar-hit:not(.is-active) .bar { opacity: .3; }
.margin-chart .bar-hit.is-active .bar-zone { fill: rgba(22, 33, 58, .04); }
.margin-chart .bar-hit.is-active .bar { filter: brightness(1.06); }
.margin-chart .bar-hit:focus-visible .bar { stroke: var(--ink); stroke-width: 2px; }
.chart-tip { position: absolute; z-index: 5; min-width: 210px; max-width: 260px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .12); pointer-events: none; font-size: .8rem; color: var(--ink-2); }
.chart-tip-value { font-size: 1.25rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.chart-tip-head { margin: 2px 0 8px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-tip-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.chart-tip-row strong { color: var(--ink); }
.chart-tip-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: .72rem; }
.chart-metric .btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
tr.chart-linked > td { background: rgba(22, 33, 58, .045); }
@media (prefers-reduced-motion: reduce) { .margin-chart .bar { transition: none; } }
.chart-key { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.chart-key.good { background: #2bb86b; } .chart-key.ok { background: #f5a524; } .chart-key.bad { background: #d93b3b; }
.chart-key.planned { opacity: .55; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-variant-numeric: tabular-nums; }
.kv + .kv { border-top: 1px solid var(--line-2); }
.kv.strong { font-weight: 700; }
.internal-card { border-style: dashed; background: #fcfcfd; }
.internal-card .card-header { color: var(--ink-2); }

/* ---------- Builder ---------- */
.builder-table { table-layout: fixed; min-width: 760px; }
.builder-table td { vertical-align: top; padding: 8px 6px !important; }
.builder-table th { padding: 10px 6px !important; }
.builder-table .col-desc { width: auto; }
.builder-table .col-qty { width: 92px; }
.builder-table .col-unit { width: 96px; }
.builder-table .col-price { width: 124px; }
.builder-table .col-cost { width: 118px; }
.builder-table .col-amount { width: 120px; }
.builder-table .col-remove { width: 44px; }
.builder-table .amount-cell { padding-top: 16px !important; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.builder-table .form-control { padding: .45rem .6rem; }
.cost-col { display: none; }
.show-costs .cost-col { display: table-cell; }
.cost-col .form-control { background: #fbfbf4; border-style: dashed; }
.line-row.removed { display: none; }
/* Service picker for line item descriptions (static/js/builder.js) */
.service-menu {
  position: fixed; z-index: 1060; max-height: 288px; overflow-y: auto; padding: 4px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
}
.service-option {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 10px;
  border-radius: 8px; cursor: pointer; color: var(--ink);
}
.service-option.active { background: var(--brand-50); }
.service-option-name { font-weight: 500; overflow-wrap: anywhere; }
.service-option-name mark { padding: 0; background: transparent; color: inherit; font-weight: 700; }
.service-option-meta { flex: 0 0 auto; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Disclaimers (templates/billing/_disclaimers.html, static/js/disclaimers.js) */
.disclaimer-list { list-style: none; margin: 0; padding: 0; }
.disclaimer-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.disclaimer-item:last-child { border-bottom: 0; }
.disclaimer-text {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--muted); font-size: .82rem; white-space: pre-line;
}
.min-w-0 { min-width: 0; }
.disclaimer-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .85rem;
  border: 1px solid var(--line); color: var(--ink-2); background: var(--surface);
}
.filter-chip span { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.filter-chip:hover { border-color: #cfd4d9; color: var(--ink); }
.filter-chip.active { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); font-weight: 600; }
.filter-chip.active span { color: var(--brand-700); }
.disclaimer-group { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 0; margin: 0; }
.disclaimer-group-head { display: flex; align-items: center; gap: 8px; width: 100%; float: none; padding: 8px 14px; margin: 0; font-size: .95rem; }
.disclaimer-group-head .form-check-input { margin: 0; }
.disclaimer-option { display: flex; gap: 10px; align-items: flex-start; padding: 8px 14px 8px 36px; cursor: pointer; }
.disclaimer-option:hover { background: var(--canvas); }
.disclaimer-option .form-check-input { margin-top: 3px; flex: 0 0 auto; }
.sticky-actions {
  position: sticky; bottom: 0; background: rgba(255,255,255,.95); backdrop-filter: blur(6px); border-top: 1px solid var(--line);
  padding: 12px 28px; margin: 24px -28px -28px; display: flex; justify-content: flex-end; gap: 10px; z-index: 10;
}
@media (max-width: 991.98px) { .sticky-actions { margin: 20px -16px -18px; padding: 12px 16px; } }

.pdf-frame { width: 100%; height: 78vh; border: 0; border-radius: 0 0 var(--radius) var(--radius); background: #525659; }
.modal-content { border-radius: var(--radius); border: 0; }
.alert { border-radius: var(--radius-sm); }

/* ---------- ASIM product identity (from static/img/logo.png) ---------- */
.asim-theme {
  --asim-navy: #0F2344;      /* deep navy, for text */
  --asim-navy-2: #0A2959;
  --asim-blue: #345D9F;      /* the secondary blue */
  --asim-orange: #FD5903;
  --asim-orange-light: #FF7A1F;
  --asim-orange-deep: #E24C00;
  --asim-slate: var(--asim-blue);
  --brand: var(--asim-orange);
  --brand-rgb: 253, 89, 3;
  --brand-700: #E4580F;
  --brand-50: #FFF4EA;
  --brand-100: #FFE3CC;
  --on-brand: #FFFFFF;
  --ink: var(--asim-navy);
  --ink-2: #4B5566;
}

/* ---------- Sign-in & password reset (centered card) ---------- */
.auth-body { background: #fff; min-height: 100vh; display: flex; flex-direction: column; }
.auth-page { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 60px 16px 40px; }
.auth-card {
  width: 100%; max-width: 400px; background: #fff; border: 1px solid #e3e5e8; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(22, 28, 41, .08); padding: 36px 32px 30px;
}
.auth-card-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; }
.auth-card-logo img { width: 56px; height: 56px; object-fit: contain; }
.auth-card-title { font-size: 1.3rem; font-weight: 600; text-align: center; color: var(--asim-navy); margin: 0 0 26px; letter-spacing: -.01em; }
.auth-card-text { text-align: center; color: var(--ink-2); font-size: .92rem; margin: -12px 0 24px; }
.auth-tabs { display: flex; justify-content: center; margin: 0 0 28px; }
.auth-tab { padding: 0 24px 9px; font-size: 1rem; color: var(--asim-navy); border-bottom: 3px solid var(--asim-orange-deep); }
.auth-field { height: 44px; border-radius: 4px; border: 1px solid #8d9096; font-size: 1rem; padding: 0 10px; margin-bottom: 16px; }
.auth-field::placeholder { color: #6b6c72; }
.auth-field:focus { border-color: var(--asim-orange-deep); box-shadow: 0 0 0 3px rgba(226, 76, 0, .15); }
.auth-label-sm { display: block; font-size: .85rem; font-weight: 600; color: var(--asim-navy); margin-bottom: 6px; }
.auth-password { position: relative; }
.auth-password .auth-field { padding-right: 46px; }
.auth-eye { position: absolute; right: 4px; top: 22px; transform: translateY(-50%); border: 0; background: transparent; color: #6b6c72; padding: 8px; border-radius: 6px; line-height: 0; }
.auth-eye:hover, .auth-eye:focus-visible { color: var(--asim-navy); background: #f1f2f4; }
.auth-row { margin: 2px 0 20px; }
.auth-check .form-check-input { width: 20px; height: 20px; margin-top: 0; border-radius: 4px; border-color: #8d9096; }
.auth-check .form-check-input:checked { background-color: var(--asim-orange-deep); border-color: var(--asim-orange-deep); }
.auth-check .form-check-input:focus { box-shadow: 0 0 0 3px rgba(226, 76, 0, .2); border-color: var(--asim-orange-deep); }
.auth-check .form-check-label { color: #4b4c52; font-size: .92rem; margin-left: 6px; line-height: 20px; }
.auth-link { font-size: .88rem; font-weight: 500; color: var(--asim-orange-deep); }
.auth-link:hover { color: #C94A10; text-decoration: underline; }
.auth-submit {
  height: 40px; border-radius: 4px; font-weight: 600; font-size: 1rem; color: #fff; border: 0; gap: 8px;
  background: linear-gradient(90deg, var(--asim-orange-light), var(--asim-orange-deep));
  display: flex; align-items: center; justify-content: center;
}
.auth-submit:hover, .auth-submit:focus { background: linear-gradient(90deg, #F48A0F, #D94A00); color: #fff; }
.auth-google {
  height: 40px; border-radius: 4px; font-weight: 600; font-size: .95rem; color: var(--asim-navy); gap: 10px;
  background: #fff; border: 1px solid #8d9096; display: flex; align-items: center; justify-content: center;
}
.auth-google:hover, .auth-google:focus { background: #f6f7f8; border-color: var(--asim-navy); color: var(--asim-navy); }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #6b6c72; font-size: .8rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid #e3e5e8; }
.auth-captcha { display: flex; justify-content: center; margin: 0 0 16px; min-height: 78px; }  /* the widget's height, so the form doesn't jump */
.auth-code { text-align: center; font-size: 1.35rem; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.auth-buy-button { display: flex; justify-content: center; min-height: 60px; }
.auth-fineprint { font-size: .8rem; color: #6b6c72; text-align: center; margin: 22px 0 0; padding-top: 20px; border-top: 1px solid #e3e5e8; line-height: 1.5; }
.auth-error { color: #b42318; font-size: .82rem; margin: -10px 0 14px; }
.auth-hint { color: #6b6c72; font-size: .8rem; margin: -10px 0 4px; }
.auth-field.is-invalid { border-color: #d92d20; }

/* ---------- First-run setup (wider card with steps) ---------- */
.auth-card.onboarding-card { max-width: 560px; }
.onboarding-steps { list-style: none; display: flex; justify-content: center; gap: 8px; padding: 0; margin: 0 0 24px; flex-wrap: wrap; }
.onboarding-steps li { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: #6b6c72; }
.onboarding-steps li + li::before { content: ""; width: 28px; height: 1px; background: #d5d8dc; margin-right: 4px; }
.onboarding-step-dot {
  width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1px solid #c4c8cd; font-weight: 600; font-size: .8rem; background: #fff;
}
.onboarding-steps li.current { color: var(--asim-navy); font-weight: 600; }
.onboarding-steps li.current .onboarding-step-dot { border-color: var(--asim-orange-deep); color: var(--asim-orange-deep); }
.onboarding-steps li.done .onboarding-step-dot { background: var(--asim-orange-deep); border-color: var(--asim-orange-deep); color: #fff; }
.onboarding-logo {
  min-height: 110px; border: 1px dashed #c4c8cd; border-radius: 8px; display: grid; place-items: center;
  padding: 12px; color: #6b6c72; font-weight: 600; background: #fafbfb; text-align: center;
}
.onboarding-logo img { max-height: 86px; max-width: 100%; object-fit: contain; }
.onboarding-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.onboarding-card .form-label { font-size: .85rem; font-weight: 600; color: var(--asim-navy); }
@media (max-width: 480px) {
  .onboarding-steps { flex-wrap: nowrap; gap: 4px; }
  .onboarding-steps li { font-size: .78rem; gap: 5px; }
  .onboarding-steps li + li::before { width: 10px; margin-right: 1px; }
}
.auth-footer { text-align: center; font-size: .8rem; color: #6b6c72; padding: 24px 16px 28px; display: grid; gap: 6px; }
@media (max-width: 480px) {
  .auth-page { padding-top: 24px; }
  .auth-card { border: 0; box-shadow: none; padding: 24px 8px; }
}

.notice { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; font-size: .9rem; color: var(--ink-2); }

/* ---------- Collapsible side cards (static/js/app.js) ---------- */
.collapsible-card > .card-header { cursor: pointer; user-select: none; }
.collapsible-card > .card-header h2 { margin-right: auto; }
.card-collapse-toggle { border: 0; background: transparent; color: var(--muted); border-radius: 8px; width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 28px; margin-right: -6px; }
.card-collapse-toggle:hover, .card-collapse-toggle:focus-visible { background: var(--line-2); color: var(--ink); }
.card-collapse-toggle [data-lucide], .card-collapse-toggle svg { transition: transform .15s ease; }
.collapsible-card.is-collapsed > .card-header { border-bottom: 0; }
.collapsible-card.is-collapsed > :not(.card-header) { display: none !important; }
.collapsible-card.is-collapsed .card-collapse-toggle [data-lucide], .collapsible-card.is-collapsed .card-collapse-toggle svg { transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) { .card-collapse-toggle svg { transition: none; } }

/* ---------- Profitability (internal) ---------- */
.profit-badge { display: inline-flex; align-items: center; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.profit-badge.sm { font-size: .62rem; padding: 0 6px; }
.profit-badge.on_target { background: var(--success-bg); color: var(--success); }
.profit-badge.below_target { background: #FEF0C7; color: #B54708; }
.profit-badge.below_minimum { background: #FEE4E2; color: #B42318; }
.profit-badge.loss { background: #B42318; color: #fff; }
.profit-hint { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #FFFAEB; color: #7A4A06; font-size: .8rem; }
.line-margin { font-size: .68rem; font-weight: 600; margin-top: 3px; text-align: right; color: var(--muted); }
.line-margin.on_target { color: var(--success); }
.line-margin.below_target { color: #B54708; }
.line-margin.below_minimum, .line-margin.loss { color: #B42318; }

.pay-status { display: inline-block; margin-top: 2px; font-size: .68rem; font-weight: 600; padding: 0 7px; border-radius: 999px; }
.pay-status.paid { background: var(--success-bg); color: var(--success); }
.pay-status.due { background: #FEF0C7; color: #B54708; }
.pay-status.awaiting_customer { background: var(--line-2); color: var(--ink-2); }
.labor-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.labor-table th, .labor-table td { padding: 8px 6px; }

/* ---------- Messages dialog (templates/partials/_messages_modal.html) ---------- */
.message-modal .modal-dialog { max-width: 440px; }
.message-modal .modal-content { overflow: hidden; }
.message-modal-head { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 28px 4px; text-align: center; }
.message-modal-head .modal-title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.message-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; }
.message-icon [data-lucide], .message-icon svg { width: 26px; height: 26px; }
.message-icon.success { background: var(--success-bg); color: var(--success); }
.message-icon.error { background: #FEE4E2; color: #B42318; }
.message-icon.warning { background: #FEF0C7; color: #B54708; }
.message-icon.info { background: var(--brand-50); color: var(--brand-700); }
.message-modal-body { padding: 8px 28px 4px; text-align: center; color: var(--ink-2); }
.message-text { margin: 0 0 8px; overflow-wrap: anywhere; }
.message-modal-body .message-text:only-child { font-size: .95rem; }
.message-modal-body:has(.message-text + .message-text) { text-align: left; }
.message-modal-body:has(.message-text + .message-text) .message-text { display: flex; gap: 8px; }
.message-modal-body .message-text [data-lucide], .message-modal-body .message-text svg { flex: 0 0 auto; margin-top: 3px; }
.message-success { color: var(--success); }
.message-error { color: #B42318; }
.message-warning { color: #B54708; }
.message-info { color: var(--brand-700); }
.message-modal-foot { display: flex; justify-content: center; padding: 14px 28px 24px; }
.message-icon.sm { width: 30px; height: 30px; flex: 0 0 30px; }
.message-icon.sm [data-lucide], .message-icon.sm svg { width: 17px; height: 17px; }
.app-toast { width: 380px; max-width: calc(100vw - 32px); padding: 12px 12px 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 12px 32px rgba(16, 24, 40, .14); background: var(--surface); }
.app-toast-text { color: var(--ink); font-size: .9rem; padding-top: 4px; overflow-wrap: anywhere; }
.app-toast-text + .app-toast-text { margin-top: 4px; }
.app-toast .btn-close { flex: 0 0 auto; font-size: .7rem; margin-top: 6px; }

/* ---------- Pagination (templates/partials/_pagination.html) ---------- */
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
.pager-card .pager { border-top: 0; }
.pager-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: .85rem; color: var(--muted); }
.pager-summary strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pager-size .form-select { width: auto; min-width: 9rem; }
.pager .pagination { gap: 4px; }
.pager .page-link { min-width: 32px; text-align: center; border-radius: 8px !important; border-color: var(--line); color: var(--ink-2); }
.pager .page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.pager .page-link:hover { background: var(--brand-50); color: var(--brand-700); }

.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* ---------- Schedule ---------- */
.icon-xs[data-lucide], svg.icon-xs { width: 12px; height: 12px; vertical-align: -1px; }
.crew-dots { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.crew-dot {
  width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff;
  font-size: .62rem; font-weight: 700; letter-spacing: .02em; flex: 0 0 auto; box-shadow: 0 0 0 2px #fff;
}
.crew-dot.lg { width: 34px; height: 34px; font-size: .78rem; }
.crew-dot.lead { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--ink); }
.unstaffed { font-size: .7rem; color: #b42318; font-weight: 600; }

.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day-col { border-right: 1px solid var(--line); min-height: 460px; display: flex; flex-direction: column; min-width: 0; }
.day-col:last-child { border-right: 0; }
.day-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 8px; border-bottom: 1px solid var(--line-2); }
.day-name { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.day-num { font-weight: 700; font-size: 1.05rem; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.is-today .day-num { background: var(--brand); color: var(--on-brand); }
.day-add { margin-left: auto; color: var(--muted); border-radius: 8px; padding: 2px 4px; opacity: .55; }
.day-add:hover { background: var(--brand-50); color: var(--brand); opacity: 1; }
.day-jobs { padding: 8px; display: grid; gap: 6px; align-content: start; }
.day-empty { font-size: .75rem; color: #b7bdc3; text-align: center; padding: 14px 0; }
.is-today .day-jobs { background: rgba(var(--brand-rgb), .025); flex: 1; }

.job-chip {
  display: grid; gap: 2px; padding: 7px 8px 7px 10px; border-radius: 9px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-left: 4px solid var(--chip-color, var(--brand)); font-size: .78rem; line-height: 1.25;
  transition: box-shadow .15s, transform .15s; min-width: 0;
}
.job-chip:hover { color: var(--ink); box-shadow: 0 4px 14px rgba(16, 24, 40, .08); transform: translateY(-1px); }
.job-chip-time { font-size: .68rem; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-chip-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.job-chip-sub { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-chip .crew-dots { margin-top: 3px; }
.job-chip.compact { padding: 5px 6px 5px 8px; font-size: .72rem; }
.job-chip.compact .crew-dot { width: 18px; height: 18px; font-size: .55rem; }
/* Job status: the card color changes as soon as a job is started, completed or cancelled. */
.job-chip-status { display: inline-flex; align-items: center; gap: 5px; justify-self: start; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 999px; }
.job-chip.job-in_progress { background: #FFF4E0; border-color: #F6C77E; border-left-color: #D97706; }
.job-chip.job-in_progress .job-chip-status { background: #FDE3B5; color: #92400E; }
.job-chip.job-completed { background: #ECFDF3; border-color: #ABE3C3; border-left-color: #067647; }
.job-chip.job-completed .job-chip-status { background: #D1FADF; color: #05603A; }
.job-chip.job-cancelled { background: #F3F4F6; border-color: var(--line); border-left-color: #9AA1A9; color: var(--muted); }
.job-chip.job-cancelled .job-chip-title { text-decoration: line-through; }
.job-chip.job-cancelled .job-chip-status { background: #E5E7EB; color: #4B5563; }
/* Vendor Network visits: dashed while only accepted, solid once confirmed, red when at risk. */
.job-chip.job-network { background: #F6F3FF; border-color: #D9D0FC; }
.job-chip.job-net-pending { border-style: dashed; }
.job-chip.job-net-pending .job-chip-status { background: #EBE4FF; color: #5925DC; }
.job-chip.job-net-confirmed .job-chip-status { background: #D1FADF; color: #05603A; }
.job-chip.job-net-at_risk { background: #FEF3F2; border-color: #FDA29B; border-left-color: #D92D20; }
.job-chip.job-net-at_risk .job-chip-status { background: #FEE4E2; color: #B42318; }
.job-chip-provider { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 600; color: #5925DC; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #D97706; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, .55); } 50% { box-shadow: 0 0 0 4px rgba(217, 119, 6, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.status-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.filter-chip .status-swatch { width: 8px; height: 8px; border-radius: 50%; }
.status-swatch.scheduled { background: var(--brand); }
.status-swatch.in_progress { background: #D97706; }
.status-swatch.completed { background: #067647; }
.status-swatch.cancelled { background: #9AA1A9; }
.day-jobs { max-height: 640px; overflow-y: auto; }

.team-board { table-layout: fixed; min-width: 980px; }
.team-board th { text-align: left; }
.team-board th.is-today { color: var(--brand); }
.team-board .member-col { width: 200px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.board-cell { vertical-align: top; position: relative; padding: 6px !important; border-left: 1px solid var(--line-2); }
.board-cell .job-chip + .job-chip { margin-top: 4px; }
.cell-add { display: block; text-align: center; color: var(--muted); border-radius: 6px; padding: 2px; margin-top: 4px; opacity: 0; }
.board-cell:hover .cell-add { opacity: 1; background: var(--brand-50); color: var(--brand); }
.unassigned-row td { background: #fff8f7; }
.individual-row td { background: var(--canvas); }

.crew-grid { display: grid; gap: 8px; max-height: 440px; overflow-y: auto; padding-right: 2px; }
.crew-choices { max-height: 260px; overflow-y: auto; }
.scroll-list { max-height: 420px; overflow-y: auto; padding-right: 2px; }
.crew-option { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; transition: border-color .15s, background .15s; }
.crew-option.selected { border-color: var(--brand); background: var(--brand-50); }
.crew-option.busy:not(.selected) { background: #fffdf7; }
.crew-check { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; margin: 0; }
.crew-check .form-check-input { margin: 0; flex: 0 0 auto; }
.busy-note { font-size: .72rem; color: #a15c07; font-weight: 600; }
.free-note { font-size: .72rem; color: var(--success); }
.lead-toggle { font-size: .75rem; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; margin: 0; }

@media (max-width: 991.98px) {
  .week-grid { grid-template-columns: 1fr; }
  .day-col { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; }
  .day-empty { display: none; }
}

/* ---------- Teams ---------- */
.crew-tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--crew-color, var(--brand)) 12%, white); color: color-mix(in srgb, var(--crew-color, var(--brand)) 80%, black);
  border: 1px solid color-mix(in srgb, var(--crew-color, var(--brand)) 28%, white); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.crew-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--crew-color, var(--brand)); flex: 0 0 7px; }
.crew-tag.sm { font-size: .64rem; padding: 0 6px; justify-self: start; }
.crew-swatch { width: 12px; height: 12px; border-radius: 4px; background: var(--crew-color, var(--brand)); flex: 0 0 12px; }
.crew-swatch.lg { width: 30px; height: 30px; border-radius: 9px; flex-basis: 30px; }
.crew-card { border-top: 4px solid var(--crew-color, var(--brand)); }
.crew-choices { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.crew-choice { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; margin: 0; }
.crew-choice input { flex: 0 0 auto; accent-color: var(--brand); }
.crew-choice.selected { border-color: var(--crew-color, var(--brand)); background: color-mix(in srgb, var(--crew-color, var(--brand)) 8%, white); }
.member-pick-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.member-pick { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; margin: 0; }
.member-pick input { accent-color: var(--brand); }
.member-pick.selected { border-color: var(--brand); background: var(--brand-50); }
.card-tabs { border-bottom: 1px solid var(--line); padding: 0; }

/* ---------- Type-to-search pickers (partials/_search_select.html) ---------- */
.search-select { position: relative; }
.search-select > input[type="text"] { width: 100%; }
.search-select-clear {
  position: absolute; top: 50%; right: 30px; transform: translateY(-50%); border: 0; background: none; line-height: 1;
  font-size: 1.1rem; color: var(--muted); padding: 0 4px; cursor: pointer;
}
.search-select-clear:hover { color: var(--text); }
.search-select-menu {
  position: absolute; z-index: 1060; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 28px rgba(16, 24, 40, .12); padding: 4px;
}
.search-select-option {
  display: block; width: 100%; text-align: left; border: 0; background: none; border-radius: 9px; padding: 7px 10px; cursor: pointer;
}
.search-select-option:hover, .search-select-option.is-active { background: var(--brand-50); }
.search-select-label { display: block; font-size: .86rem; color: var(--text); }
.search-select-sub { display: block; font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-select-empty { padding: 10px; font-size: .82rem; color: var(--muted); }

/* Sign-in: split layout, brand showcase on the left and the form on the right */
.auth-split-body { background: #fff; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--asim-navy); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; text-decoration: none; position: relative; }
.auth-brand img { width: 36px; height: 36px; object-fit: contain; }
.auth-brand:hover { color: var(--asim-navy); }
.auth-eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--asim-orange-deep); margin: 0 0 12px; }
.auth-float-card {
  position: absolute; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .88); border: 1px solid rgba(29, 46, 84, .07); backdrop-filter: blur(6px);
  box-shadow: 0 12px 30px -12px rgba(22, 33, 58, .25); font-size: .85rem; white-space: nowrap;
}
.auth-float-card strong { display: block; color: #16213a; font-weight: 700; }
.auth-float-card small { display: block; color: #6b6c72; font-size: .75rem; }
.auth-float-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 34px; }
.auth-float-icon.green { background: #e7f6ee; color: #178a4c; }
.auth-float-icon.orange { background: #fff1e6; color: #d94a00; }
.auth-float-icon.blue { background: #e9f0fd; color: #2558c4; }

.auth-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.wordmark { font-weight: 800; letter-spacing: .01em; }
.wordmark span { font-weight: 400; }
.auth-brand-text small { font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #6b6c72; margin-top: 3px; }
.auth-panel-foot a { color: inherit; font-weight: 600; text-decoration: none; }
.auth-panel-foot a:hover { color: var(--asim-orange-deep); }
.auth-card-logo-stack { flex-direction: column; gap: 8px; }
.auth-lockup { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.auth-lockup-name { font-size: 1.05rem; font-weight: 800; color: var(--asim-navy); letter-spacing: -.01em; }
.auth-lockup-tag { font-size: .66rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6b6c72; }
.auth-footer a { color: inherit; font-weight: 600; text-decoration: none; }
.auth-footer a:hover { color: var(--asim-orange-deep); }
.auth-panel-inner { width: 100%; max-width: 420px; }
.auth-panel-title { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; color: #16213a; margin: 0 0 6px; }
.auth-panel-text { color: #6b6c72; font-size: .95rem; margin: 0 0 26px; }
.auth-label { display: block; font-size: .85rem; font-weight: 600; color: #26324a; margin-bottom: 6px; }
.auth-panel-foot { text-align: center; font-size: .75rem; color: #8d9096; margin: 28px 0 0; }


/* Landing page (asimcore.com/ for visitors): minimal on purpose */
.landing-body { background: #fff; color: #16213a; }
.landing-body > main { flex: 1; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; max-width: 1080px; width: 100%; margin: 0 auto; padding: 22px 20px; }
.landing-signin { border: 1px solid #d5d8dc; border-radius: 10px; font-weight: 600; color: #16213a; padding: 8px 18px; background: #fff; }
.landing-signin:hover, .landing-signin:focus { border-color: var(--asim-orange-deep); color: var(--asim-orange-deep); background: #fff; }
.landing-hero { max-width: 760px; margin: 0 auto; padding: 64px 20px 40px; text-align: center; }
.landing-hero .auth-eyebrow { margin-bottom: 16px; }
.landing-title { font-size: clamp(2.2rem, 5.4vw, 3.6rem); font-weight: 800; line-height: 1.04; letter-spacing: -.035em; margin: 0 0 18px; }
.landing-title span { background: linear-gradient(90deg, #d94a00, #fd5903 55%, #ff8a3d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing-lede { font-size: 1.08rem; line-height: 1.6; color: #4a5159; max-width: 560px; margin: 0 auto 28px; }
.landing-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.landing-cta { width: auto; padding: 0 28px; height: 48px; display: inline-flex; align-items: center; border-radius: 10px; font-weight: 700; }
.landing-ghost { height: 48px; display: inline-flex; align-items: center; padding: 0 24px; border-radius: 10px; font-weight: 600; color: #16213a; border: 1px solid #d5d8dc; background: #fff; }
.landing-ghost:hover, .landing-ghost:focus { border-color: #16213a; color: #16213a; background: #fff; }
.landing-plan-wrap { padding: 24px 20px 72px; display: flex; justify-content: center; }
.landing-plan { width: 100%; max-width: 400px; border: 1px solid #e3e5e8; border-radius: 18px; padding: 28px; background: #fff; box-shadow: 0 24px 48px -32px rgba(22, 33, 58, .35); }
.landing-plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.landing-plan-head h2 { font-size: 1.1rem; font-weight: 800; margin: 0; }
.landing-plan-tag { font-size: .75rem; color: #6b6c72; }
.landing-price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 18px; }
.landing-price span { font-size: .95rem; font-weight: 500; color: #6b6c72; letter-spacing: 0; }
.landing-features { list-style: none; padding: 18px 0 0; margin: 0 0 24px; border-top: 1px solid #eef0f2; display: grid; gap: 10px; }
.landing-features li { display: flex; align-items: center; gap: 10px; font-size: .92rem; color: #26324a; }
.landing-features li::before {
  content: ""; width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%; background: #fff1e6
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23e8520f' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center no-repeat;
}
.landing-plan .auth-submit { height: 48px; border-radius: 10px; font-weight: 700; }
.landing-plan-note { font-size: .78rem; color: #6b6c72; text-align: center; margin: 12px 0 0; line-height: 1.5; }
.landing-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; max-width: 1080px; width: 100%; margin: 0 auto; padding: 22px 20px 28px; border-top: 1px solid #eef0f2; font-size: .8rem; color: #6b6c72; }
.landing-foot a { color: inherit; font-weight: 600; text-decoration: none; }
.landing-foot a:hover { color: var(--asim-orange-deep); }
@media (max-width: 575.98px) {
  .landing-nav .auth-brand-text small { display: none; }
  .landing-hero { padding-top: 36px; }
  .landing-foot { justify-content: center; text-align: center; }
}

/* The customer's estimate page (/e/<token>/): the company's brand, readable on a phone first */
.public-doc-body { background: #f4f5f7; }
.public-doc { width: 100%; max-width: 720px; margin: 0 auto; padding: 28px 16px 40px; }
.public-doc-company { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.public-doc-logo { max-height: 52px; max-width: 160px; object-fit: contain; }
.public-doc-company-name { font-size: 1.2rem; font-weight: 800; color: var(--doc-brand-dark); }
.public-doc-company-contact { font-size: .85rem; color: #6b6c72; }
.public-doc-company-contact a { color: inherit; text-decoration: none; }
.public-doc-banner { border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; font-size: .92rem; line-height: 1.5; }
.public-doc-banner.accepted { background: #e7f6ee; color: #145c36; border: 1px solid #bfe5cf; }
.public-doc-banner.declined { background: #fdecec; color: #8a1c14; border: 1px solid #f5c6c2; }
.public-doc-banner.muted { background: #fff; color: #4a5159; border: 1px solid #e3e5e8; }
.public-doc-card { background: #fff; border: 1px solid #e3e5e8; border-radius: 16px; padding: 24px; margin-bottom: 16px; border-top: 4px solid var(--doc-brand); }
.public-doc-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid #eef0f2; }
.public-doc-label { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6b6c72; }
.public-doc-number { font-size: 1.5rem; font-weight: 800; margin: 2px 0 6px; color: #16213a; }
.public-doc-meta { font-size: .88rem; color: #4a5159; line-height: 1.55; }
.public-doc-total { text-align: right; }
.public-doc-amount { font-size: 1.9rem; font-weight: 800; color: var(--doc-brand-dark); letter-spacing: -.02em; }
.public-doc-section { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6b6c72; margin: 22px 0 8px; }
.public-doc-text { font-size: .92rem; color: #26324a; line-height: 1.6; }
.public-doc-text p:last-child { margin-bottom: 0; }
.public-doc-item { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #f1f2f4; }
.public-doc-item-desc { font-size: .93rem; font-weight: 600; color: #16213a; }
.public-doc-item-qty { font-size: .8rem; color: #6b6c72; margin-top: 2px; }
.public-doc-item-amount { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.public-doc-totals { margin: 12px 0 0 auto; max-width: 280px; font-size: .92rem; font-variant-numeric: tabular-nums; }
.public-doc-totals div { display: flex; justify-content: space-between; padding: 4px 0; color: #4a5159; }
.public-doc-totals .grand { border-top: 1px solid #e3e5e8; margin-top: 6px; padding-top: 10px; font-weight: 800; font-size: 1.05rem; color: #16213a; }
.public-doc-terms { margin-top: 18px; border-top: 1px solid #eef0f2; padding-top: 14px; }
.public-doc-terms summary, .public-doc-decline summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: #26324a; }
.public-doc-terms .public-doc-text { margin-top: 10px; font-size: .85rem; }
.public-doc-pdf { display: inline-block; margin-top: 16px; font-size: .88rem; font-weight: 600; color: var(--doc-brand-dark); }
.public-doc-action-title { font-size: 1.15rem; font-weight: 800; margin: 0 0 4px; color: #16213a; }
.public-doc-action-text { font-size: .88rem; color: #6b6c72; margin: 0 0 16px; }
.public-doc-actions .auth-field { border-radius: 10px; border-color: #d5d8dc; }
.public-doc-signature { font-size: 1.15rem; font-style: italic; }
.public-doc-reason { height: auto; padding: 10px; }
.signature-pad { position: relative; margin-top: 14px; }
.signature-pad-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.signature-canvas { display: block; width: 100%; height: 150px; border: 1px dashed #b9bdc3; border-radius: 10px; background: #fbfbfd; touch-action: none; cursor: crosshair; }
.signature-hint { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; font-size: .8rem; color: #9aa0a8; pointer-events: none; }
.signature-image { display: block; max-width: 100%; height: 64px; object-fit: contain; object-position: left; margin-top: 6px; border-bottom: 1px solid var(--line); }
.public-doc-accept { height: 50px; border-radius: 10px; font-weight: 700; color: #fff; background: var(--doc-brand); border: 0; }
.public-doc-accept:hover, .public-doc-accept:focus { background: var(--doc-brand-dark); color: #fff; }
.public-doc-decline { margin-top: 18px; padding-top: 14px; border-top: 1px solid #eef0f2; }
.public-doc-decline form { margin-top: 12px; }
.public-doc-decline-button { height: 44px; border-radius: 10px; font-weight: 600; background: #fff; border: 1px solid #d5d8dc; color: #8a1c14; }
.public-doc-decline-button:hover { border-color: #8a1c14; color: #8a1c14; background: #fff; }
.public-doc-foot { text-align: center; font-size: .75rem; color: #8d9096; margin-top: 8px; }
.public-doc-foot a { color: inherit; font-weight: 700; text-decoration: none; }
@media (max-width: 575.98px) {
  .public-doc-card { padding: 18px; }
  .public-doc-total { text-align: left; }
}

/* Settings → Email: section menu on the left, the section on the right */
.email-settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; }
.email-settings-nav { display: grid; gap: 2px; align-content: start; }
.email-settings-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; font-size: .92rem; text-decoration: none; }
.email-settings-link:hover { background: var(--line-2, #f4f5f7); color: var(--ink, #16213a); }
.email-settings-link.active { background: var(--brand-50, #fff5ed); color: var(--brand-700, #c5661b); font-weight: 600; }
.email-settings-link .status-dot-warning { margin-left: auto; }
.email-preview { background: var(--line-2, #f7f8fa); border-radius: 12px; padding: 16px; }
.email-notify-list .list-group-item { padding: 14px 16px; }
.email-notify-list .form-check-input { width: 2.4em; height: 1.3em; }
.email-usage-value { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.email-usage-value span { font-size: .9rem; font-weight: 500; color: var(--muted, #6b6c72); letter-spacing: 0; }
@media (max-width: 767.98px) {
  .email-settings { grid-template-columns: 1fr; gap: 16px; }
  .email-settings-nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 4px; }
}
.email-mock { border: 1px solid #e6e8eb; border-radius: 12px; overflow: hidden; background: #fff; max-width: 440px; box-shadow: 0 12px 30px -18px rgba(22, 33, 58, .3); }
.email-mock-bar { height: 6px; background: var(--mock-color); }
.email-mock-body { padding: 20px 22px 22px; }
.email-mock-logo { display: block; height: 36px; max-width: 160px; object-fit: contain; margin-bottom: 10px; }
.email-mock-name { font-weight: 800; font-size: 1.05rem; color: var(--mock-color); }
.email-mock-text { font-size: .85rem; color: #4a5159; margin: 10px 0 12px; line-height: 1.5; }
.email-mock-box { display: flex; justify-content: space-between; font-size: .82rem; background: #f8f9fb; border: 1px solid #eceef1; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.email-mock-box strong { color: var(--mock-color); }
.email-mock-button { background: var(--mock-color); color: #fff; text-align: center; font-weight: 700; font-size: .88rem; border-radius: 8px; padding: 10px; }

/* Sign-in, reduced to the form */
.auth-solo { flex: 1; display: flex; justify-content: center; align-items: center; padding: 48px 16px 24px; }
.auth-solo-brand { margin-bottom: 28px; }
.auth-solo .auth-panel-title { font-size: 1.75rem; }
.auth-solo .auth-field { border-radius: 10px; border-color: #d5d8dc; }
.auth-solo .auth-field:hover { border-color: #b9bdc3; }
.auth-solo .auth-google { border-radius: 10px; }
.auth-solo .auth-submit { border-radius: 10px; height: 48px; font-weight: 700; box-shadow: 0 10px 22px -12px rgba(217, 74, 0, .7); }
.auth-solo .auth-row { margin: 0 0 20px; }
.auth-solo-alt { text-align: center; font-size: .88rem; color: #6b6c72; margin: 22px 0 0; }
.auth-split-body > .auth-panel-foot { padding-bottom: 24px; }

/* Landing: the hero takes the sign-in page's old showcase */
.landing-body { position: relative; overflow-x: hidden; }
.landing-glow {
  position: absolute; inset: 0 0 auto 0; height: 720px; pointer-events: none; z-index: -1;
  background:
    radial-gradient(520px 420px at 12% 55%, rgba(253, 89, 3, .16), transparent 70%),
    radial-gradient(600px 460px at 88% 10%, rgba(37, 88, 196, .12), transparent 70%),
    linear-gradient(180deg, #fbfaf8 0%, #fff 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.landing-hero { max-width: 1080px; margin: 0 auto; padding: 56px 20px 48px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: center; text-align: left; }
.landing-hero-text .landing-lede { margin: 0 0 28px; }
.landing-hero-text .landing-actions { justify-content: flex-start; }
.landing-title { font-size: clamp(2.3rem, 5vw, 3.7rem); }
.landing-visual { position: relative; height: 260px; }
.landing-visual .auth-float-card { position: absolute; }
.landing-float-a { top: 8px; left: 4%; transform: rotate(-2deg); }
.landing-float-b { top: 96px; right: 0; transform: rotate(1.5deg); }
.landing-float-c { top: 184px; left: 14%; transform: rotate(-.5deg); }
/* From tablet width up the platform-flow animation (landing-flow.css) takes the hero's visual slot:
   beside the copy on wide screens, under it on tablets. Phones keep the three floating cards,
   since the animation would be too small to read there. */
.landing-demo { display: none; }
@media (min-width: 720px) {
  .landing-visual { display: none; }
  .landing-demo { display: block; min-width: 0; }
  .landing-nav { max-width: 1320px; }
  .landing-hero { max-width: 1320px; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: clamp(24px, 3.5vw, 48px); text-align: left; padding: 32px 24px 64px; }
  .landing-hero-text { max-width: none; margin: 0; }
  .landing-hero-text .landing-title { font-size: clamp(1.9rem, 3.7vw, 3.4rem); }
  .landing-hero-text .landing-lede { margin: 0 0 24px; font-size: clamp(.95rem, 1.3vw, 1.08rem); }
  .landing-hero-text .landing-actions, .landing-trust { justify-content: flex-start; }
}
@media (max-width: 719.98px) {
  .landing-hero { grid-template-columns: 1fr; text-align: center; padding-top: 32px; gap: 28px; }
  .landing-hero-text .landing-actions { justify-content: center; }
  .landing-hero-text .landing-lede { margin-left: auto; margin-right: auto; }
  .landing-visual { height: 220px; max-width: 340px; margin: 0 auto; width: 100%; }
  .landing-float-b { top: 78px; }
  .landing-float-c { top: 156px; left: 6%; }
}

/* Landing: trust line, how it works, questions, closing call */
.landing-trust { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .82rem; color: #6b6c72; }
.landing-trust li { display: flex; align-items: center; gap: 6px; }
.landing-trust li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--asim-orange-deep); }
.landing-steps { max-width: 1080px; margin: 0 auto; padding: 24px 20px 56px; }
.landing-section-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.02em; text-align: center; margin: 0 0 28px; }
.landing-steps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.landing-step { border: 1px solid #eceef1; border-radius: 16px; padding: 22px; background: #fff; }
.landing-step h3 { font-size: 1.05rem; font-weight: 800; margin: 14px 0 6px; }
.landing-step p { font-size: .9rem; color: #4a5159; line-height: 1.55; margin: 0; }
.landing-step-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.landing-step-icon.orange { background: #fff1e6; color: #d94a00; }
.landing-step-icon.blue { background: #e9f0fd; color: #2558c4; }
.landing-step-icon.green { background: #e7f6ee; color: #178a4c; }
.landing-plan-wrap { gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.landing-faq { width: 100%; max-width: 420px; }
.landing-faq-title { font-size: 1.1rem; font-weight: 800; margin: 6px 0 12px; }
.landing-faq details { border-bottom: 1px solid #eceef1; padding: 12px 0; }
.landing-faq summary { cursor: pointer; font-weight: 600; font-size: .95rem; color: #16213a; list-style-position: outside; }
.landing-faq p { font-size: .88rem; color: #4a5159; line-height: 1.55; margin: 8px 0 0; }
.landing-final { text-align: center; padding: 8px 20px 64px; }
.landing-final h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 18px; }
@media (max-width: 767.98px) {
  .landing-steps-grid { grid-template-columns: 1fr; }
  .landing-plan-wrap { padding-bottom: 40px; }
}
@media (max-width: 719.98px) { .landing-trust { justify-content: center; } }

/* Landing "Who it's for" and the public /industries/ pages */
.landing-nav-links { display: flex; align-items: center; gap: 18px; }
.landing-nav-link { font-weight: 600; font-size: .92rem; color: #16213a; text-decoration: none; }
.landing-nav-link:hover, .landing-nav-link:focus { color: var(--asim-orange-deep); }
.landing-foot-links { display: flex; gap: 16px; }
.landing-section-lede { text-align: center; color: #4a5159; max-width: 620px; margin: -14px auto 28px; line-height: 1.6; }
.landing-industries { max-width: 1080px; margin: 0 auto; padding: 24px 20px 56px; }

/* Products: the nav menu (ASIMCORE CRM, ASIMCORE Network) and the landing section about both. */
.landing-products { position: relative; }
.landing-products > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.landing-products > summary::-webkit-details-marker { display: none; }
.landing-products[open] > summary { border-color: var(--asim-orange-deep); color: var(--asim-orange-deep); }
.landing-products[open] > summary svg { transform: rotate(180deg); }
.landing-products-menu { position: absolute; right: 0; top: calc(100% + 8px); width: min(340px, calc(100vw - 32px)); background: #fff; border: 1px solid #e3e5e8; border-radius: 14px; box-shadow: 0 16px 40px rgba(16, 24, 40, .14); padding: 8px; z-index: 50; }
.landing-products-menu a { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 10px; color: #16213a; text-decoration: none; }
.landing-products-menu a:hover, .landing-products-menu a:focus { background: #f6f7f9; }
.landing-products-menu strong { display: block; font-size: .95rem; }
.landing-products-menu small { display: block; font-size: .8rem; color: #6b6c72; line-height: 1.45; margin-top: 2px; }
.landing-product-icon { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; display: grid; place-items: center; }
.landing-product-icon.crm { background: #fff1e6; color: #d94a00; }
.landing-product-icon.net { background: #111418; color: #fff; }
.landing-products-section { max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; }
.landing-products-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.landing-product { border: 1px solid #eceef1; border-radius: 18px; padding: 24px; background: #fff; display: flex; flex-direction: column; }
.landing-product.net { background: #111418; border-color: #111418; color: #fff; }
.landing-product.net .landing-product-icon.net { background: #fd5903; }
.landing-product-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.landing-product-head .landing-product-icon { width: 46px; height: 46px; flex-basis: 46px; border-radius: 13px; }
.landing-product h3 { font-size: 1.25rem; font-weight: 800; margin: 0; color: inherit; }
.landing-product-head p { margin: 2px 0 0; font-size: .9rem; color: #6b6c72; }
.landing-product.net .landing-product-head p { color: #a3a9b1; }
.landing-product ul { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; flex: 1; }
.landing-product li { position: relative; padding-left: 26px; font-size: .95rem; line-height: 1.5; color: #26324a; }
.landing-product.net li { color: #e6e8eb; }
.landing-product li::before { content: ""; position: absolute; left: 0; top: .35em; width: 16px; height: 16px; border-radius: 50%; background: #fff1e6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d94a00' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat; }
.landing-product.net li::before { background-color: rgba(253, 89, 3, .18); }
.landing-product-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.landing-product.net .landing-ghost { background: transparent; color: #fff; border-color: #3a3f46; }
.landing-product.net .landing-ghost:hover { border-color: #fd5903; color: #fff; }
@media (max-width: 767.98px) {
  .landing-products-grid { grid-template-columns: 1fr; }
}
.industry-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.industry-group { border: 1px solid #eceef1; border-radius: 16px; padding: 20px; background: #fff; }
.industry-group-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #fff1e6; color: #d94a00; }
.industry-group h3 { font-size: 1rem; font-weight: 800; margin: 14px 0 10px; }
.industry-group ul, .industry-related { list-style: none; padding: 0; margin: 0; }
.industry-group li { padding: 3px 0; }
.industry-group a, .industry-related a { color: #4a5159; text-decoration: none; font-size: .9rem; }
.industry-group a:hover, .industry-group a:focus { color: var(--asim-orange-deep); text-decoration: underline; }
.landing-more { font-weight: 700; color: var(--asim-orange-deep); text-decoration: none; display: inline-block; margin-top: 24px; }
.landing-more:hover { text-decoration: underline; }
.industry-crumbs { max-width: 1080px; margin: 0 auto; padding: 8px 20px 0; font-size: .82rem; color: #6b6c72; display: flex; flex-wrap: wrap; gap: 8px; }
.industry-crumbs a { color: inherit; text-decoration: none; font-weight: 600; }
.industry-crumbs a:hover { color: var(--asim-orange-deep); }
.industry-hero { max-width: 760px; margin: 0 auto; padding: 40px 20px 32px; text-align: center; }
.industry-hero .landing-lede { margin: 0 auto 28px; }
.industry-hero-split { max-width: 1080px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: center; text-align: left; }
.industry-hero-split .landing-lede { margin: 0 0 28px; }
.industry-hero-split .landing-actions { justify-content: flex-start; }
.industry-hero-split .landing-title { font-size: clamp(2rem, 4.4vw, 3.2rem); }
.industry-sample { margin: 0; border: 1px solid #e3e5e8; border-radius: 18px; padding: 22px; background: #fff; box-shadow: 0 24px 48px -32px rgba(22, 33, 58, .35); }
.industry-sample-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #eef0f2; }
.industry-sample-head span { font-size: .78rem; color: #6b6c72; }
.industry-sample table { width: 100%; font-size: .9rem; border-collapse: collapse; }
.industry-sample td, .industry-sample th { padding: 10px 0; border-bottom: 1px solid #f2f3f5; vertical-align: top; }
.industry-sample td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; font-variant-numeric: tabular-nums; }
.industry-sample tfoot th, .industry-sample tfoot td { border-bottom: 0; font-weight: 800; font-size: 1rem; }
.industry-sample figcaption { font-size: .78rem; color: #6b6c72; margin-top: 8px; line-height: 1.5; }
.industry-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.industry-related { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.industry-related a { display: inline-block; border: 1px solid #e3e5e8; border-radius: 999px; padding: 8px 16px; font-weight: 600; color: #16213a; }
.industry-related a:hover, .industry-related a:focus { border-color: var(--asim-orange-deep); color: var(--asim-orange-deep); }
@media (max-width: 991.98px) {
  .industry-grid, .industry-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .industry-hero-split { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 575.98px) {
  .industry-grid, .industry-features { grid-template-columns: 1fr; }
  .landing-nav-link { display: none; }
  .landing-foot-links { justify-content: center; width: 100%; }
}
.industry-tabs { max-width: 920px; margin: 0 auto; }
.industry-tablist { position: relative; display: flex; justify-content: center; gap: 4px; border-bottom: 1px solid #eceef1; margin-bottom: 8px; }
.industry-tab { flex: none; border: 0; background: none; color: #6b6c72; padding: 12px 14px; font-weight: 600; font-size: .92rem; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; transition: color .15s, box-shadow .15s; }
.industry-tab:hover { color: #16213a; }
.industry-tab[aria-selected="true"] { color: #16213a; box-shadow: inset 0 -2px 0 var(--asim-orange-deep); }
.industry-tab:focus-visible { outline: 2px solid var(--asim-orange-deep); outline-offset: -2px; border-radius: 6px; }
.industry-panel { padding: 16px 0 0; }
.industry-panel h3 { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #8d9096; margin: 16px 0 4px; }
.industry-tabs.is-tabbed .industry-panel { min-height: 196px; }
.industry-tabs.is-tabbed .industry-panel h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.industry-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; }
.industry-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid #f2f3f5; color: #26324a; font-weight: 500; font-size: .95rem; text-decoration: none; }
.industry-list a::after { content: "\2192"; color: var(--asim-orange-deep); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.industry-list a:hover, .industry-list a:focus-visible { color: var(--asim-orange-deep); }
.industry-list a:hover::after, .industry-list a:focus-visible::after { opacity: 1; transform: none; }
@media (max-width: 991.98px) {
  .industry-tablist { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin-left: -20px; margin-right: -20px; padding: 0 20px; }
  .industry-tablist::-webkit-scrollbar { display: none; }
  .industry-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .industry-list { grid-template-columns: 1fr; }
  .industry-tabs.is-tabbed .industry-panel { min-height: 0; }
}

/* English / Español switch on the subcontractor pages (templates/network/_language_switch.html) */
.vn-lang { display: inline-flex; align-items: center; gap: 2px; padding: 3px; margin: 0; border-radius: 999px; background: #f1f2f4; border: 1px solid #e3e5e8; }
.vn-lang button { border: 0; background: transparent; min-width: 38px; height: 28px; padding: 0 10px; border-radius: 999px; font: inherit; font-size: .75rem; font-weight: 700; letter-spacing: .04em; color: #6b737b; cursor: pointer; transition: background .15s, color .15s; }
.vn-lang button:hover { color: #1d2125; }
.vn-lang button.active { background: #fff; color: #1d2125; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.vn-lang button:focus-visible { outline: 2px solid rgba(253, 89, 3, .5); outline-offset: 1px; }
.vn-lang-dark { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); }
.vn-lang-dark button { color: rgba(255, 255, 255, .7); }
.vn-lang-dark button:hover { color: #fff; }
.vn-lang-dark button.active { background: #fff; color: #111; box-shadow: none; }
