/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --moto-bg: #f6f7fb;
  --moto-card: #ffffff;
  --moto-text: #172033;
  --moto-muted: #667085;
  --moto-line: #e6e8ef;
  --moto-brand: #d71920;
  --moto-brand-dark: #a90f15;
  --moto-shadow: 0 16px 40px rgba(16, 24, 40, 0.10);
}

body {
  margin: 0;
  color: var(--moto-text);
  background: var(--moto-bg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.session-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  width: min(1520px, calc(100% - 48px));
  margin: 0 auto;
  padding: 12px 0 4px;
  color: var(--moto-muted);
  font-size: 13px;
  font-weight: 800;
}

.session-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.session-brand__logo {
  display: block;
  width: min(340px, 42vw);
  height: 68px;
  object-fit: contain;
  object-position: left center;
}

.session-user {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
  text-align: right;
}

.flash-tray {
  position: fixed;
  top: 92px;
  left: max(24px, calc((100vw - 1520px) / 2));
  right: max(24px, calc((100vw - 1520px) / 2));
  z-index: 1000;
  display: grid;
  justify-items: end;
  pointer-events: none;
}

.flash-tray--auth {
  top: 28px;
  justify-items: center;
}

.flash-card {
  width: min(440px, 100%);
  max-height: 120px;
  margin: 0;
  padding: 13px 16px;
  overflow: hidden;
  box-sizing: border-box;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.16);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  animation: flash-card-overlay-fade 5.4s ease forwards;
}

.flash-card--notice {
  border: 1px solid rgba(26, 152, 91, 0.24);
  color: #147346;
}

.flash-card--alert,
.flash-card--warning {
  border: 1px solid rgba(215, 25, 32, 0.24);
  color: var(--moto-brand-dark);
}

@keyframes flash-card-overlay-fade {
  0%,
  72% {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }

  100% {
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
  }
}

.auth-shell {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  padding: 40px 20px;
  box-sizing: border-box;
  background:
    linear-gradient(145deg, rgba(64, 70, 82, 0.50) 0%, rgba(215, 25, 32, 0.14) 48%, rgba(215, 25, 32, 0.50) 100%),
    linear-gradient(135deg, #343a46 0%, #5b6472 48%, #c81f27 100%);
}

.auth-panel {
  width: min(460px, 100%);
}

.auth-panel__head {
  margin-bottom: 28px;
  color: #ffffff;
  text-align: center;
}

.auth-logo {
  display: block;
  width: min(440px, 100%);
  height: auto;
  margin: 0 auto 20px;
  padding: 18px 20px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.68));
  box-shadow:
    0 20px 56px rgba(16, 24, 40, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
}

.auth-panel__head h1 {
  margin: 12px 0 0;
  font-size: 36px;
  line-height: 1;
}

.auth-panel__head span {
  display: block;
  margin-top: 10px;
  color: #d7dde8;
  font-size: 15px;
  line-height: 1.45;
}

.auth-card {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form .field {
  gap: 8px;
}

.auth-form .field label {
  color: #344054;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}

.auth-form .field input {
  min-height: 48px;
  border-color: #cfd5e1;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.auth-form .field input:focus {
  border-color: var(--moto-brand);
  box-shadow: 0 0 0 4px rgba(215, 25, 32, 0.12);
}

.check-card--auth {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--moto-muted);
  font-size: 14px;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  box-shadow: 0 12px 26px rgba(169, 15, 21, 0.24);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.dashboard {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0;
}

.dashboard__hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard__eyebrow {
  margin: 0 0 8px;
  color: var(--moto-brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1;
}

.dashboard__subtitle {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--moto-muted);
  font-size: 18px;
  line-height: 1.5;
}

.dashboard__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.dashboard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--moto-line);
  border-radius: 10px;
  background: var(--moto-card);
  color: var(--moto-text);
  font-weight: 700;
  text-decoration: none;
}

.dashboard-btn--primary {
  border-color: var(--moto-brand);
  background: var(--moto-brand);
  color: #ffffff;
}

.dashboard-btn:hover {
  border-color: var(--moto-brand);
}

.dashboard-btn--primary:hover {
  background: var(--moto-brand-dark);
}

.dashboard__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.dashboard-stat,
.dashboard-card {
  border: 1px solid var(--moto-line);
  border-radius: 14px;
  background: var(--moto-card);
  box-shadow: var(--moto-shadow);
}

