:root {
  --mtc-ink: #111827;
  --mtc-muted: #6b7280;
  --mtc-line: #e5e7eb;
  --mtc-surface: #ffffff;
  --mtc-soft: #f7f8fa;
  --mtc-red: #be123c;
  --mtc-gold: #b7791f;
  --mtc-green: #047857;
}

body {
  letter-spacing: 0;
}

body,
button,
input:not([type="email"]):not([type="password"]),
textarea,
select,
.table,
.modal,
.panel-block {
  text-transform: uppercase;
}

.login-page-premium {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, #171717 0%, #2b1118 48%, #f3f4f6 48%, #ffffff 100%);
  display: grid;
  place-items: center;
  color: var(--mtc-ink);
}

.login-shell {
  width: min(94vw, 460px);
}

.login-panel {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .22);
  border-radius: 8px;
  padding: 32px;
  position: relative;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.login-brand > span,
.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: #111827;
  color: #fff;
  font-weight: 800;
}

.login-brand h1 {
  font-size: 24px;
  margin: 0;
}

.login-brand p {
  color: var(--mtc-muted);
  margin: 0;
}

.premium-input .input-group-text,
.premium-input .form-control {
  border-color: var(--mtc-line);
  min-height: 46px;
}

.btn-premium {
  background: var(--mtc-red);
  color: #fff;
  min-height: 46px;
  border-radius: 6px;
  font-weight: 700;
}

.btn-premium:hover {
  background: #9f1239;
  color: #fff;
}

