@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  /* Premium Light Theme variables for Editor Panel */
  --bg-app: #f3f4f6;
  --bg-navbar: #ffffff;
  --bg-card: #ffffff;
  --border-light: #e5e7eb;
  --border-focus: #005691;
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --text-dim: #9ca3af;
  
  /* Brand Colors */
  --sprinkle-blue: #005691;
  --electric-cyan: #0096b4;
  --success-color: #10b981;
  --error-color: #ef4444;
  
  --font-sans: 'Prompt', sans-serif;
  --font-serif: 'Sarabun', sans-serif;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
}

/* App Shell */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Premium Light Navigation Bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-navbar);
  border-bottom: 1px solid var(--border-light);
  padding: 10px 24px;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  flex-direction: column;
}

.nav-brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--sprinkle-blue);
}

.nav-brand-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.nav-selectors {
  display: flex;
  gap: 6px;
  background: #f3f4f6;
  padding: 3px;
  border-radius: 30px;
  border: 1px solid var(--border-light);
}

.nav-selector-btn {
  padding: 8px 18px;
  border-radius: 25px;
  background: none;
  border: none;
  font-family: var(--font-sans);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-selector-btn:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.03);
}

.nav-selector-btn.active {
  color: white;
  background: var(--sprinkle-blue);
  box-shadow: 0 4px 10px rgba(0, 86, 145, 0.25);
  font-weight: 600;
}