.dashboard-stat {
  padding: 18px 20px;
}

.dashboard-stat span {
  display: block;
  color: var(--moto-muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
}

.dashboard-stat--alert {
  border-color: rgba(215, 25, 32, 0.25);
}

.dashboard-stat--alert strong {
  color: var(--moto-brand);
}

.dashboard__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-card {
  display: block;
  min-height: 170px;
  padding: 22px;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dashboard-card--flip {
  position: relative;
  min-height: 190px;
  padding: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  border: 0;
  perspective: 1200px;
}

.dashboard-card__inner {
  position: relative;
  display: block;
  min-height: 190px;
  transform-style: preserve-3d;
  transition: transform 560ms cubic-bezier(.2, .8, .2, 1);
  will-change: transform;
}

.dashboard-card__face {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  min-height: 190px;
  padding: 22px;
  box-sizing: border-box;
  border: 1px solid var(--moto-line);
  border-radius: 14px;
  background: var(--moto-card);
  box-shadow: var(--moto-shadow);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.dashboard-card__face--front {
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.dashboard-card__face--back {
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(64, 70, 82, 0.50) 0%, rgba(215, 25, 32, 0.14) 48%, rgba(215, 25, 32, 0.50) 100%),
    linear-gradient(135deg, #343a46 0%, #5b6472 48%, #c81f27 100%);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 28px 70px rgba(16, 24, 40, 0.24);
  transform: rotateY(180deg);
}

.dashboard-card--flip:hover,
.dashboard-card--flip:focus-visible {
  transform: none;
  outline: none;
}

.dashboard-card--flip:hover .dashboard-card__inner,
.dashboard-card--flip:focus-visible .dashboard-card__inner {
  transform: rotateY(180deg);
}

.dashboard-card:hover {
  transform: translateY(-2px);
  border-color: rgba(215, 25, 32, 0.45);
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.14);
}

.dashboard-card--flip:hover,
.dashboard-card--flip:focus-visible {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.dashboard-card--static:hover {
  transform: none;
  border-color: var(--moto-line);
  box-shadow: var(--moto-shadow);
}

.dashboard-card__kicker {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(215, 25, 32, 0.10);
  color: var(--moto-brand);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-card--flip .dashboard-card__kicker {
  margin-bottom: 0;
}

.dashboard-card__face--back .dashboard-card__kicker {
  background: rgba(255, 255, 255, 0.12);
  color: #ffd7d9;
}

.dashboard-card strong {
  display: block;
  font-size: 22px;
}

.dashboard-card__face--front strong {
  font-size: 24px;
}

.dashboard-card__face--back strong {
  color: #ffffff;
}

.dashboard-card p {
  margin: 10px 0 0;
  color: var(--moto-muted);
  line-height: 1.45;
}

.dashboard-card__face--back p {
  color: #d7dde8;
}

.dashboard-card__symbol {
  position: relative;
  display: block;
  width: 58px;
  height: 58px;
  margin-bottom: 6px;
  color: var(--moto-brand);
}

.dashboard-card__symbol::before,
.dashboard-card__symbol::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.dashboard-card__symbol--admin::before {
  inset: 9px;
  border: 4px solid currentColor;
  border-radius: 14px;
}

.dashboard-card__symbol--admin::after {
  inset: 20px;
  border: 4px solid currentColor;
  border-radius: 50%;
  box-shadow:
    0 -25px 0 -10px currentColor,
    0 25px 0 -10px currentColor,
    25px 0 0 -10px currentColor,
    -25px 0 0 -10px currentColor;
}

.dashboard-card__symbol--quick::before {
  inset: 8px;
  border: 4px solid currentColor;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(-28deg);
}

.dashboard-card__symbol--quick::after {
  width: 28px;
  height: 4px;
  left: 26px;
  top: 30px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-32deg);
  transform-origin: left center;
  box-shadow: -18px 11px 0 -1px rgba(215, 25, 32, 0.24);
}

.dashboard-card__symbol--acceptances::before {
  left: 12px;
  top: 8px;
  width: 34px;
  height: 44px;
  border: 4px solid currentColor;
  border-radius: 7px;
}

.dashboard-card__symbol--acceptances::after {
  left: 21px;
  top: 17px;
  width: 25px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 11px 0 currentColor, 0 22px 0 currentColor, -7px -15px 0 2px #ffffff, -7px -15px 0 6px currentColor;
}

.dashboard-card__symbol--reports::before {
  left: 13px;
  top: 7px;
  width: 36px;
  height: 46px;
  border: 4px solid currentColor;
  border-radius: 7px;
  background: linear-gradient(135deg, transparent 0 76%, rgba(215, 25, 32, 0.16) 77% 100%);
}

.dashboard-card__symbol--reports::after {
  left: 22px;
  top: 21px;
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 10px 0 currentColor, 0 20px 0 currentColor;
}

@media (max-width: 820px) {
  .session-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .session-brand__logo {
    width: min(340px, 82vw);
    height: 56px;
  }

  .session-user {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }

  .flash-tray {
    top: 132px;
  }

  .flash-tray--auth {
    top: 28px;
  }

  .dashboard__hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard__actions {
    justify-content: flex-start;
  }

  .dashboard__stats,
  .dashboard__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.page-shell {
  width: min(1520px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.page-shell--narrow {
  width: min(1280px, calc(100% - 48px));
}

.page-shell--report-form {
  width: min(1420px, calc(100% - 48px));
}

.flash {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
}

.flash--notice {
  border: 1px solid rgba(26, 152, 91, 0.20);
  background: rgba(26, 152, 91, 0.10);
  color: #147346;
}

.flash--alert {
  border: 1px solid rgba(215, 25, 32, 0.22);
  background: rgba(215, 25, 32, 0.10);
  color: var(--moto-brand-dark);
}

.resource-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.resource-head__eyebrow {
  margin: 0 0 8px;
  color: var(--moto-brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resource-head h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1;
}

.resource-head__subtitle {
  max-width: 650px;
  margin: 12px 0 0;
  color: var(--moto-muted);
  font-size: 17px;
  line-height: 1.45;
}

.resource-head__actions,
.row-actions,
.form-actions,
.filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.resource-head__actions {
  justify-content: flex-end;
}

.moto-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--moto-line);
  border-radius: 10px;
  background: var(--moto-card);
  color: var(--moto-text);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.moto-btn--primary {
  border-color: var(--moto-brand);
  background: var(--moto-brand);
  color: #fff;
}

.moto-btn--danger {
  border-color: #db3b3b;
  background: #db3b3b;
  color: #fff;
}

.moto-btn:hover {
  border-color: var(--moto-brand);
}

.moto-btn--primary:hover {
  background: var(--moto-brand-dark);
}

.moto-link {
  color: var(--moto-brand);
  font-weight: 800;
  text-decoration: none;
}

.moto-link:hover,
.moto-table__main a:hover {
  text-decoration: underline;
}

.filter-card,
.table-card,
.resource-form,
.detail-card,
.danger-zone {
  border: 1px solid var(--moto-line);
  border-radius: 16px;
  background: var(--moto-card);
  box-shadow: var(--moto-shadow);
}

.filter-card {
  margin-bottom: 18px;
  padding: 16px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) auto;
  gap: 14px;
  align-items: end;
}

.filters--single {
  grid-template-columns: minmax(320px, 1fr) auto;
}

.work-section {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 4px solid var(--moto-line);
}

#acceptances-section {
  border-top-color: #147346;
}

#reports-section {
  border-top-color: var(--moto-brand);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.section-head--standalone {
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--moto-muted);
}

.compact-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-search--open > .icon-button--search {
  display: none;
}

.compact-search__panel {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 42px auto;
  gap: 8px;
  align-items: center;
}

.compact-search__panel--with-select {
  grid-template-columns: minmax(260px, 380px) minmax(130px, 170px) 42px auto;
}

.compact-search__panel[hidden] {
  display: none;
}

.compact-search input[type="search"],
.compact-search select {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid var(--moto-line);
  border-radius: 10px;
  background: #fff;
  color: var(--moto-text);
  font: inherit;
  padding: 9px 12px;
  outline: none;
}

.compact-search input[type="search"]:focus,
.compact-search select:focus {
  border-color: rgba(215, 25, 32, 0.55);
  box-shadow: 0 0 0 4px rgba(215, 25, 32, 0.10);
}

.compact-search__reset {
  color: var(--moto-muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.compact-search__reset:hover {
  color: var(--moto-brand);
  text-decoration: underline;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--moto-line);
  border-radius: 10px;
  background: var(--moto-card);
  color: var(--moto-text);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--moto-brand);
}

.icon-button--primary {
  border-color: var(--moto-brand);
  background: var(--moto-brand);
  color: #fff;
}

.icon-button--search::before {
  content: "";
  width: 13px;
  height: 13px;
  box-sizing: border-box;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: translate(-1px, -1px);
}

.icon-button--search::after {
  content: "";
  width: 8px;
  height: 2px;
  margin-left: -3px;
  background: currentColor;
  border-radius: 999px;
  transform: rotate(45deg) translate(2px, 6px);
}

.date-picker {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: center;
}

.date-picker__display {
  width: 100%;
}

.date-picker__button {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid var(--moto-line);
  border-radius: 9px;
  background: #ffffff;
  color: var(--moto-text);
  cursor: pointer;
}

.date-picker__button::before {
  content: "";
  position: absolute;
  inset: 8px 7px 7px;
  border: 2px solid currentColor;
  border-top-width: 5px;
  border-radius: 3px;
}

.date-picker__button::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  top: 15px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.date-picker__button:hover {
  border-color: var(--moto-brand);
  color: var(--moto-brand);
}

.date-picker__native {
  position: absolute;
  right: 17px;
  bottom: 0;
  width: 1px;
  height: 1px;
  min-height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--moto-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid var(--moto-line);
  border-radius: 10px;
  background: #fff;
  color: var(--moto-text);
  font: inherit;
  padding: 9px 12px;
  outline: none;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(215, 25, 32, 0.55);
  box-shadow: 0 0 0 4px rgba(215, 25, 32, 0.10);
}

.field .date-picker__native,
.page-shell--report-form .summary-tile--field .date-picker__native,
.report-lines__row .date-picker__native {
  position: absolute;
  right: 17px;
  bottom: 0;
  width: 1px;
  height: 1px;
  min-height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.table-card {
  overflow: hidden;
}

.table-card--spaced {
  margin-bottom: 18px;
}

.table-card__head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--moto-line);
  background: #fafbfe;
}

.moto-table {
  width: 100%;
}

.moto-table__head,
.moto-table__row {
  display: grid;
  grid-template-columns: minmax(230px, 1.5fr) minmax(110px, 0.6fr) minmax(190px, 1fr) minmax(220px, 1.2fr) minmax(80px, 0.4fr) minmax(130px, 0.6fr);
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
}

.moto-table--vehicles .moto-table__head,
.moto-table--vehicles .moto-table__row {
  grid-template-columns: minmax(130px, 0.7fr) minmax(150px, 0.8fr) minmax(170px, 0.9fr) minmax(260px, 1.4fr) minmax(130px, 0.6fr);
}

.moto-table--reports .moto-table__head,
.moto-table--reports .moto-table__row {
  grid-template-columns: minmax(160px, 0.9fr) minmax(210px, 1.2fr) minmax(200px, 1.1fr) minmax(130px, 0.7fr) minmax(150px, 0.7fr);
}

.moto-table--acceptance-records .moto-table__head,
.moto-table--acceptance-records .moto-table__row {
  grid-template-columns: minmax(160px, 0.9fr) minmax(210px, 1.2fr) minmax(200px, 1.1fr) minmax(95px, 0.45fr) minmax(150px, 0.7fr) minmax(210px, 0.9fr);
}

.moto-table--mechanics .moto-table__head,
.moto-table--mechanics .moto-table__row {
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 0.4fr);
}

.moto-table--users .moto-table__head,
.moto-table--users .moto-table__row {
  grid-template-columns: minmax(150px, 0.9fr) minmax(190px, 1fr) minmax(220px, 1.1fr) minmax(130px, 0.7fr) minmax(150px, 0.7fr);
}

.moto-table__head {
  background: #eef1f7;
  color: var(--moto-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.moto-table__row {
  border-top: 1px solid var(--moto-line);
}

.moto-table__row:hover {
  background: #fafbfe;
}

.moto-table__main,
.moto-table__stack {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.moto-table__main a {
  color: var(--moto-text);
  text-decoration: none;
}

.moto-table__main span,
.moto-table__stack span {
  color: var(--moto-muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.status-pill,
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill--customer {
  background: rgba(27, 117, 208, 0.12);
  color: #175ea6;
}

.status-pill--supplier {
  background: rgba(215, 25, 32, 0.12);
  color: var(--moto-brand);
}

.status-pill--workshop {
  background: rgba(26, 152, 91, 0.12);
  color: #147346;
}

.count-pill {
  min-width: 34px;
  background: #eef1f7;
  color: var(--moto-text);
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 28px;
}

.empty-state p {
  margin: 0 0 6px;
  color: var(--moto-muted);
}

.empty-state--compact {
  padding: 18px;
  border: 1px dashed var(--moto-line);
  border-radius: 12px;
  background: #fafbfe;
  box-shadow: none;
}

.resource-form {
  padding: 22px;
}

.resource-form--compact {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid--vehicle {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid--auth {
  grid-template-columns: 1fr;
}

.acceptance-form {
  display: grid;
  gap: 20px;
}

.acceptance-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.summary-tile {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--moto-line);
  border-radius: 12px;
  background: #fafbfe;
}

.summary-tile span,
.summary-tile--field label {
  color: var(--moto-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-tile strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.summary-tile .link-button {
  justify-self: start;
}

.summary-tile--field {
  gap: 7px;
}

.page-shell--report-form .acceptance-summary {
  gap: 8px;
}

.page-shell--report-form .acceptance-summary--six {
  grid-template-columns:
    minmax(160px, 1.1fr)
    minmax(135px, 0.85fr)
    minmax(210px, 1.45fr)
    minmax(155px, 1fr)
    minmax(115px, 0.7fr)
    minmax(135px, 0.9fr);
}

.page-shell--report-form .summary-tile {
  min-height: 54px;
  padding: 8px 10px;
}

.page-shell--report-form .summary-tile strong {
  font-size: 17px;
}

.page-shell--report-form .summary-tile--field {
  gap: 4px;
}

.page-shell--report-form .summary-tile--field input,
.page-shell--report-form .summary-tile--field select {
  min-height: 34px;
  padding: 5px 8px;
}

.acceptance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.report-identity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 10px;
}

.readonly-field {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 56px;
  padding: 9px 12px;
  border: 1px solid var(--moto-line);
  border-radius: 14px;
  background: #fafbfe;
}

.readonly-field span {
  color: var(--moto-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.readonly-field strong {
  display: block;
  font-size: 18px;
  line-height: 1.15;
}

.readonly-field small {
  min-height: 14px;
  color: var(--moto-muted);
  font-size: 12px;
  font-weight: 650;
}

.readonly-field--problem {
  align-content: start;
  min-height: 74px;
}

.readonly-field--problem p {
  margin: 0;
  color: var(--moto-text);
  font-size: 16px;
  line-height: 1.3;
  white-space: pre-wrap;
}

.acceptance-field {
  gap: 10px;
}

.acceptance-field input,
.acceptance-field select,
.acceptance-field textarea {
  min-height: 58px;
  border-radius: 14px;
  font-size: 20px;
  padding: 14px 16px;
}

.acceptance-field textarea {
  line-height: 1.35;
}

.acceptance-field label {
  font-size: 14px;
}

.combobox {
  position: relative;
}

.combobox__menu {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--moto-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--moto-shadow);
}

.combobox__menu[hidden] {
  display: none;
}

.combobox__option[hidden],
.combobox__empty[hidden] {
  display: none;
}

.combobox__option {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid var(--moto-line);
  border-radius: 12px;
  background: #fafbfe;
  color: var(--moto-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.combobox__empty {
  padding: 14px;
  border: 1px dashed var(--moto-line);
  border-radius: 12px;
  background: #fafbfe;
  color: var(--moto-muted);
  font-weight: 700;
}

.combobox__option:hover,
.combobox__option:focus {
  border-color: rgba(215, 25, 32, 0.45);
  background: rgba(215, 25, 32, 0.06);
  outline: none;
}

.combobox__option strong {
  font-size: 18px;
}

.combobox__option span {
  color: var(--moto-muted);
  font-size: 14px;
}

.field--wide {
  grid-column: span 1;
}

.field--full {
  grid-column: 1 / -1;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 12px;
  border: 1px solid var(--moto-line);
  border-radius: 12px;
  background: #fafbfe;
}

.check-card input {
  width: 20px;
  height: 20px;
  accent-color: var(--moto-brand);
}

.check-card span {
  display: grid;
  gap: 2px;
}

.check-card small {
  color: var(--moto-muted);
}

.check-card--compact {
  min-height: 38px;
  padding: 8px 10px;
}

.report-lines {
  display: grid;
  gap: 10px;
}

.report-lines [data-nested-report-lines-target="rows"] {
  display: grid;
  gap: 10px;
}

.report-lines__head,
.report-lines__row {
  display: grid;
  grid-template-columns: minmax(220px, 1.8fr) minmax(62px, 0.4fr) minmax(82px, 0.5fr) minmax(110px, 0.7fr) minmax(140px, 0.8fr) minmax(170px, 0.9fr) minmax(90px, 0.5fr);
  gap: 10px;
  align-items: center;
}

.report-lines__head {
  color: var(--moto-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-lines__row {
  padding: 12px;
  border: 1px solid var(--moto-line);
  border-radius: 12px;
  background: #fafbfe;
}

.report-lines__row textarea,
.report-lines__row input,
.report-lines__row select {
  height: 46px;
  min-height: 46px;
  border-radius: 10px;
  font-size: 15px;
  padding: 9px 10px;
}

.report-lines__row textarea {
  line-height: 1.3;
  resize: vertical;
}

.report-lines__actions {
  display: flex;
  align-items: center;
  min-height: 46px;
}

.report-lines__footer {
  display: flex;
  justify-content: flex-start;
  padding-top: 4px;
}

.report-lines--readonly {
  margin-top: 18px;
}

.report-lines--readonly .report-lines__row {
  align-items: center;
}

.report-lines--readonly p {
  margin: 0;
}

.report-lines__total {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding: 12px;
  color: var(--moto-muted);
  font-weight: 900;
}

.report-lines__total strong {
  color: var(--moto-text);
}

.form-actions {
  justify-content: flex-end;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--moto-line);
}

.form-errors {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(219, 59, 59, 0.25);
  border-radius: 12px;
  background: rgba(219, 59, 59, 0.08);
  color: #9f1f1f;
}

.form-errors ul {
  margin-bottom: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
}

.detail-card {
  padding: 20px;
}

.detail-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.detail-card h2 {
  margin: 0;
  font-size: 20px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.detail-list div {
  min-width: 0;
}

.detail-list dt {
  color: var(--moto-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.note-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: #fafbfe;
}

.note-box p {
  margin-bottom: 0;
  color: var(--moto-muted);
}

.related-list {
  display: grid;
  gap: 10px;
}

.related-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--moto-line);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

.related-item--vehicle {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.related-item__main {
  display: grid;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.related-item:hover {
  border-color: rgba(215, 25, 32, 0.40);
}

.related-item span {
  color: var(--moto-muted);
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 18px 20px;
}

.danger-zone p {
  margin: 4px 0 0;
  color: var(--moto-muted);
}

.quick-create {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--moto-line);
}

.quick-create h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--moto-brand);
  font: inherit;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.link-button--danger {
  color: #db3b3b;
}

@media (max-width: 980px) {
  .filters,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .moto-table__head {
    display: none;
  }

  .moto-table__row {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .moto-table__row > div::before {
    display: block;
    margin-bottom: 5px;
    color: var(--moto-muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .moto-table__row > div:nth-child(1)::before { content: "Ragione sociale"; }
  .moto-table__row > div:nth-child(2)::before { content: "Tipo"; }
  .moto-table__row > div:nth-child(3)::before { content: "Contatti"; }
  .moto-table__row > div:nth-child(4)::before { content: "Località"; }
  .moto-table__row > div:nth-child(5)::before { content: "Veicoli"; }
  .moto-table__row > div:nth-child(6)::before { content: "Azioni"; }

  .moto-table--vehicles .moto-table__row {
    grid-template-columns: 1fr 1fr;
  }

  .moto-table--vehicles .moto-table__row > div:nth-child(1)::before { content: "Targa"; }
  .moto-table--vehicles .moto-table__row > div:nth-child(2)::before { content: "Marca"; }
  .moto-table--vehicles .moto-table__row > div:nth-child(3)::before { content: "Modello"; }
  .moto-table--vehicles .moto-table__row > div:nth-child(4)::before { content: "Cliente/Fornitore"; }
  .moto-table--vehicles .moto-table__row > div:nth-child(5)::before { content: "Azioni"; }

  .moto-table--acceptances .moto-table__row > div:nth-child(1)::before { content: "Accettazione"; }
  .moto-table--acceptances .moto-table__row > div:nth-child(2)::before { content: "Cliente"; }
  .moto-table--acceptances .moto-table__row > div:nth-child(3)::before { content: "Veicolo"; }
  .moto-table--acceptances .moto-table__row > div:nth-child(4)::before { content: "Stato"; }
  .moto-table--acceptances .moto-table__row > div:nth-child(5)::before { content: "Azioni"; }

  .moto-table--acceptance-records .moto-table__row {
    grid-template-columns: 1fr 1fr;
  }

  .moto-table--acceptance-records .moto-table__row > div:nth-child(1)::before { content: "Accettazione"; }
  .moto-table--acceptance-records .moto-table__row > div:nth-child(2)::before { content: "Cliente"; }
  .moto-table--acceptance-records .moto-table__row > div:nth-child(3)::before { content: "Veicolo"; }
  .moto-table--acceptance-records .moto-table__row > div:nth-child(4)::before { content: "Segnaposto"; }
  .moto-table--acceptance-records .moto-table__row > div:nth-child(5)::before { content: "Stato"; }
  .moto-table--acceptance-records .moto-table__row > div:nth-child(6)::before { content: "Azioni"; }

  .moto-table--reports .moto-table__row {
    grid-template-columns: 1fr 1fr;
  }

  .moto-table--reports .moto-table__row > div:nth-child(1)::before { content: "Rapportino"; }
  .moto-table--reports .moto-table__row > div:nth-child(2)::before { content: "Cliente"; }
  .moto-table--reports .moto-table__row > div:nth-child(3)::before { content: "Veicolo"; }
  .moto-table--reports .moto-table__row > div:nth-child(4)::before { content: "Tipo"; }
  .moto-table--reports .moto-table__row > div:nth-child(5)::before { content: "Azioni"; }

  .moto-table--mechanics .moto-table__row {
    grid-template-columns: 1fr 1fr;
  }

  .moto-table--mechanics .moto-table__row > div:nth-child(1)::before { content: "Nome completo"; }
  .moto-table--mechanics .moto-table__row > div:nth-child(2)::before { content: "Azioni"; }

  .moto-table--users .moto-table__row {
    grid-template-columns: 1fr 1fr;
  }

  .moto-table--users .moto-table__row > div:nth-child(1)::before { content: "Utente"; }
  .moto-table--users .moto-table__row > div:nth-child(2)::before { content: "Nome"; }
  .moto-table--users .moto-table__row > div:nth-child(3)::before { content: "Email"; }
  .moto-table--users .moto-table__row > div:nth-child(4)::before { content: "Ruolo"; }
  .moto-table--users .moto-table__row > div:nth-child(5)::before { content: "Azioni"; }

  .acceptance-summary {
    grid-template-columns: 1fr;
  }

  .page-shell--report-form .acceptance-summary {
    grid-template-columns: 1fr;
  }

  .report-identity-grid {
    grid-template-columns: 1fr;
  }

  .report-lines__head {
    display: none;
  }

  .report-lines__row {
    grid-template-columns: 1fr 1fr;
  }

  .report-lines__row > div:first-of-type {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .dashboard,
  .page-shell,
  .page-shell--narrow {
    width: calc(100% - 24px);
  }

  .resource-head,
  .danger-zone {
    align-items: flex-start;
    flex-direction: column;
  }

  .resource-head__actions,
  .form-actions,
  .section-head {
    justify-content: flex-start;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .compact-search,
  .compact-search__panel {
    width: 100%;
  }

  .compact-search {
    align-items: flex-start;
  }

  .compact-search__panel {
    grid-template-columns: 1fr 42px auto;
  }

  .compact-search__panel--with-select {
    grid-template-columns: 1fr;
  }

  .compact-search__panel--with-select .icon-button,
  .compact-search__panel--with-select .compact-search__reset {
    justify-self: start;
  }

  .moto-table__row,
  .form-grid,
  .form-grid--vehicle,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .dashboard__stats,
  .dashboard__grid {
    grid-template-columns: 1fr;
  }

  .related-item--vehicle {
    grid-template-columns: 1fr;
  }

  .field--wide {
    grid-column: 1 / -1;
  }
}
