/* Parot interface refresh — shared tokens and component rules.
 *
 * Restyle only. No markup, class names or behaviour depend on this file, so
 * removing the <link> restores the previous appearance exactly.
 *
 * The inherited surface was glass: blurred translucency, 12-16px radii and a
 * shadow on nearly every element. Applied uniformly, depth stops meaning
 * anything. This substitutes alignment, hairlines and whitespace, and reserves
 * emphasis for the few things that carry state.
 *
 * !important throughout: these layer over Bootstrap and over per-page blocks
 * that load after this file.
 */

:root {
  --t-ink:     #171a20;
  --t-ink-2:   #393c41;
  --t-muted:   #5c5e62;
  --t-faint:   #8e8e93;
  --t-line:    #e4e4e6;
  --t-line-2:  #d3d4d6;
  --t-bg:      #f7f7f8;
  --t-surface: #ffffff;
  --t-accent:  #3e6ae1;
  --t-warn:    #b8860b;
  --t-danger:  #c0392b;
  --t-ok:      #1f7a4d;
}

/* ── Typography ─────────────────────────────────────────────────────────── */
.tech-heading, h1, h2, h3, h4, h5 {
  color: var(--t-ink) !important;
  letter-spacing: -0.008em !important;
}
h4, h5 { font-weight: 600 !important; }
.form-label {
  color: var(--t-muted) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  margin-bottom: 4px !important;
}

/* ── Form controls ──────────────────────────────────────────────────────── */
.form-control, .form-select, input[type="text"], input[type="email"],
input[type="number"], input[type="date"], input[type="search"], textarea, select {
  border: 1px solid var(--t-line-2) !important;
  border-radius: 3px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: var(--t-surface) !important;
  color: var(--t-ink) !important;
  font-size: 14px !important;
}
.form-control:focus, .form-select:focus, textarea:focus, select:focus,
input:focus {
  border-color: var(--t-ink) !important;
  box-shadow: none !important;
  outline: none !important;
}
.form-control::placeholder, textarea::placeholder { color: var(--t-faint) !important; }
.form-check-input:checked { background-color: var(--t-ink) !important; border-color: var(--t-ink) !important; }
.form-check-input:focus { box-shadow: none !important; border-color: var(--t-ink) !important; }

