.nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-box {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  padding: 6px 9px;
  border-radius: var(--r-sm);
  text-decoration: none;
  flex-shrink: 0;
  display: inline-block;
}

.logo-box span {
  display: block;
  color: var(--orange);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-link {
  font-size: 14px;
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: all 0.15s;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

.nav-link:hover {
  background: var(--muted);
  color: var(--text);
}

.nav-link.active {
  color: var(--blue);
  font-weight: 500;
  background: var(--blue-light);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue-text);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  padding: 0;
  transition: background 0.15s;
}

.avatar:hover {
  background: #D0E7F9;
}

.user-menu {
  position: relative;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  z-index: 200;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.user-menu.open .user-menu-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.user-menu-header {
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.user-menu-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
}

.user-menu-email {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.user-menu-link {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.1s;
}

.user-menu-link:hover {
  background: var(--muted);
}

.user-menu-link-danger {
  color: var(--red-text);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.user-menu-link-danger:hover {
  background: var(--red-light);
}

.credits-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--orange-light);
  color: var(--orange-text);
  border: 1px solid #FBBF24;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-nav:hover {
  border-color: var(--text-3);
  color: var(--text);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px 100px;
}

/* Buttons (global) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--text-3);
  color: var(--text);
  background: var(--muted);
}

.btn-primary {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
}

.btn-outline-blue {
  border-color: var(--blue-border);
  color: var(--blue-text);
  background: var(--blue-light);
}

.btn-outline-blue:hover {
  background: #D0E7F9;
  color: var(--blue);
}

.btn-secondary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  font-weight: 600;
}

.btn-secondary:hover {
  background: #143F7A;
  border-color: #143F7A;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 86, 160, 0.25);
}

.btn-sm {
  font-size: 12px;
  padding: 6px 12px;
  gap: 4px;
}

/* Small icon-only button used for inline deletes (✕). White background by
   default; flashes red on hover. */
.btn-del {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-3);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.btn-del:hover {
  border-color: var(--red-border);
  color: var(--red);
  background: var(--red-light);
}

/* Dashed-outline "add another" button, sits below lists */
.btn-dashed {
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--blue-text);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.btn-dashed:hover {
  border-color: var(--blue-border);
  background: var(--blue-light);
}

.btn-dashed.is-open {
  display: none;
}

/* Small icon-only button for table actions (open/navigate). */
.icon-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-size: 14px;
}

.icon-btn:hover {
  border-color: var(--blue-border);
  color: var(--blue);
  background: var(--blue-light);
}

/* Make a row clickable by having the icon-btn link cover the entire row */
tr[data-row-link] {
  position: relative;
}

tr[data-row-link] .data-row-link {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  background: transparent;


}






/* Shared card primitive.
   Default layout has a flex card-header (title + actions on one row).
   If the card-header contains an h2 (the order-wizard "title + description"
   pattern), it switches to a stacked block layout. */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

/* The client-picker card holds an absolutely-positioned lookup dropdown that
   hangs below the search box. The default `.card` `overflow: hidden` (used so
   the rounded corners trim the card-header bottom border) would clip it, and a
   plain card below would paint over it — so opt this card out of clipping and
   lift it into its own stacking context above the following cards. */
.card-lookup {
  overflow: visible;
  position: relative;
  z-index: 5;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header:has(h2) {
  display: block;
  padding: 20px 24px 16px;
}

.card-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 19px;
  font-weight: 400;
  color: var(--dark);
  margin-bottom: 2px;
}

.card-header p {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  font-family: 'DM Sans', sans-serif;
}

.card-body {
  padding: 20px 24px;
}

.card-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.card-section:last-child {
  border-bottom: none;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 32px;
}

.breadcrumb a {
  color: var(--text-2);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--blue);
}

.bc-sep {
  color: var(--text-3);
}

/* Underline on hover only for plain prose links (WYSIWYG content, inline
   text links) - not nav/buttons/pills/cards, which style their own hover
   state and would otherwise pick up an unwanted underline from a blanket
   a:hover rule. */
.typography a:hover {
  text-decoration: underline;
}

.site-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 40px 64px;
}

.site-footer-inner {
  border-top: 1px solid #E2E5EC;
  padding-top: 28px;
  font-size: 13px;
  line-height: 1.7;
  color: #97A0B2;
  max-width: 90ch;
}



.form-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 6px;
  line-height: 1.5;
}