:root {
  --bg: #f4f7f8;
  --panel: #ffffff;
  --text: #1b2328;
  --muted: #5a6972;
  --line: #d8e0e4;
  --accent: #0f766e;
  --accent-dark: #0b5b55;
  --danger: #b42318;
  --danger-soft: #fde8e8;
  --warning: #b57600;
  --warning-soft: #fff4d6;
  --success: #17653a;
  --success-soft: #e3f8e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: #12343b;
  color: #fff;
  padding: 24px 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.site-header h1 {
  margin: 0;
  font-size: 30px;
}

.site-header h1 a {
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  color: #c7dbde;
}

main.wrap {
  padding: 24px 0 48px;
  flex: 1;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #eef3f4;
  color: var(--muted);
}

.footer-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 14px 0 18px;
  font-size: 13px;
}

.actions,
.form-actions,
.button-row,
.inline-actions,
.template-list,
.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-menu a,
.nav-menu button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.nav-menu a:hover,
.nav-menu button:hover,
.nav-group:focus-within > button,
.nav-group:hover > button {
  background: rgba(255, 255, 255, 0.16);
}

.nav-primary {
  background: #fff !important;
  color: var(--accent-dark) !important;
}

.nav-group {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: none;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(11, 31, 35, 0.22);
  z-index: 20;
}

.nav-group:focus-within .nav-dropdown,
.nav-group:hover .nav-dropdown {
  display: grid;
  gap: 4px;
}

.nav-dropdown a {
  justify-content: flex-start;
  min-height: 36px;
  border: 0;
  background: #fff;
  color: var(--text);
}

.nav-dropdown a:hover {
  background: #eef6f6;
  color: var(--accent-dark);
}

.hero,
.asset-grid,
.two-col,
.three-col,
.asset-summary-grid,
.detail-grid,
.summary-grid {
  display: grid;
  gap: 16px;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 20px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 20px;
}

.hero {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 20px;
}

.hero-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

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

.detail-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
}

.asset-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.asset-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.panel,
.stat,
.asset-card,
.summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 18px;
  margin-bottom: 20px;
}

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

.panel-heading h2 {
  margin: 0;
  font-size: 22px;
}

.stat {
  padding: 18px;
}

.stat.warning {
  border-color: #f5c27b;
}

.stat.caution {
  border-color: #efcf67;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.stat strong,
.summary-card strong {
  font-size: 28px;
}

.button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
}

.button:hover,
.text-button:hover {
  background: var(--accent-dark);
}

.button.secondary {
  background: #fff;
  color: var(--accent-dark);
}

.button.secondary:hover {
  background: #eef6f6;
}

.button-small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.text-button {
  min-height: auto;
  padding: 0;
  background: none;
  border: none;
  color: var(--accent-dark);
}

.text-button.danger {
  color: var(--danger);
}

.asset-card {
  padding: 16px;
}