/* ── Buttons: one system, weight carries hierarchy rather than colour ───── */
.btn {
  border-radius: 3px !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.015em !important;
  padding: 8px 14px !important;
  transition: background .12s ease, border-color .12s ease, color .12s ease !important;
}
.btn-sm { font-size: 12px !important; padding: 6px 11px !important; }
.btn-primary, .btn-success {
  background: var(--t-ink) !important; border: 1px solid var(--t-ink) !important; color: #fff !important;
}
.btn-primary:hover, .btn-success:hover { background: #000 !important; border-color: #000 !important; }
.btn-secondary, .btn-light, .btn-outline-secondary {
  background: var(--t-surface) !important;
  border: 1px solid var(--t-line-2) !important;
  color: var(--t-ink-2) !important;
}
.btn-secondary:hover, .btn-light:hover, .btn-outline-secondary:hover {
  background: var(--t-bg) !important; border-color: var(--t-ink) !important; color: var(--t-ink) !important;
}
/* Selected state. The flat restyle above overrode Bootstrap's .active, so a
   segmented filter rendered all three segments identically and gave no hint
   which one was in effect. Solid ink reads as "this is what you are seeing"
   without needing a second cue. */
.btn-secondary.active, .btn-light.active, .btn-outline-secondary.active,
.btn-outline-primary.active,
.btn-check:checked + .btn-outline-secondary {
  background: var(--t-ink) !important;
  border-color: var(--t-ink) !important;
  color: #fff !important;
}
.btn-outline-secondary.active:hover, .btn-outline-primary.active:hover {
  background: #000 !important; border-color: #000 !important; color: #fff !important;
}
.btn-outline-primary {
  background: transparent !important;
  border: 1px solid var(--t-line-2) !important;
  color: var(--t-ink) !important;
}
.btn-outline-primary:hover { background: var(--t-bg) !important; border-color: var(--t-ink) !important; }
.btn-danger, .btn-outline-danger {
  background: transparent !important; border: 1px solid var(--t-line-2) !important; color: var(--t-danger) !important;
}
.btn-danger:hover, .btn-outline-danger:hover {
  background: var(--t-danger) !important; border-color: var(--t-danger) !important; color: #fff !important;
}
.btn-link { color: var(--t-ink-2) !important; text-decoration: none !important; }

/* ── Surfaces: hairlines instead of cards ───────────────────────────────── */
.card, .modal-content {
  background: var(--t-surface) !important;
  border: 1px solid var(--t-line-2) !important;
  border-radius: 5px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.modal-content { box-shadow: 0 24px 60px rgba(23, 26, 32, .18) !important; border-radius: 6px !important; }
.card-header, .modal-header {
  background: var(--t-surface) !important;
  border-bottom: 1px solid var(--t-line) !important;
}
.card-footer, .modal-footer {
  background: var(--t-bg) !important;
  border-top: 1px solid var(--t-line) !important;
}
.modal-title { font-size: 15px !important; font-weight: 600 !important; }
.modal-backdrop.show { opacity: .38 !important; }
.btn-close { opacity: .45 !important; box-shadow: none !important; }
.btn-close:hover { opacity: .9 !important; }
.dropdown-menu {
  border-radius: 4px !important;
  border: 1px solid var(--t-line-2) !important;
  box-shadow: 0 8px 24px rgba(23, 26, 32, .10) !important;
  padding: 4px !important;
}
.dropdown-item { border-radius: 3px !important; font-size: 13px !important; color: var(--t-ink-2) !important; }
.dropdown-item:hover { background: var(--t-bg) !important; color: var(--t-ink) !important; }
.table { color: var(--t-ink-2) !important; }
.table > :not(caption) > * > * { border-color: var(--t-line) !important; }
.table thead th {
  color: var(--t-muted) !important; font-size: 10px !important; font-weight: 600 !important;
  letter-spacing: 0.09em !important; text-transform: uppercase !important;
}

/* ── Brand ──────────────────────────────────────────────────────────────── */
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { height: 34px; width: auto; display: block; opacity: .92; flex: 0 0 auto; }
.brand-lockup h2 { margin: 0 !important; line-height: 1.1 !important; }
.brand-sub {
  color: var(--t-faint); font-size: 10px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; margin-top: 3px; white-space: nowrap;
}


/* ── Chrome: top bar and sidebar ──────────────────────────────────────────
 * Both were glass -- a purple gradient navbar with a coloured glow, and a
 * blurred dark sidebar whose links were rounded pills that slid sideways on
 * hover. Chrome competing with content is the thing this refresh is trying to
 * undo, so it becomes one flat near-black frame around a bright page.
 *
 * Two copies of this markup exist (base.html and base_kanban.html) with
 * separately maintained styles that had already drifted. Styling by selector
 * here means both get the same treatment and stay that way.
 */
.navbar {
  background: var(--t-ink) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
  box-shadow: none !important;
  padding: 10px 18px !important;
}
.navbar-brand {
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  text-shadow: none !important;
}
.navbar-brand img { height: 22px !important; width: auto !important; display: block !important; }
.navbar .nav-link, .navbar .dropdown-toggle {
  color: rgba(255, 255, 255, .72) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}
.navbar .nav-link:hover, .navbar .dropdown-toggle:hover { color: #fff !important; }

#sidebar {
  background: var(--t-ink) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-right: 1px solid rgba(255, 255, 255, .08) !important;
  box-shadow: none !important;
  padding: 14px 10px !important;
}
#sidebar .nav-link {
  color: rgba(255, 255, 255, .68) !important;
  border: 0 !important;
  /* A left marker rather than a filled pill: the current page is stated once,
     quietly, instead of being highlighted like a button. */
  border-left: 2px solid transparent !important;
  border-radius: 0 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0.06em !important;
  margin-bottom: 1px !important;
  padding: 9px 12px !important;
  transition: color .12s ease, background .12s ease !important;
  display: flex !important;
  align-items: center !important;
}
#sidebar .nav-link:hover {
  background: rgba(255, 255, 255, .06) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-left-color: rgba(255, 255, 255, .28) !important;
  color: #fff !important;
  transform: none !important;              /* the sideways slide was noise */
}
#sidebar .nav-link.active, #sidebar .nav-link.selected {
  background: rgba(255, 255, 255, .09) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-left-color: #fff !important;
  box-shadow: none !important;
  color: #fff !important;
}
#sidebar .nav-link svg { opacity: .6; }
#sidebar .nav-link.selected svg, #sidebar .nav-link:hover svg { opacity: 1; }
#sidebar .btn {
  border-radius: 3px !important;
  box-shadow: none !important;
  font-size: 12px !important;
}
#sidebar hr { border-color: rgba(255, 255, 255, .1) !important; opacity: 1 !important; }
#sidebarCollapseToggle {
  background: var(--t-ink) !important;
  border: 1px solid rgba(255, 255, 255, .18) !important;
  border-radius: 3px !important;
  box-shadow: none !important;
  color: #fff !important;
}
#sidebarCollapseToggle:hover { background: #000 !important; border-color: rgba(255, 255, 255, .4) !important; }
/* The navbar dropdown sits on dark, so it needs its own ground. */
.navbar .dropdown-menu {
  background: var(--t-ink) !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
}
.navbar .dropdown-item { color: rgba(255, 255, 255, .8) !important; }
.navbar .dropdown-item:hover { background: rgba(255, 255, 255, .09) !important; color: #fff !important; }


/* ── The glass-* family ───────────────────────────────────────────────────
 * Ten templates dress their headers, tables, filter bars and forms in these:
 * translucent white over a blur, 14px radii, and an inset highlight to fake a
 * lit edge. Overriding them here rather than per page means orders, customers,
 * repairs, todos, notes, email templates and the customer form all land
 * together instead of drifting one page at a time.
 */
.glass-page-header, .glass-table-container, .glass-filter-box,
.glass-pagination, .glass-form-card, .glass-form-wrapper, .glass-info-card,
.glass-card, .glass-alert {
  background: var(--t-surface) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid var(--t-line) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}
/* A page title is a heading, not a panel. */
.glass-page-header {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--t-line) !important;
  border-radius: 0 !important;
  padding: 4px 0 14px !important;
  margin-bottom: 18px !important;
}
.glass-page-header h1, .glass-page-header h2 {
  color: var(--t-ink) !important;
  font-size: 22px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  margin: 0 !important;
  text-transform: none !important;
}
.glass-filter-box { background: var(--t-bg) !important; padding: 14px 16px !important; }
/* auto, not hidden: these tables run 6+ columns and must scroll on a narrow
   window rather than clip. Corners still round -- any non-visible overflow clips. */