/* User Profile Badge in Header */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-profile-info {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.user-profile-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.user-profile-role {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.btn-logout {
  padding: 4px 10px;
  font-size: 0.72rem;
  border-radius: 12px;
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background-color: #fca5a5;
  color: #7f1d1d;
}

/* Workspace Panels */
.workspace-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Scrollable Form Sidebar */
.editor-sidebar {
  width: 100%;
  height: 100%;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.editor-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  justify-content: center;
}

.editor-centered-container {
  width: 100%;
  max-width: 900px;
}

.editor-form-panel {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.editor-form-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Premium Light Card Designs */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
}

.glass-card:hover {
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--sprinkle-blue);
  margin-bottom: 20px;
  border-left: 4px solid var(--sprinkle-blue);
  padding-left: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Custom Floating Label Inputs (Light Theme) */
.floating-group {
  position: relative;
  margin-bottom: 18px;
  width: 100%;
}

.floating-input {
  width: 100%;
  padding: 11px 14px;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.25s ease;
}

.floating-input:focus {
  border-color: var(--sprinkle-blue);
  box-shadow: 0 0 0 3px rgba(0, 86, 145, 0.15);
  background: #ffffff;
}

.floating-label {
  position: absolute;
  left: 14px;
  top: 11px;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.25s ease;
  transform-origin: left top;
  font-size: 0.9rem;
}

.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label {
  transform: translateY(-20px) scale(0.8);
  color: var(--sprinkle-blue);
  background-color: #ffffff; /* Cover input border cleanly on white cards */
  padding: 0 6px;
  border-radius: 4px;
}

/* Readonly fields styling in Light Theme */
.floating-input[readonly] {
  background-color: #f3f4f6;
  color: var(--text-muted);
  border-color: #e5e7eb;
}
.floating-input[readonly] ~ .floating-label {
  background-color: #ffffff;
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* Buttons */
.btn {
  padding: 10px 22px;
  border-radius: 30px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
}

.btn-cyan {
  background: var(--sprinkle-blue);
  color: white;
}

.btn-cyan:hover {
  background: var(--sprinkle-blue);
  box-shadow: 0 4px 12px rgba(0, 86, 145, 0.2);
  transform: translateY(-1px);
}

.btn-dark {
  background: #f3f4f6;
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-dark:hover {
  background: #e5e7eb;
}

.btn-red {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.btn-red:hover {
  background: #fca5a5;
  color: #991b1b;
}

/* Radio segment switches (Light Theme) */
.radio-switch {
  display: flex;
  background: #f3f4f6;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  padding: 4px;
  gap: 4px;
}

.radio-switch-label {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.radio-switch input[type="radio"] {
  display: none;
}

.radio-switch-label:hover {
  color: var(--text-main);
}

.radio-switch input[type="radio"]:checked + .radio-switch-label {
  background: var(--sprinkle-blue);
  color: white;
  font-weight: 600;
}

/* 3-State segment button controls */
.pill-switch {
  display: flex;
  background: #f3f4f6;
  border-radius: 20px;
  padding: 2px;
  border: 1px solid var(--border-light);
  width: fit-content;
}

.pill-btn {
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 18px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-btn.active-none {
  background: #d1d5db;
  color: var(--text-main);
}

.pill-btn.active-ok {
  background: var(--success-color);
  color: white;
  font-weight: 600;
}

.pill-btn.active-nok {
  background: var(--error-color);
  color: white;
  font-weight: 600;
}

/* Custom Checkbox list */
.custom-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.custom-checkbox-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-checkbox-row:hover {
  background: #f3f4f6;
}

.custom-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 12px;
  accent-color: var(--sprinkle-blue);
  cursor: pointer;
}

.custom-checkbox-row span {
  font-size: 0.85rem;
  color: var(--text-main);
}

/* Form B: Inspection Grid (Editor) */
#checklist-a-editor-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

#checklist-b-editor-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 12px;
}

.inspection-editor-row {
  background: #f9fafb;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
}

.inspection-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
}

.date-columns-editor {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.date-column-editor-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

.date-column-editor-item .date-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
}

/* Signature Pad (Editor) */
.signature-box-editor {
  border: 1px dashed var(--border-light);
  border-radius: 8px;
  background-color: #f9fafb;
  position: relative;
  margin-bottom: 14px;
}

.sig-pad-canvas {
  width: 100%;
  height: 110px;
  display: block;
  cursor: crosshair;
}

.sig-actions-row {
  display: flex;
  justify-content: flex-end;
  padding: 6px;
  background-color: #f3f4f6;
  border-top: 1px solid var(--border-light);
  border-radius: 0 0 8px 8px;
}

/* Interactive tables */
.wash-log-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.wash-log-table th, .wash-log-table td {
  padding: 10px;
  font-size: 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.wash-log-table th {
  color: var(--text-muted);
  font-weight: 600;
  background-color: #f9fafb;
}

.wash-log-table td {
  color: var(--text-main);
}

.delete-row-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

/* ================================================== */
/* SUMMARY DASHBOARD UI                               */
/* ================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(0, 86, 145, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--sprinkle-blue);
  border: 1px solid rgba(0, 86, 145, 0.15);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ================================================== */
/* ADMIN PANEL DIRECTORY                              */
/* ================================================== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

.admin-table th {
  background-color: #f9fafb;
  color: var(--text-muted);
  font-weight: 600;
}

.admin-table tr:hover td {
  background-color: #f9fafb;
}

.action-pill-btn {
  padding: 4px 10px;
  font-size: 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-muted);
  cursor: pointer;
  margin-right: 6px;
  transition: all 0.2s;
}

.action-pill-btn:hover {
  border-color: var(--sprinkle-blue);
  color: var(--sprinkle-blue);
}

.action-pill-btn.delete:hover {
  border-color: var(--error-color);
  color: var(--error-color);
  background-color: #fee2e2;
}

/* ================================================== */
/* LOGIN GATEWAY OVERLAY (Light Theme glass)          */
/* ================================================== */
.login-overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(243, 244, 246, 0.8);
  backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  border-radius: 16px;
  padding: 36px;
  text-align: center;
  animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.login-logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--sprinkle-blue);
  margin-bottom: 8px;
}

.login-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.login-error {
  font-size: 0.8rem;
  color: var(--error-color);
  margin-top: -10px;
  margin-bottom: 12px;
  display: none;
}

.login-tester-box {
  margin-top: 24px;
  padding: 12px;
  border-radius: 8px;
  background: #f3f4f6;
  border: 1px solid var(--border-light);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: left;
}

/* ================================================== */
/* IMMERSIVE PREVIEW (HIDDEN ON SCREEN)               */
/* ================================================== */
.preview-container {
  display: none; /* HIDE PREVIEW CARD ON SCREEN */
}

/* ================================================== */
/* A4 PAGE PRINT LAYOUT STYLE STRUCTURE               */
/* ================================================== */
.a4-page {
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  background-color: white;
  color: black;
  padding: 10mm;
  font-family: var(--font-serif);
  display: none;
  flex-direction: column;
  box-sizing: border-box;
}

.a4-page.active {
  display: flex;
}

.form-header {
  display: flex;
  width: 100%;
  border: 1px solid black;
  height: 52px;
}

.logo-section {
  width: 58%;
  border-right: 1px solid black;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-text-sprinkle {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 2px;
  font-family: var(--font-sans);
  line-height: 1.1;
  color: black;
}

.logo-sub-text {
  font-size: 0.46rem;
  letter-spacing: 0.5px;
  font-weight: 500;
  line-height: 1.1;
  color: #333;
}

.doc-info-section {
  width: 42%;
  display: flex;
  flex-direction: column;
  font-size: 0.58rem;
  padding: 4px 6px;
  justify-content: center;
}

.doc-info-row {
  display: flex;
  justify-content: space-between;
  line-height: 1.3;
}

.form-body-wrapper {
  border: 1px solid black;
  border-top: none;
  flex: 1;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
}

.form-title {
  text-align: center;
  font-size: 0.95rem;
  font-weight: bold;
  margin: 6px 0;
  text-decoration: underline;
}

/* Metadata print grid */
.metadata-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  font-size: 0.65rem;
  row-gap: 5px;
  column-gap: 8px;
  margin-bottom: 6px;
}

.meta-field {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* Solid Underlines for PDF output */
.print-underline {
  border-bottom: 1px solid black;
  flex: 1;
  padding-left: 6px;
  padding-right: 6px;
  font-weight: bold;
  min-height: 14px;
  display: inline-block;
  text-align: center;
  margin-left: 4px;
  margin-right: 4px;
}

.meta-checkboxes {
  display: flex;
  gap: 12px;
  align-items: center;
}

.meta-checkbox-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Print Checkbox */
.print-checkbox {
  width: 10px;
  height: 10px;
  border: 1px solid black;
  margin-right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: bold;
  flex-shrink: 0;
}

.print-checkbox.checked::after {
  content: "✓";
}

.print-checkbox.defective {
  background-color: #fee2e2;
  border-color: #ef4444;
}

.print-checkbox.defective::after {
  content: "✗";
  color: #ef4444;
}

/* Checklist Columns (Form A) */
.section-title {
  font-size: 0.7rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.checklist-three-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  column-gap: 20px;
  row-gap: 2.5px;
  margin-bottom: 6px;
}

.checklist-print-item {
  display: flex;
  align-items: center;
  font-size: 0.60rem;
  height: 14px;
}

.item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tire section */
.tire-pressure-section {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.6fr;
  column-gap: 20px;
  margin-bottom: 6px;
}

.tire-column {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tire-row {
  display: flex;
  align-items: center;
  font-size: 0.6rem;
  height: 14px;
}

.tire-input-line {
  border-bottom: 1px solid black;
  flex: 1;
  font-weight: bold;
  text-align: center;
  min-height: 12px;
  margin-left: 4px;
}

.tire-info-text {
  font-size: 0.5rem;
  font-style: italic;
  line-height: 1.3;
  padding-left: 2px;
  display: flex;
  align-items: center;
  height: 14px;
}

/* Spare parts */
.spare-parts-section {
  display: flex;
  flex-direction: column;
  margin-bottom: 6px;
}

.spare-parts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 0.7fr;
  column-gap: 20px;
  row-gap: 2.5px;
}

/* Defects */
.defects-section {
  margin-bottom: 6px;
}

.defect-line {
  display: flex;
  align-items: flex-end;
  font-size: 0.6rem;
  margin-top: 1px;
}

.defect-num {
  margin-right: 6px;
}

.defect-line-under {
  border-bottom: 1px solid black;
  flex: 1;
  min-height: 13px;
  font-weight: bold;
  padding-left: 6px;
}

/* Car Wash Table Form A */
.carwash-section {
  margin-bottom: 6px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.carwash-print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.58rem;
  margin-top: 2px;
}

.carwash-print-table th, .carwash-print-table td {
  border: 1px solid black;
  padding: 4px;
  text-align: center;
  height: 18px;
}

.carwash-print-table th {
  font-weight: bold;
  background-color: #f8fafc;
}

/* Signatures */
.signature-print-row {
  display: flex;
  justify-content: space-around;
  margin-top: 8px;
  margin-bottom: 2px;
}

.signature-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.6rem;
  width: 40%;
}

.signature-line {
  border-bottom: 1px solid black;
  width: 100%;
  height: 28px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.signature-image {
  max-height: 26px;
  max-width: 90%;
  object-fit: contain;
}

.footer-note {
  font-size: 0.5rem;
  text-align: left;
  border-top: 1px solid #ddd;
  padding-top: 4px;
  margin-top: auto;
}

/* ================================================== */
/* FORM B PRINTING TEMPLATE                           */
/* ================================================== */
.form-b-body {
  border: 1px solid black;
  border-top: none;
  flex: 1;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
}

.wash-b-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.55rem;
  margin-bottom: 6px;
}

.wash-b-table th, .wash-b-table td {
  border: 1px solid black;
  padding: 3px;
  text-align: center;
  height: 17px;
}

.wash-b-table th {
  font-weight: bold;
}

.checklist-b-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.55rem;
  margin-top: 4px;
  margin-bottom: 6px;
  flex: 1;
}

.checklist-b-table th, .checklist-b-table td {
  border: 1px solid black;
  padding: 2px;
  height: 15px;
}

.checklist-b-table th {
  font-weight: bold;
  text-align: center;
}

.checklist-b-table td.center {
  text-align: center;
}

.checklist-b-table td.item-name {
  padding-left: 6px;
}

.checklist-b-table .sub-th {
  font-size: 0.48rem;
  padding: 1px 0;
}

.warning-b-text {
  font-size: 0.5rem;
  text-align: center;
  font-weight: 500;
  margin-bottom: 6px;
}

/* ================================================== */
/* PRINT SEARCH REPORT LAYOUT                         */
/* ================================================== */
#print-search-report {
  display: none; /* Hidden on screen */
  background-color: white;
  color: black;
  font-family: var(--font-serif);
  padding: 15mm;
  width: 210mm;
}

.search-report-header {
  border-bottom: 2px solid black;
  padding-bottom: 10px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.search-report-title {
  font-size: 1.4rem;
  font-weight: bold;
  font-family: var(--font-sans);
  color: #000;
}

.search-report-meta {
  font-size: 0.75rem;
  text-align: right;
}

/* Print configuration overrides */
@media print {
  body {
    background-color: white;
    color: black;
    overflow: visible;
    height: auto;
  }

  .navbar {
    display: none !important;
  }

  .editor-sidebar {
    display: none !important;
  }

  .login-overlay {
    display: none !important;
  }

  /* Standard print action - print active form A4 preview */
  body:not(.print-search-report-active) .preview-container {
    padding: 0 !important;
    background-color: white !important;
    background: none !important;
    overflow: visible !important;
    display: block !important;
  }

  body:not(.print-search-report-active) .a4-page {
    width: 210mm;
    height: 297mm;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 10mm !important;
    page-break-after: avoid;
    page-break-before: avoid;
    box-sizing: border-box;
    display: none !important;
  }

  body:not(.print-search-report-active) .a4-page.active {
    display: flex !important;
  }

  /* Search results report print action */
  body.print-search-report-active .preview-container {
    display: none !important;
  }
  
  body.print-search-report-active #print-search-report {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* Photo Uploader Editor UI */
.photo-preview-box {
  border: 2px dashed var(--border-light);
  border-radius: 8px;
  padding: 10px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  margin-top: 5px;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  border: 2px dashed var(--border-light);
  border-radius: 8px;
  padding: 10px;
  min-height: 100px;
  background: #f9fafb;
  margin-top: 5px;
}

.photo-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: #ffffff;
}

.photo-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-delete-photo {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 5;
  padding: 0;
  line-height: 1;
}

.btn-delete-photo:hover {
  background: rgb(220, 38, 38);
}

/* Printable attachment page layout */
.attachment-page {
  page-break-before: always;
  display: none; /* hidden on screen */
  box-sizing: border-box;
  width: 210mm;
  height: 297mm;
  background-color: white;
  color: black;
  font-family: var(--font-serif);
  padding: 10mm;
}

.print-odo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid black;
  background: #fafafa;
  height: 100mm;
  overflow: hidden;
  border-radius: 4px;
}

.print-odo-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.print-photos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  border-radius: 4px;
}

.print-photo-item {
  border: 1px solid black;
  background: #fafafa;
  height: 48mm;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 4px;
}

.print-photo-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media print {
  body:not(.print-search-report-active) .attachment-page.active {
    display: flex !important;
    flex-direction: column;
  }
}