.asset-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.asset-card h3 a {
  text-decoration: none;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.status-chip {
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #eef6f6;
  color: var(--accent-dark);
}

.asset-type {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill {
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill.overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.due-soon {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.ok {
  background: var(--success-soft);
  color: var(--success);
}

.asset-card.status-overdue {
  border-color: #efb3b3;
}

.asset-card.status-due-soon {
  border-color: #ecd27a;
}

.asset-meta,
.muted,
small {
  color: var(--muted);
}

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

.compact-stats dt {
  color: var(--muted);
  font-size: 12px;
}

.compact-stats dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.summary-card,
.notes-box {
  padding: 14px;
}

.notes-box {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
}

.detail-list li {
  margin-bottom: 8px;
}

.meta-list {
  margin: 0;
  padding-left: 18px;
}

.meta-list li {
  margin-bottom: 8px;
}

.mini-reminders,
.reminder-list,
.activity-list,
.timeline {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.mini-reminder,
.reminder-item,
.timeline li {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fbfcfc;
  margin-bottom: 10px;
}

.mini-reminder span,
.reminder-item span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.mini-reminder.overdue,
.reminder-item.overdue {
  border-color: #efb3b3;
  background: var(--danger-soft);
}

.mini-reminder.due-soon,
.reminder-item.due-soon {
  border-color: #ecd27a;
  background: var(--warning-soft);
}

.activity-list li {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.activity-list li:last-child {
  border-bottom: none;
}

.activity-date {
  color: var(--muted);
  font-size: 13px;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.attachment-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.attachment-card img,
.attachment-card .pdf-box,
.attachment-card .file-box {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef3f4;
  color: var(--muted);
  font-weight: 700;
}

.attachment-card.compact img,
.attachment-card.compact .pdf-box,
.attachment-card.compact .file-box {
  height: 110px;
}

.attachment-meta {
  display: grid;
  gap: 6px;
  padding: 10px;
}

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

.receipt-summary .summary-card {
  padding: 16px;
}

.receipt-upload-panel {
  border-color: var(--accent);
}

.receipt-upload-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: stretch;
}

.receipt-file-choice {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px dashed var(--accent);
  border-radius: 6px;
  background: #f4fafa;
  cursor: pointer;
}

.receipt-file-choice span,
.receipt-safety-note {
  font-size: 13px;
}

.receipt-file-choice input {
  margin-top: 7px;
  max-width: 100%;
}

.receipt-upload-button {
  min-width: 140px;
}

.receipt-safety-note {
  margin: 12px 0 0;
}

.receipt-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.receipt-card {
  display: grid;
  grid-template-rows: 180px 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.receipt-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #eef3f4;
}

.receipt-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.receipt-file-mark {
  display: grid;
  place-items: center;
  width: 78px;
  height: 92px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-dark);
  font-weight: 800;
}

.receipt-card-body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.receipt-card-body h3,
.receipt-card-body p {
  margin: 0;
  overflow-wrap: anywhere;
}

.receipt-review-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(520px, 1.15fr);
  gap: 20px;
  align-items: start;
}

.receipt-document-panel {
  position: sticky;
  top: 18px;
}

.receipt-document-image,
.receipt-document-frame {
  display: block;
  width: 100%;
  min-height: 560px;
  max-height: 74vh;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: contain;
  background: #eef3f4;
}

.receipt-document-frame {
  height: 70vh;
}

.receipt-document-download {
  display: grid;
  place-items: center;
  gap: 18px;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef3f4;
}

.receipt-form-section {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.receipt-form-section h3 {
  margin: 4px 0 0;
}

.receipt-approval-note {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid #bad9cf;
  border-radius: 6px;
  background: var(--success-soft);
}

[hidden] {
  display: none !important;
}

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

.form-grid label,
.existing-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.login-panel {
  max-width: 460px;
  margin: 48px auto;
}

.login-eyebrow {
  color: var(--accent-dark);
}

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

.login-demo-callout {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.login-demo-title {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--text);
}

.login-demo-text {
  margin: 0 0 12px;
  color: var(--muted);
}

.stock-usage-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stock-usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.stock-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfc;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.link-grid a {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfc;
  text-decoration: none;
}

.link-grid a:hover {
  border-color: var(--accent);
  background: #eef6f6;
}

.link-grid strong {
  color: var(--text);
}

.link-grid span {
  color: var(--muted);
  font-size: 13px;
}

.search-button-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-button-grid .button {
  min-width: 120px;
}

.calculator-result {
  display: grid;
  align-content: center;
}

.calculator-result strong {
  display: block;
  font-size: 44px;
  line-height: 1;
  margin: 4px 0 10px;
}

.asset-tool-row {
  margin-top: 14px;
}

.service-template-list {
  margin-bottom: 14px;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.inline-form select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.form-grid textarea {
  min-height: 120px;
  resize: vertical;
}

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

.inline-form select {
  min-width: 120px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.flash.success {
  background: var(--success-soft);
}

.flash.warning {
  background: var(--warning-soft);
}

.flash.error {
  background: var(--danger-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-scroll {
  overflow-x: auto;
}

th,
td {
  border-top: 1px solid var(--line);
  text-align: left;
  padding: 10px 8px;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.empty {
  color: var(--muted);
  margin: 0;
}

.print-only-page {
  background: #fff;
}

.print-wrap {
  padding: 20px 0;
}

.service-log-wrap {
  max-width: 980px;
}

.service-log-header,
.service-log-title-row,
.service-log-grid,
.signature-grid {
  display: grid;
  gap: 12px;
}

.service-log-header {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 14px;
}

.service-log-header h1 {
  margin: 0;
  font-size: 32px;
}

.service-log-card,
.service-log-field,
.signature-box {
  border: 1px solid #1f2933;
  background: #fff;
}

.service-log-card {
  padding: 12px;
  margin-bottom: 12px;
}

.service-log-card h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.service-log-title-row {
  grid-template-columns: 2fr 1fr 1fr;
}

.service-log-title-row strong {
  display: block;
  min-height: 24px;
  font-size: 18px;
}

.service-log-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
}

.service-log-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.service-log-field {
  min-height: 58px;
  padding: 8px;
}

.service-log-field.wide {
  grid-column: span 4;
}

.service-log-field span,
.signature-box span {
  display: block;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.service-log-field div {
  min-height: 18px;
  font-size: 16px;
}

.ruled-lines {
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 29px, #9aa4ad 30px);
}

.lines-large {
  height: 150px;
}

.lines-medium {
  height: 90px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.check-grid label span {
  width: 16px;
  height: 16px;
  border: 1px solid #1f2933;
  flex: 0 0 auto;
}

.service-log-table th,
.service-log-table td {
  border: 1px solid #1f2933;
}

.service-log-table td {
  height: 32px;
}

.signature-grid {
  grid-template-columns: 1fr 1fr;
}

.signature-box {
  min-height: 72px;
  padding: 8px;
}

@media (max-width: 900px) {
  .hero,
  .hero-four,
  .two-col,
  .three-col,
  .form-grid,
  .detail-grid,
  .topbar,
  .page-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .panel-heading {
    flex-direction: column;
  }

  .nav-menu {
    justify-content: flex-start;
  }

  .nav-group,
  .nav-menu a,
  .nav-menu button {
    width: 100%;
  }

  .nav-dropdown {
    position: static;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }

  .receipt-summary,
  .receipt-upload-actions,
  .receipt-review-layout {
    grid-template-columns: 1fr;
  }

  .receipt-document-panel {
    position: static;
  }

  .receipt-document-image,
  .receipt-document-frame {
    min-height: 360px;
    max-height: 62vh;
  }
}

@media print {
  .site-header,
  .flash-stack,
  .button,
  .text-button,
  .actions,
  .button-row {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .wrap,
  main.wrap {
    width: 100%;
    padding: 0;
  }

  .panel,
  .stat,
  .asset-card,
  .summary-card {
    break-inside: avoid;
  }

  .service-log-wrap {
    max-width: none;
  }

  .service-log-card,
  .service-log-field,
  .signature-box {
    break-inside: avoid;
  }

  .print-button {
    display: none !important;
  }
}