.glass-table-container { overflow-x: auto !important; overflow-y: hidden !important; }
/* Opt-in vertical scroll with a pinned header, for long embedded histories. */
.glass-table-container.is-scroll { overflow-y: auto !important; max-height: 320px; }
.glass-table-container.is-scroll .table thead th { position: sticky; top: 0; z-index: 2; }

/* Table-cell utilities shared by the Square pages, so the palette is not
   re-declared per template the way it used to be. */
.sq-nw    { white-space: nowrap; }
.sq-right { text-align: right; }
.sq-dim, .sq-dim > td { color: var(--t-faint); }
.sq-fine  { font-size: 11px; color: var(--t-muted); }
.sq-paid  { color: var(--t-ok); font-weight: 600; }
.sq-empty { padding: 22px; text-align: center; color: var(--t-muted); font-size: 13px; }
.sq-hist-sub { font-size: 12px; font-weight: 600; color: var(--t-muted); }
.sq-subhead  { color: var(--t-muted); font-size: 13px; }
.sq-intro    { color: var(--t-muted); font-size: 13px; margin: 0 0 16px; max-width: 70ch; }
.glass-table-container .table { margin-bottom: 0 !important; }
.glass-table-container .table thead th {
  background: var(--t-bg) !important;
  border-bottom: 1px solid var(--t-line) !important;
  color: var(--t-muted) !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
}
.glass-table-container .table tbody tr:hover { background: #fafafa !important; }
.glass-table-container .table td { border-color: var(--t-line) !important; }
/* Cell rhythm, set here rather than left to Bootstrap so every table on the
   site breathes the same amount. The type drops a little below body size to
   pay for the extra padding, so rows get roomier without the table growing. */
.glass-table-container .table { font-size: 13.5px !important; }
.glass-table-container .table > tbody > tr > td {
  padding: 12px 16px !important;
  vertical-align: middle !important;
  line-height: 1.45 !important;
}
.glass-table-container .table > thead > tr > th { padding: 11px 16px !important; }
.glass-form-header {
  background: var(--t-surface) !important;
  border-bottom: 1px solid var(--t-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--t-ink) !important;
}
.glass-form-body { background: var(--t-surface) !important; }
.glass-submit-btn {
  background: var(--t-ink) !important;
  border: 1px solid var(--t-ink) !important;
  border-radius: 3px !important;
  box-shadow: none !important;
  color: #fff !important;
}
.glass-submit-btn:hover { background: #000 !important; border-color: #000 !important; }
.glass-pagination, .pagination { border: 0 !important; background: transparent !important; }
.page-link {
  border: 1px solid var(--t-line-2) !important;
  border-radius: 3px !important;
  box-shadow: none !important;
  color: var(--t-ink-2) !important;
  margin: 0 2px !important;
}
.page-link:hover { background: var(--t-bg) !important; border-color: var(--t-ink) !important; }
.page-item.active .page-link {
  background: var(--t-ink) !important; border-color: var(--t-ink) !important; color: #fff !important;
}


/* ── Sidebar height and its collapse control ──────────────────────────────
 * The sidebar had a fixed height of one viewport while .main-layout only sets
 * a min-height, so on any page taller than the window the black stopped
 * partway down and left a ragged edge. Sticky keeps it the height of the
 * viewport and pinned as the page scrolls, so it always reads as one
 * continuous panel and the navigation stays reachable.
 */
#sidebar {
  position: sticky !important;
  top: 0 !important;
  align-self: flex-start !important;
  height: 100vh !important;
  max-height: 100vh !important;
}

/* The control was a glyph (a filled triangle) inside a floating white circle
 * with a coloured shadow -- a different visual language from everything around
 * it. It becomes a flat tab on the sidebar's edge, with the arrow drawn rather
 * than typed so it renders identically everywhere and can rotate cleanly.
 */
#sidebarCollapseToggle {
  background: var(--t-ink) !important;
  border: 1px solid rgba(255, 255, 255, .18) !important;
  border-left: 0 !important;
  border-radius: 0 3px 3px 0 !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, .75) !important;
  width: 18px !important;
  height: 44px !important;
  margin-left: 0 !important;
  font-size: 0 !important;                 /* hides the glyph in the markup */
  transition: background .12s ease, color .12s ease, left .3s ease !important;
}
#sidebarCollapseToggle:hover {
  background: #000 !important;
  border-color: rgba(255, 255, 255, .38) !important;
  color: #fff !important;
}
#sidebarCollapseToggle::before {
  content: '';
  width: 6px;
  height: 6px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 3px;
  transition: transform .2s ease;
}
body.sidebar-collapsed #sidebarCollapseToggle { margin-left: 0 !important; }
body.sidebar-collapsed #sidebarCollapseToggle::before {
  transform: rotate(-135deg);
  margin-left: -3px;
}
/* Nothing should sit against a zero-width sidebar. */
#sidebar.collapsed { border-right: 0 !important; }