.powered {
  display: block;
  margin-top: 22px;
  color: var(--mtc-gold);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.premium-sidebar {
  background: #111827;
}

.premium-sidebar .nav-link.active {
  background: var(--mtc-red);
}

.premium-topbar {
  min-height: 64px;
}

.app-content-header h1 {
  font-size: 24px;
  font-weight: 800;
}

.decision-tile,
.module-tile {
  display: flex;
  min-height: 176px;
  border-radius: 8px;
  padding: 26px;
  color: #fff;
  text-decoration: none;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 20px 45px rgba(17, 24, 39, .18);
}

.decision-tile i {
  font-size: 42px;
  margin-bottom: 18px;
}

.decision-tile span,
.module-tile strong {
  font-size: 28px;
  font-weight: 900;
}

.decision-tile small,
.module-tile span {
  color: rgba(255, 255, 255, .82);
}

.service-tile {
  background: linear-gradient(135deg, #111827, #be123c);
}

.accounting-tile {
  background: linear-gradient(135deg, #1f2937, #047857);
}

.module-tile {
  background: #1f2937;
  min-height: 150px;
}

.module-tile i {
  font-size: 30px;
  margin-bottom: auto;
  color: #fbbf24;
}

.metric-card,
.panel-block {
  background: var(--mtc-surface);
  border: 1px solid var(--mtc-line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, .06);
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  display: block;
  color: var(--mtc-muted);
  text-transform: uppercase;
  font-size: 12px;
}

.metric-card strong {
  display: block;
  font-size: 30px;
  margin-top: 8px;
}

.panel-block {
  padding: 18px;
}

.inner-panel {
  border: 1px solid var(--mtc-line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 16px;
}

.panel-title {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-title h2 {
  font-size: 18px;
  font-weight: 900;
  margin: 0;
}

.panel-title span {
  color: var(--mtc-muted);
  font-size: 13px;
}

.action-ribbon {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 4px;
}

.btn-ribbon {
  border: 1px solid var(--mtc-line);
  background: #fff;
  min-width: 86px;
  height: 58px;
  border-radius: 6px;
  font-size: 11px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
}

.btn-ribbon i {
  font-size: 17px;
}

.shortcut-flash {
  outline: 3px solid var(--mtc-gold);
}

.filter-grid,
.detail-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.filter-grid.five,
.detail-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.table {
  font-size: 13px;
}

.table thead th {
  background: #f9fafb;
  color: #374151;
  white-space: nowrap;
}

.table-sort-link {
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}

.table-sort-link:hover {
  color: var(--mtc-red);
}

.service-filter-table thead th {
  vertical-align: top;
}

.service-sort-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  display: inline-flex;
  gap: 6px;
  padding: 0;
  text-align: left;
}

.service-sort-button i {
  color: var(--mtc-muted);
  font-size: 12px;
}

.service-sort-button.active-sort-asc i::before {
  content: "\F145";
}

.service-sort-button.active-sort-desc i::before {
  content: "\F124";
}

.service-filter-row th {
  background: #fff;
  padding-top: 8px;
}

.service-filter-row .form-control,
.service-filter-row .form-select {
  border-color: #d1d5db;
  min-width: 128px;
}

.service-list-search {
  background: #fbfcfd;
  border: 1px solid var(--mtc-line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  padding: 14px;
}

.service-list-search label {
  color: var(--mtc-muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.work-order-table .clickable-row {
  cursor: pointer;
  transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.work-order-table .clickable-row:hover,
.work-order-table .clickable-row:focus {
  background: #fff7ed;
  box-shadow: inset 4px 0 0 var(--mtc-red);
  outline: none;
  transform: translateX(2px);
}

.placeholder-row td {
  color: var(--mtc-muted);
  text-align: center;
}

.premium-tabs .nav-link {
  color: var(--mtc-ink);
}

.premium-tabs .nav-link.active {
  font-weight: 800;
}

.info-grid,
.permission-matrix,
.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.info-grid div,
.permission-card,
.report-grid button {
  border: 1px solid var(--mtc-line);
  border-radius: 8px;
  padding: 14px;
  background: var(--mtc-soft);
}

.info-grid span {
  display: block;
  color: var(--mtc-muted);
  font-size: 12px;
}

.print-heading {
  display: none;
}

.edit-grid input,
.edit-grid select {
  margin-top: 6px;
}

.subhead {
  font-size: 16px;
  font-weight: 800;
  margin: 20px 0 10px;
}

.expertise-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.expertise-grid span {
  border: 1px solid var(--mtc-line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
}

.upload-zone {
  min-height: 220px;
  border: 1px dashed #9ca3af;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--mtc-muted);
}

.upload-zone i {
  font-size: 40px;
}

.upload-form {
  gap: 12px;
  padding: 18px;
  text-align: center;
}

.upload-form .form-control {
  max-width: 520px;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.document-item {
  border: 1px solid var(--mtc-line);
  border-radius: 8px;
  color: var(--mtc-ink);
  background: #fff;
  padding: 8px;
  text-decoration: none;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.document-item img {
  width: 100%;
  height: 124px;
  object-fit: cover;
  border-radius: 6px;
}

.document-preview-button,
.document-file-link {
  border: 0;
  background: transparent;
  color: inherit;
  display: grid;
  gap: 8px;
  padding: 0;
  text-align: center;
  text-decoration: none;
  width: 100%;
}

.document-preview-button {
  cursor: zoom-in;
}

.document-item i {
  font-size: 54px;
  color: var(--mtc-red);
  text-align: center;
}

.document-item span {
  font-size: 12px;
  word-break: break-word;
}

.document-delete-form {
  position: absolute;
  right: 12px;
  top: 12px;
}

.document-delete-form .btn {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  padding: 0;
  width: 32px;
}

.document-delete-form .btn i {
  color: #fff;
  font-size: 14px;
}

.document-viewer-modal .modal-body {
  background: #111827;
}

.document-viewer-toolbar {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.document-viewer-stage {
  align-items: center;
  background: #0b1020;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  max-height: 72vh;
  min-height: 420px;
  overflow: auto;
}

.document-viewer-stage img {
  max-height: 68vh;
  max-width: 100%;
  transform-origin: center center;
  transition: transform .16s ease;
}

.customer-search-wrap,
.technician-search-wrap {
  position: relative;
}

.customer-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% - 18px);
  left: 12px;
  right: 12px;
  background: #fff;
  border: 1px solid var(--mtc-line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(17, 24, 39, .16);
  overflow: hidden;
}

.customer-suggestion {
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.customer-suggestion:hover,
.customer-suggestion:focus {
  background: #fff7ed;
  outline: none;
}

.customer-suggestion span {
  color: var(--mtc-muted);
  font-size: 12px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--mtc-line);
  border-radius: 8px;
  overflow: hidden;
}

.segmented button {
  border: 0;
  background: #fff;
  padding: 8px 14px;
}

.segmented button.active {
  background: #111827;
  color: #fff;
}

.permission-card h3 {
  font-size: 16px;
  font-weight: 900;
}

.permission-card label {
  display: block;
  margin: 8px 0;
}

.settings-console .tab-content {
  min-height: 420px;
}

.settings-editor,
.role-card,
.dealer-card,
.user-log-panel {
  background: #fbfcfd;
  border: 1px solid var(--mtc-line);
  border-radius: 8px;
  padding: 14px;
}

.settings-editor h3,
.settings-table-head h3 {
  font-size: 16px;
  font-weight: 900;
  margin: 0 0 12px;
}

.settings-split,
.settings-table-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.settings-table-head .form-control {
  max-width: 360px;
}

.role-grid {
  display: grid;
  gap: 14px;
}

.role-card-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.role-card-head strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
}

.role-card-head span {
  color: var(--mtc-muted);
  display: block;
  font-size: 12px;
}

.permission-groups {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.permission-group {
  background: #fff;
  border: 1px solid var(--mtc-line);
  border-radius: 8px;
  padding: 10px;
}

.permission-group h4 {
  font-size: 13px;
  font-weight: 900;
  margin: 0 0 8px;
}

.permission-group label {
  align-items: flex-start;
  display: flex;
  font-size: 12px;
  gap: 7px;
  margin: 7px 0;
}

.settings-table {
  min-width: 1120px;
}

.settings-table .form-control,
.settings-table .form-select {
  min-width: 110px;
}

.dealer-grid {
  display: grid;
  gap: 12px;
}

.user-log-panel {
  max-height: 560px;
  overflow: auto;
}

.user-log-item {
  border-bottom: 1px solid var(--mtc-line);
  padding: 10px 0;
}

.user-log-item:last-child {
  border-bottom: 0;
}

.user-log-item strong {
  display: block;
}

.user-log-item span {
  color: var(--mtc-muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.report-grid button {
  text-align: left;
  font-weight: 800;
}

.report-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 16px;
}

.report-card {
  background: #fff;
  border: 1px solid var(--mtc-line);
  border-radius: 8px;
  color: var(--mtc-ink);
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 16px;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.report-card:hover,
.report-card.active {
  border-color: var(--mtc-red);
  box-shadow: 0 14px 30px rgba(17, 24, 39, .10);
  transform: translateY(-1px);
}

.report-card i {
  color: var(--mtc-red);
  font-size: 28px;
}

.report-card strong {
  font-size: 16px;
  font-weight: 900;
}

.report-card span {
  color: var(--mtc-muted);
  font-size: 12px;
}

.report-filter-panel {
  align-items: end;
  background: #fbfcfd;
  border: 1px solid var(--mtc-line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  margin-bottom: 16px;
  padding: 14px;
}

.report-result {
  background: #fff;
  border: 1px solid var(--mtc-line);
  border-radius: 8px;
  padding: 18px;
}

.report-paper-head {
  align-items: flex-start;
  border-bottom: 2px solid var(--mtc-ink);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.report-paper-head h1 {
  font-size: 24px;
  font-weight: 900;
  margin: 0;
}

.report-paper-head p {
  color: var(--mtc-muted);
  margin: 4px 0 0;
}

.report-paper-head span {
  color: var(--mtc-muted);
  display: block;
  font-size: 11px;
  text-transform: uppercase;
}

.report-paper-head strong {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

.report-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 14px;
}

.report-summary div {
  background: #f9fafb;
  border: 1px solid var(--mtc-line);
  border-radius: 8px;
  padding: 12px;
}

.report-summary span {
  color: var(--mtc-muted);
  display: block;
  font-size: 11px;
  text-transform: uppercase;
}

.report-summary strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
  margin-top: 4px;
}

.report-table {
  min-width: 920px;
}

.report-paper-foot {
  border-top: 1px solid var(--mtc-line);
  color: var(--mtc-muted);
  font-size: 12px;
  margin-top: 14px;
  padding-top: 10px;
  text-align: right;
}

@media (max-width: 992px) {
  .filter-grid,
  .filter-grid.five,
  .detail-strip,
  .info-grid,
  .permission-matrix,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .decision-tile,
  .module-tile {
    min-height: 136px;
  }

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

  .service-list-search {
    grid-template-columns: 1fr;
  }

  .report-paper-head {
    display: block;
  }
}

@media print {
  body.printing-report * {
    visibility: hidden !important;
  }

  body.printing-report #reportPrintArea,
  body.printing-report #reportPrintArea * {
    visibility: visible !important;
  }

  body.printing-report #reportPrintArea {
    border: 0;
    box-shadow: none;
    left: 0;
    padding: 0;
    position: absolute;
    top: 0;
    width: 100%;
  }

  body.printing-report .report-table {
    min-width: 0;
  }

  body.printing-work-order * {
    visibility: hidden !important;
  }

  body.printing-work-order .print-area,
  body.printing-work-order .print-area * {
    visibility: visible !important;
  }

  body.printing-work-order .print-area {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    padding: 0;
    background: #fff;
  }

  body.printing-work-order .app-header,
  body.printing-work-order .app-sidebar,
  body.printing-work-order .app-content-header,
  body.printing-work-order .action-ribbon,
  body.printing-work-order .premium-tabs,
  body.printing-work-order .no-print,
  body.printing-work-order #expertise,
  body.printing-work-order #documents {
    display: none !important;
  }

  body.printing-work-order .tab-pane {
    display: block !important;
    opacity: 1 !important;
  }

  body.printing-work-order .panel-block,
  body.printing-work-order .metric-card {
    box-shadow: none !important;
    border: 0 !important;
  }

  body.printing-work-order .print-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #111827;
    margin-bottom: 16px;
    padding-bottom: 10px;
  }

  body.printing-work-order input,
  body.printing-work-order select,
  body.printing-work-order textarea {
    border: 0 !important;
    padding-left: 0 !important;
    background: transparent !important;
    color: #111827 !important;
  }
}
