/* ==========================================================================
   SwiftReceipt Custom Design System - styles.css
   ========================================================================== */

/* 1. Global Variables & Color Palette */
:root {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colors - Premium Indigo/Purple Neon Theme */
  --bg-primary: #0b0c16;
  --bg-card: rgba(18, 20, 38, 0.65);
  --bg-card-border: rgba(99, 102, 241, 0.15);
  --bg-card-hover-border: rgba(99, 102, 241, 0.35);
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --primary-hover: #4f46e5;
  --secondary: #a855f7;
  --secondary-hover: #9333ea;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #1f2937;
  --text-invoice-main: #111827;
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --error: #ef4444;
  
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 18px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

/* Background Glow Effects */
.bg-glow-1 {
  position: fixed;
  top: -15%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

.bg-glow-2 {
  position: fixed;
  bottom: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, rgba(0, 0, 0, 0) 75%);
  z-index: -1;
  pointer-events: none;
}

/* 3. Typography & Scrollbars */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.4);
}

/* 4. App Container & Layout */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px var(--primary-glow));
}

.header-logo h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.header-stats {
  display: flex;
  gap: 1rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.6rem 1.2rem;
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 110px;
  transition: transform var(--transition-fast);
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.2);
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

/* Workspace Grid */
.app-workspace {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* 5. Glassmorphism Card styling */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
  border-color: var(--bg-card-hover-border);
  box-shadow: 0 8px 32px 0 rgba(99, 102, 241, 0.05);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-icon {
  font-size: 1.25rem;
  color: var(--primary);
}

.card-header h2 {
  font-size: 1.15rem;
  color: #ffffff;
  font-weight: 600;
}

/* 6. Form Controls & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  transition: color var(--transition-fast);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

select option {
  background-color: #121426; /* Dark background matching the glassmorphic card design */
  color: #f3f4f6; /* White text color */
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.required {
  color: var(--error);
}

/* Input With Action Button (e.g. Lookup) */
.input-with-action {
  display: flex;
  gap: 0.5rem;
}

.input-with-action input {
  flex: 1;
}

.btn-action-input {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #ffffff;
  padding: 0 1.25rem;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.btn-action-input:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-action-input:active {
  transform: translateY(1px);
}

.field-help {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Checkbox Style */
.checkbox-group {
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 2rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  user-select: none;
  min-height: 20px;
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 20px;
  width: 20px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.custom-checkbox:hover input ~ .checkmark {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

.custom-checkbox .checkmark:after {
  left: 6.5px;
  top: 2.5px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 7. Receiver Option Tabs & Address Wrappers */
.address-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

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

.address-tab {
  cursor: pointer;
}

.address-tab input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.address-tab .tab-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.6rem 0.5rem;
  border-radius: var(--border-radius-md);
  text-align: center;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.address-tab:hover .tab-content {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.2);
}

.address-tab input:checked + .tab-content {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.tab-num {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.tab-lbl {
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 500;
}

.address-content-wrapper {
  display: none;
  animation: fadeIn var(--transition-normal);
}

.address-content-wrapper.active {
  display: block;
}

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

/* Calculation summary section */
.calculation-summary {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.calc-row span:last-child {
  font-family: var(--font-mono);
  color: var(--text-main);
}

.calc-row.total-row {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.calc-row.total-row span:last-child {
  color: var(--secondary);
  font-size: 1.25rem;
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

/* 8. Buttons & Actions */
.action-footer {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-primary, .btn-secondary {
  font-family: var(--font-sans);
  border-radius: var(--border-radius-md);
  padding: 0.9rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-normal);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #ffffff;
  border: none;
  flex: 1.6;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

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

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  flex: 1;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(1px);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

/* 9. Preview Layout */
.preview-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 12rem);
  position: sticky;
  top: 2rem;
}

.preview-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 0.25rem;
  margin-bottom: 1rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: #ffffff;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.preview-viewport {
  flex: 1;
  background: #ffffff; /* White card inside dashboard for realistic receipt preview */
  border-radius: var(--border-radius-lg);
  overflow-y: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8), 0 8px 32px rgba(0,0,0,0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

.preview-content {
  display: none;
  color: var(--text-invoice-main);
  animation: fadeIn var(--transition-normal);
  height: 100%;
}

.preview-content.active {
  display: block;
}

.no-preview-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  gap: 1rem;
  padding: 3rem;
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  min-height: 300px;
}

.no-preview-msg i {
  font-size: 3rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* CRM Database status styling */
.admin-database-card {
  margin-top: 1.5rem;
  margin-bottom: 0;
  padding: 1.25rem;
}

.admin-database-card .card-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
}

.db-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.db-stat-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius-sm);
  text-align: center;
}

.db-title {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.db-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--success);
}

.db-buttons {
  display: flex;
  justify-content: flex-end;
}

/* 10. Toasts Notification Layout */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: rgba(18, 20, 38, 0.95);
  border-left: 4px solid var(--primary);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  max-width: 450px;
  animation: slideIn var(--transition-normal);
  color: var(--text-main);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--error);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast-icon {
  font-size: 1.2rem;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }
.toast.warning .toast-icon { color: var(--warning); }

.toast-message {
  font-size: 0.9rem;
  font-weight: 500;
}

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.fade-out {
  animation: fadeOut var(--transition-normal) forwards;
}

@keyframes fadeOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* 11. OFF-SCREEN Print styles for html2pdf.js */
.offscreen-print-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 794px; /* A4 width standard at 96 DPI */
  opacity: 0;
  pointer-events: none;
  z-index: -9999;
}

/* ==========================================================================
   Receipt Template Design (Applies to live preview and PDFs)
   ========================================================================== */
.pdf-print-wrapper {
  background: #ffffff;
  color: var(--text-invoice-main);
  padding: 40px;
  font-family: 'Outfit', sans-serif;
  line-height: 1.4;
  border-radius: 0;
}

/* Common Invoice Elements */
.receipt-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 25px;
  margin-bottom: 25px;
}

.receipt-branding h2 {
  font-size: 24px;
  font-weight: 800;
  color: #1e1b4b;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.receipt-branding p {
  font-size: 12px;
  color: #6b7280;
}

.receipt-meta {
  text-align: right;
}

.receipt-meta h3 {
  font-size: 20px;
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.receipt-meta p {
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 2px;
}

.receipt-meta strong {
  color: #111827;
  font-family: var(--font-mono);
}

.receipt-address-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.address-block h4 {
  font-size: 11px;
  text-transform: uppercase;
  color: #8b5cf6;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 4px;
}

.address-block p {
  font-size: 13.5px;
  color: #1f2937;
  line-height: 1.45;
}

.address-block strong {
  font-size: 14.5px;
  color: #111827;
  display: block;
  margin-bottom: 2px;
}

/* Itemized Details Table */
.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 25px;
}

.receipt-table th {
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.receipt-table td {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: #334155;
  vertical-align: middle;
}

.receipt-table .num-col {
  text-align: right;
  font-family: var(--font-mono);
}

.receipt-table th.num-col {
  text-align: right;
}

.receipt-table td strong {
  color: #0f172a;
}

/* Totals Breakdown */
.receipt-summary-block {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  align-items: start;
  margin-bottom: 35px;
}

.receipt-notes {
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  padding: 12px 15px;
  border-radius: 6px;
  border-left: 3px solid #cbd5e1;
}

.receipt-notes h5 {
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.receipt-totals {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.totals-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #475569;
}

.totals-item .val {
  font-family: var(--font-mono);
  color: #0f172a;
}

.totals-item.grand-total {
  border-top: 2px solid #e2e8f0;
  padding-top: 10px;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  color: #1e1b4b;
}

.totals-item.grand-total .val {
  font-size: 20px;
  color: #4f46e5;
}

.receipt-footer {
  text-align: center;
  border-top: 1px solid #e2e8f0;
  padding-top: 20px;
  margin-top: 20px;
  font-size: 11px;
  color: #94a3b8;
}

/* INTERNAL RECEIPT SPECIFICS */
.internal-badge-watermark {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  color: #991b1b;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 15px;
}

.internal-checklist {
  background: #fdfaf7;
  border: 1px solid #ffedd5;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 25px;
}

.internal-checklist h4 {
  font-size: 12px;
  color: #c2410c;
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.checklist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.checklist-item {
  font-size: 12px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checklist-item i {
  color: #f97316;
}

.internal-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 40px;
  margin-bottom: 20px;
}

.sig-box {
  border-top: 1px dashed #cbd5e1;
  padding-top: 8px;
  text-align: center;
  font-size: 11px;
  color: #64748b;
}

.sig-box p {
  margin-bottom: 2px;
}

.sig-line {
  height: 40px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .app-workspace {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .preview-panel {
    height: auto;
    position: static;
  }
  
  .preview-viewport {
    min-height: 500px;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 1.5rem 1rem;
  }
  
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .header-stats {
    width: 100%;
    justify-content: space-between;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .address-options {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .action-footer {
    flex-direction: column;
  }
  
  .btn-primary {
    order: -1;
  }
}

/* Interactive Itemization Table inside Form */
.itemization-container {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.itemization-container > label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.01);
}

.itemization-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 500px;
}

.itemization-table th {
  padding: 0.75rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-light);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.itemization-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.itemization-table tr:last-child td {
  border-bottom: none;
}

.itemization-table td.sno-cell {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-mono);
}

.goods-type-cell-wrapper {
  position: relative;
}

.row-desc-subtext {
  position: absolute;
  top: 100%;
  left: 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  pointer-events: none;
  margin-top: 2px;
  line-height: 1;
}

.itemization-table input,
.itemization-table select {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.itemization-table input:focus,
.itemization-table select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
}

.itemization-table input[readonly] {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 500;
  cursor: not-allowed;
  text-align: right;
}

.itemization-table .row-rate {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  text-align: right;
  padding: 0.4rem 0.5rem;
}

.itemization-table .amount-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
  display: block;
  padding: 0.4rem 0.5rem;
}

.btn-delete-row {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.btn-delete-row:hover {
  background: rgba(239, 68, 68, 0.1);
  transform: scale(1.1);
}

/* Terms & Conditions Disclaimer on Client Receipt */
.receipt-terms-conditions {
  margin-top: 25px;
  border-top: 1px solid #e5e7eb;
  padding-top: 15px;
  font-size: 8pt;
  line-height: 1.35;
  color: #4b5563;
}

.receipt-terms-conditions h5 {
  font-size: 9pt;
  font-weight: 700;
  color: #1f2937;
  margin-top: 0;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.receipt-terms-conditions p {
  margin-bottom: 5px;
  font-weight: 600;
  color: #374151;
}

.receipt-terms-conditions ul {
  list-style-type: disc;
  padding-left: 15px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.receipt-terms-conditions li {
  margin-bottom: 0;
  color: #4b5563;
}

/* Custom Action Buttons Styling */
.action-buttons-group {
  display: flex;
  gap: 0.75rem;
  flex-grow: 1;
}

.btn-generate-rec {
  background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
  color: #ffffff;
  border: none;
  font-family: var(--font-sans);
  border-radius: var(--border-radius-md);
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-normal);
  flex-grow: 1;
}

.btn-generate-rec:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.btn-download-pdf-rec {
  background: #7c3aed; /* Violet / Purple solid */
  color: #ffffff;
  border: none;
  font-family: var(--font-sans);
  border-radius: var(--border-radius-md);
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-normal);
  flex-grow: 1;
}

.btn-download-pdf-rec:hover {
  background: #6d28d9;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-print-rec {
  background: #4338ca; /* Dark purple / Indigo solid */
  color: #ffffff;
  border: none;
  font-family: var(--font-sans);
  border-radius: var(--border-radius-md);
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-normal);
  flex-grow: 1;
}

.btn-print-rec:hover {
  background: #3730a3;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(67, 56, 202, 0.4);
}

@media (max-width: 768px) {
  .action-buttons-group {
    flex-direction: column;
    width: 100%;
  }
}

/* Print Stylesheet overrides */
@media print {
  /* Hide dashboard and layout controls completely */
  body > :not(.app-container),
  .app-container,
  .bg-glow-1,
  .bg-glow-2,
  #toast-container,
  .offscreen-print-container {
    display: none !important;
  }
  
  .app-header,
  .control-panel,
  .preview-tabs,
  .admin-database-card,
  .action-footer {
    display: none !important;
  }
  
  /* Reset workspace bounds and layout wrapper grids */
  .app-workspace {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .preview-panel {
    display: block !important;
    position: static !important;
    height: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .preview-viewport {
    display: block !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* Hide inactive preview sheet */
  .preview-content:not(.active) {
    display: none !important;
  }
  
  /* Print formatting for active preview */
  .preview-content.active {
    display: block !important;
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .preview-content.active > div {
    box-shadow: none !important;
    padding: 0 !important;
    border: none !important;
  }
}

/* ==========================================================================
   Client & Consignee Profile Module Styling
   ========================================================================== */

/* Profile Section Layout */
.profile-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.profile-section-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.profile-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 1.25rem 0;
}

/* Smart Search Layout */
.search-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper input {
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.95rem;
}

.btn-clear-search {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: all var(--transition-fast);
}

.btn-clear-search:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Search Dropdown styling */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(18, 20, 38, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-md);
  margin-top: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  padding: 0.5rem 0;
  animation: fadeIn var(--transition-fast) forwards;
}

.search-dropdown-item {
  padding: 0.6rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: all var(--transition-fast);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.search-dropdown-item:last-child {
  border-bottom: none;
}

.search-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.12);
}

.search-dropdown-item .cust-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
}

.search-dropdown-item .cust-details {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
}

.search-dropdown-item .cust-postcodes {
  font-size: 0.7rem;
  color: var(--secondary);
  font-style: italic;
  margin-top: 0.1rem;
}

.search-no-results {
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Receivers Selection Cards Grid */
.receivers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.receiver-addr-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-md);
  padding: 0.75rem;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 85px;
}

.receiver-addr-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.receiver-addr-card.selected {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.receiver-addr-card .addr-text {
  font-size: 0.8rem;
  color: var(--text-main);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.receiver-addr-card .addr-badge {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.receiver-addr-card.selected .addr-badge {
  color: var(--primary);
  font-weight: 600;
}

/* ==========================================================================
   Login PIN Overlay / Screen Lock
   ========================================================================== */
.lock-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 10, 24, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.4s ease-out, visibility 0.4s ease-out;
}

.lock-screen-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lock-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.lock-logo {
  margin-bottom: 2rem;
}

.lock-logo .logo-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.lock-logo h2 {
  font-size: 1.5rem;
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.lock-logo p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pin-inputs-wrapper {
  margin-bottom: 1rem;
}

#pin-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1rem;
  font-size: 2rem;
  letter-spacing: 0.6rem;
  text-align: center;
  color: #ffffff;
  outline: none;
  font-family: var(--font-mono);
  transition: all var(--transition-fast);
}

#pin-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

#pin-input::placeholder {
  color: rgba(255, 255, 255, 0.15);
  letter-spacing: 0.2rem;
}

.pin-error-msg {
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  animation: shake 0.3s ease-in-out;
}

.lock-hint {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lock-hint strong {
  color: var(--secondary);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