/* --- CRD co-branding ---------------------------------------------------
   The client's mark sits alongside the Parot mark rather than replacing it.
   Two files, because the wordmark is black: crd-logo.png on light surfaces,
   crd-logo-light.png (lettering lifted to white, gold diamond kept) on the
   dark navbar and sidebar. A CSS filter cannot do this -- inverting turns
   the gold accent blue. */
.brand-divider {
  width: 1px;
  align-self: stretch;
  margin: 2px 4px;
  background: linear-gradient(180deg, transparent, rgba(31,41,55,.28), transparent);
  flex: 0 0 auto;
}
.brand-crd { height: 46px; width: auto; display: block; flex: 0 0 auto; }

/* Pinned to the foot of the sidebar, quiet until hovered, so it reads as a
   signature rather than another nav item competing for attention. */
#sidebarFooter {
  flex: 0 0 auto;
  padding: 18px 4px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}
#sidebarFooter .crd-sig {
  height: 26px;
  width: auto;
  opacity: .55;
  transition: opacity .2s ease;
}
#sidebarFooter:hover .crd-sig { opacity: .9; }
#sidebarFooter .crd-sig-caption {
  margin-top: 6px;
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

/* The sidebar assumed it started 56px down (navbar only). With the env banner
   above it that is 30px optimistic, so its bottom edge -- and anything pinned
   there -- fell below the fold. --chrome-h is measured at runtime, which also
   covers the banner wrapping to two lines on narrow screens. Declared here
   rather than in the base templates' inline <style>, which loads earlier and
   would lose on equal specificity. */
/* The sidebar above is sticky at top:0 and exactly one viewport tall, so at
   scroll position 0 its bottom edge sits below the fold by the height of the
   chrome it starts beneath (navbar, plus the env banner where one shows).
   Anything pinned to that edge -- the signature below -- was cut off. Reserving
   that much padding lifts it into view without disturbing the sticky sizing,
   which is deliberate and marked !important. */
#sidebar { padding-bottom: calc(var(--chrome-h, 56px) + 10px) !important; }

/* CRD alongside the Parot mark in the top-left brand. The bar is dark, so the
   light variant; the hairline keeps the two marks from reading as one lockup. */
.brand-sep {
  width: 1px;
  height: 20px;
  margin: 0 2px;
  background: rgba(255, 255, 255, 0.28);
  flex: 0 0 auto;
}
.navbar-brand img.navbar-crd { height: 24px !important; }

/* Left over from the glass theme: a white gloss across the top half of every
   button, carrying its own 12px top radius. The buttons above are flat with a
   3px radius, so the gloss showed as a second, mismatched rounded edge inside
   the border. Killed here rather than in base.html so it stays dead if that
   inline block is edited. */
.btn::before { display: none !important; }
