/* sequential label reveal: slide + scale + deblur with stagger via --delay */
.left-label, .dropdown {
    will-change: transform, opacity, filter;
}

/* keyframes: start blurred/left, quick overshoot, settle */
@keyframes label-reveal {
    0% {
        opacity: 0;
        transform: translateX(-12px) scale(0.98);
        filter: blur(4px);
    }
    60% {
        opacity: 1;
        transform: translateX(6px) scale(1.03);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

/* initial hidden fallback for non-animated or server-side */
.label-hidden {
    opacity: 0;
    transform: translateX(-12px);
    pointer-events: none;
}

/* visible triggers the animation; --delay set per-item from JS */
.label-visible {
    animation-name: label-reveal;
    animation-duration: var(--dur, 480ms);
    animation-delay: var(--delay, 0s);
    animation-timing-function: cubic-bezier(.22,.9,.3,1);
    animation-fill-mode: both; /* keep final state */
    pointer-events: auto;
}

/* small focus-visible / hover polish so keyboard users see focus */
.left-label:focus, .dropdown:focus-within {
    outline: 2px solid rgba(255,255,255,0.15);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.04);
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .label-hidden { opacity: 1; transform: none; pointer-events: auto; }
    .label-visible { animation: none; }
}

/* Parts table enhancements */

:root {
  --parts-header-bg: linear-gradient(180deg, rgba(13,110,253,0.06), rgba(0,0,0,0.02));
  --parts-accent: #0d6efd;
  --parts-border: rgba(0,0,0,0.06);
  --parts-muted: rgba(0,0,0,0.55);
  --parts-card-bg: rgba(255,255,255,0.96);
}

/* Table container */
.parts-table {
  border-radius: .5rem;
  overflow: hidden;
  box-shadow: 0 .125rem .6rem rgba(0,0,0,0.06);
  margin-bottom: 1rem;
  background: var(--parts-card-bg);
}

/* Header */
.parts-table thead th {
  background: var(--parts-header-bg);
  font-weight: 700;
  color: var(--parts-muted);
  letter-spacing: .02em;
  text-transform: uppercase;
  font-size: .8rem;
  border-bottom: 1px solid var(--parts-border);
}

/* Row separators and hover */
.parts-table tbody tr {
  border-bottom: 1px solid rgba(0,0,0,0.03);
  transition: box-shadow .12s ease, transform .12s ease;
}
.parts-table tbody tr:hover {
  background-color: rgba(13,110,253,0.03);
  box-shadow: inset 0 0 0 1px rgba(13,110,253,0.02);
  transform: translateY(-1px);
}

/* Numeric cells and tabular numbers */
.cell-currency, .text-end.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: "tnum";
  font-feature-settings: "tnum";
}

/* Emphasize totals */
.parts-table tfoot tr th {
  font-weight: 700;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.01));
  border-top: 2px solid rgba(0,0,0,0.06);
}

/* Sticky header already exists; increase z-index safety */
.parts-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}

/* Sticky first column (Jobcard #) */
.parts-table thead th:first-child,
.parts-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background: linear-gradient(90deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
  box-shadow: 2px 0 6px -6px rgba(0,0,0,0.08);
}

/* Larger clickable rows: pointer cursor when hoverable actions exist */
.parts-table tbody tr.clickable { cursor: pointer; }

/* Dense mode utility (smaller padding) */
.table-dense td, .table-dense th {
  padding: .35rem .5rem;
}

/* Responsive stacked card view for small screens */
@media (max-width: 767.98px) {
  .table-responsive-stack table,
  .table-responsive-stack thead,
  .table-responsive-stack tbody,
  .table-responsive-stack th,
  .table-responsive-stack td,
  .table-responsive-stack tr {
    display: block;
  }
  .table-responsive-stack thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  .table-responsive-stack tbody tr {
    border: 1px solid var(--parts-border);
    margin-bottom: .75rem;
    border-radius: .375rem;
    padding: .5rem;
    background: #fff;
  }
  .table-responsive-stack td {
    border: none;
    position: relative;
    padding-left: 45%;
    white-space: normal;
    text-align: left;
  }
  .table-responsive-stack td::before {
    position: absolute;
    left: .9rem;
    top: .5rem;
    width: 40%;
    padding-right: .5rem;
    white-space: nowrap;
    font-weight: 600;
    color: var(--parts-muted);
    content: attr(data-label);
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .parts-table tbody tr,
  .parts-table tbody tr:hover {
    transition: none;
    transform: none;
  }
}

/* Compact, centered footer */
footer.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0;        /* reduce vertical space */
  min-height: 40px;         /* consistent compact height */
  line-height: 1.2;
  font-size: 0.92rem;
  color: #6c757d;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 -1px 4px rgba(0,0,0,0.04);
  transition: background .15s ease, color .15s ease;
}

/* Keep container padding small inside footer */
footer.footer .container {
  padding-left: .75rem;
  padding-right: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Reduce further on small screens */
@media (max-width: 575.98px) {
  footer.footer {
    padding: 0.25rem 0;
    font-size: 0.82rem;
    min-height: 36px;
  }
}

/* Make layout use full viewport and keep footer at bottom without extra space */
html, body {
  height: 100%;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main[role="main"] {
  flex: 1 0 auto; /* main grows to fill available space */
}

/* Ensure any page-level full-screen background element doesn't push layout.
   If you use a .full-screen-image element, prefer fixed/absolute positioning. */
.full-screen-image {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('/images/new_home.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  pointer-events: none;
}