/* BMS Complaint Center CSS */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(20, 30, 48, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-glow: rgba(99, 102, 241, 0.15);
  
  --primary-color: #6366f1; /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.5);
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  
  --color-new: #3b82f6; /* Blue */
  --color-in-progress: #f59e0b; /* Amber */
  --color-closed: #10b981; /* Emerald */
  --color-critical: #ef4444; /* Red */
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #1f2937;
  
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 1px 0 rgba(255, 255, 255, 0.05) inset;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Background Gradients */
body::before {
  content: '';
  position: fixed;
  top: -10%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  bottom: -10%;
  left: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

/* Branded Header Styling */
.header-brand {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}

.brand-logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Custom Caduceus Logo */
.caduceus-icon {
  width: 48px;
  height: 48px;
  color: #38bdf8;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5));
}

.brand-text h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(to right, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
}

/* Navigation */
.nav-links {
  margin-left: auto;
  display: flex;
  gap: 1rem;
}

.btn-nav {
  text-decoration: none;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.btn-nav:hover {
  background: var(--primary-color);
  box-shadow: 0 0 15px var(--primary-glow);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.btn-nav.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

/* Glassmorphic Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(99, 102, 241, 0.2);
}

/* Form Styles */
.form-title {
  text-align: center;
  margin-bottom: 2rem;
}

.form-title h2 {
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-title p {
  color: var(--text-muted);
}

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.form-section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #818cf8;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

@media (max-width: 768px) {
  .form-group.col-span-2 {
    grid-column: span 1;
  }
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
  background: rgba(17, 24, 39, 0.95);
}

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

/* Buttons */
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-purple) 100%);
  color: #fff;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  opacity: 0.95;
}

.btn-submit:active {
  transform: translateY(0);
}

/* Success Card */
.success-card {
  text-align: center;
  padding: 3rem 2rem;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid var(--accent-emerald);
  color: var(--accent-emerald);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.5rem;
  animation: pulseSuccess 2s infinite;
}

@keyframes pulseSuccess {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.serial-display {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  border: 1px dashed var(--primary-color);
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1.8rem;
  font-weight: 700;
  color: #818cf8;
  letter-spacing: 2px;
  margin: 1.5rem 0;
}

/* Dashboard UI Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* Metrics Section */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 1024px) {
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .metrics-row {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  position: relative;
  overflow: hidden;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 1.75rem 1.5rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35), 0 0 1px 1px rgba(99, 102, 241, 0.1) inset;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.metric-icon.total { background: rgba(99, 102, 241, 0.12); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.2); }
.metric-icon.pending { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }
.metric-icon.progress { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.metric-icon.closed { background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }

.metric-info h4 {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.metric-info p {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

/* Controls / Filter Bar */
.control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 1.25rem 1.75rem;
  border-radius: 16px;
  align-items: center;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-premium);
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-wrapper input {
  padding-left: 2.75rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--glass-border);
}

.search-wrapper::before {
  content: '🔍';
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  opacity: 0.55;
  pointer-events: none;
}

.filter-wrapper {
  display: flex;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .filter-wrapper {
    width: 100%;
  }
  .filter-wrapper select {
    flex: 1;
  }
}

/* Status Tabs Navigation (Pill Switcher Layout) */
.tabs-nav {
  display: flex;
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid var(--glass-border);
  padding: 0.35rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  gap: 0.5rem;
  width: fit-content;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: #fff;
  background: var(--primary-color);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.tab-btn.active::after {
  display: none;
}

.tab-count {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  margin-left: 0.6rem;
  color: var(--text-muted);
  font-weight: 700;
}

.tab-btn.active .tab-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Complaint Grid/List */
.complaints-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.complaint-card {
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.75rem;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
  box-shadow: var(--shadow-premium);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.complaint-card:hover {
  transform: translateY(-6px) scale(1.015);
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35), 0 0 1px 1px rgba(99, 102, 241, 0.2) inset;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.card-serial {
  font-size: 0.95rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.status-new { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge.status-progress { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge.status-closed { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

/* Pulsing Status Dot inside Badge */
.pulsing-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  background-color: currentColor;
  animation: pulseDot 1.6s infinite;
  vertical-align: middle;
}

@keyframes pulseDot {
  0% { transform: scale(0.85); opacity: 0.55; }
  50% { transform: scale(1.35); opacity: 1; filter: drop-shadow(0 0 3px currentColor); }
  100% { transform: scale(0.85); opacity: 0.55; }
}

.badge {
  display: inline-flex;
  align-items: center;
}

.card-download-btn {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #22d3ee;
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.card-download-btn:hover {
  background: #06b6d4;
  color: white;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}


.card-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 54px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Slide-in Detail Drawer / Panel */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: -550px;
  width: 550px;
  max-width: 100%;
  height: 100vh;
  background: #0d1321;
  border-left: 1px solid var(--glass-border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 576px) {
  .drawer {
    width: 100%;
  }
}

.drawer.active {
  right: 0;
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title-area {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.drawer-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #38bdf8;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.7rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.drawer-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(17, 24, 39, 0.8);
  display: flex;
  gap: 1rem;
}

/* Drawer Section Tabs */
.drawer-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.3rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--glass-border);
}

.drawer-tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.drawer-tab-btn.active {
  background: var(--primary-color);
  color: #fff;
}

.drawer-tab-content {
  display: none;
}

.drawer-tab-content.active {
  display: block;
}

/* Spare Parts Table Builder */
.spare-parts-table-container {
  margin-top: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  overflow: hidden;
}

.spare-parts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.spare-parts-table th, 
.spare-parts-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.spare-parts-table th {
  background: rgba(17, 24, 39, 0.6);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
}

.spare-parts-table input {
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  background: rgba(17, 24, 39, 0.8);
}

.btn-icon-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-icon-danger:hover {
  background: var(--color-critical);
  color: white;
}

.btn-add-row {
  background: rgba(99, 102, 241, 0.1);
  border: 1px dashed var(--primary-color);
  color: #818cf8;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.75rem;
  width: 100%;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-add-row:hover {
  background: rgba(99, 102, 241, 0.2);
  color: white;
}

/* Action Buttons inside Drawer */
.btn-action {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-action.btn-save {
  background: var(--primary-color);
  color: white;
  border: none;
}
.btn-action.btn-save:hover {
  background: #4f46e5;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.btn-action.btn-close-ticket {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-closed);
}
.btn-action.btn-close-ticket:hover {
  background: var(--color-closed);
  color: white;
}

.btn-action.btn-pdf {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
}
.btn-action.btn-pdf:hover {
  background: var(--accent-cyan);
  color: white;
}

.btn-action.btn-print {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
}
.btn-action.btn-print:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  grid-column: 1 / -1;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* PRINT TEMPLATE GLOBAL STYLES (Enables html2pdf.js to format properly in screen mode) */
#print-template {
  display: none;
}

#print-template.active-for-pdf {
  display: block !important;
  position: relative !important;
  color: #000000 !important;
  background: #ffffff !important;
}

.print-page {
  width: 210mm;
  height: 297mm; /* Hardcode to A4 height */
  margin: 0 auto;
  padding: 8mm 12mm; /* Tightened padding */
  color: #000000 !important;
  background: #ffffff !important;
  font-family: Arial, Helvetica, sans-serif !important;
  box-sizing: border-box;
  overflow: hidden; /* Lock overflow to prevent second page spill */
}

/* Header Styling */
.print-header {
  display: flex;
  align-items: center;
  border-bottom: 2px solid #000000;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.print-logo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90px;
  text-align: center;
}

.print-logo-text {
  font-size: 15px;
  font-weight: 800;
  font-family: 'Times New Roman', serif;
  margin-top: 3px;
  letter-spacing: 1px;
  color: #000 !important;
}

.print-details-col {
  flex: 1;
  padding-left: 15px;
}

.print-company-name {
  font-size: 24px;
  font-weight: 900;
  color: #002b80 !important; /* Matches blue font on physical form */
  font-family: Arial, Helvetica, sans-serif;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.print-company-desc {
  font-size: 8.5px;
  font-weight: bold;
  border-bottom: 1.5px solid #000;
  padding-bottom: 1px;
  margin-bottom: 3px;
  color: #000 !important;
}

.print-addresses {
  font-size: 7px;
  line-height: 1.3;
  font-weight: 600;
  color: #000 !important;
}

.print-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.print-report-title {
  border: 1.5px solid #000;
  padding: 2px 15px;
  font-weight: bold;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #000 !important;
}

.print-serial-no {
  font-size: 13px;
  font-weight: bold;
  color: #000 !important;
}

.print-serial-no span {
  font-weight: bold;
  font-size: 16px;
  color: #ff0000 !important; /* Red serial numbers like physical form */
}

/* Two column block layouts (Costumer & Equipment Details) */
.print-details-grid {
  display: flex;
  gap: 15px;
  margin-bottom: 10px;
}

.print-block {
  flex: 1;
  border: 1.5px solid #000000;
  border-radius: 8px;
  padding: 8px;
  background: #ffffff !important;
}

.print-block-title {
  font-weight: bold;
  font-size: 10px;
  text-transform: uppercase;
  border-bottom: 1.5px solid #000;
  padding-bottom: 2px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  color: #000 !important;
}

.print-field-row {
  display: flex;
  margin-bottom: 4px;
  align-items: flex-end;
  font-size: 9px;
}

.print-label {
  font-weight: bold;
  width: 80px;
  flex-shrink: 0;
  color: #000 !important;
}

.print-value {
  flex: 1;
  border-bottom: 1px solid #000;
  padding-left: 5px;
  min-height: 14px;
  font-family: Courier, monospace;
  font-size: 9.5px;
  color: #000 !important;
}

/* Full-width block texts (Lined Paper Effect) */
.print-section {
  margin-bottom: 8px;
}

.print-section-title {
  font-weight: bold;
  font-size: 10px;
  margin-bottom: 3px;
  color: #000 !important;
}

.print-section-content {
  border-bottom: 1px solid #000;
  padding: 2px 5px;
  font-family: Courier, monospace;
  line-height: 20px; /* Reduced from 24px */
  font-size: 10px;
  color: #000000 !important;
  background: linear-gradient(rgba(0,0,0,0) 95%, rgba(0,0,0,0.12) 95%) 0 0 / 100% 20px !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

#print-complaintProblem,
#print-workDone {
  min-height: 100px; /* 5 lines of 20px, reduced from 144px */
}

#print-causesOfProblem {
  min-height: 40px; /* 2 lines of 20px, reduced from 48px */
}

/* Remarks / Spare Parts Table */
.print-remarks-title {
  font-weight: bold;
  font-size: 10px;
  margin-bottom: 3px;
  color: #000 !important;
}

.print-parts-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.print-parts-table th, 
.print-parts-table td {
  border: 1px solid #000000 !important;
  padding: 4px 6px; /* Tightened from 5px */
  text-align: left;
  font-size: 9px;
  color: #000000 !important;
}

.print-parts-table th {
  background: #f0f0f0 !important;
  font-weight: bold;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.print-parts-table td {
  font-family: Courier, monospace;
}

/* Pricing Grid */
.print-charges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 12px;
}

.print-charge-item {
  display: flex;
  align-items: flex-end;
  width: calc(50% - 10px);
  font-size: 9px;
}

.print-charge-label {
  font-weight: bold;
  width: 110px;
  color: #000 !important;
}

.print-charge-value {
  flex: 1;
  border-bottom: 1px solid #000;
  padding-left: 5px;
  min-height: 14px;
  font-family: Courier, monospace;
  font-weight: bold;
  color: #000 !important;
}

/* Signature blocks */
.print-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 15px; /* Reduced from 30px */
  padding-top: 8px;
}

.print-sig-block {
  width: 30%;
  text-align: center;
  font-size: 9px;
  color: #000 !important;
}

.print-sig-title {
  font-weight: bold;
  margin-bottom: 22px; /* Tightened from 30px */
}

.print-sig-name-line {
  border-bottom: 1px solid #000;
  min-height: 14px;
  font-family: Courier, monospace;
  margin-bottom: 3px;
  color: #000 !important;
}

.print-sig-labels {
  display: flex;
  justify-content: space-around;
  font-size: 8px;
  color: #444 !important;
}

/* BROWSER NATIVE PRINT OVERRIDES */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  
  .header-brand, 
  .container, 
  .drawer-overlay, 
  .drawer {
    display: none !important;
  }

  #print-template {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    position: absolute;
    left: 0;
    top: 0;
  }

  .print-page {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}
