/* Gujrat Garage CRM - Black & Red Automotive Performance Theme (100% Offline) */

:root {
  --bg-body: #f4f4f5;
  --bg-surface: #ffffff;
  --bg-sidebar: #09090b;
  --bg-sidebar-hover: #18181b;
  --bg-sidebar-active: #dc2626;
  
  --text-main: #09090b;
  --text-muted: #71717a;
  --text-light: #a1a1aa;
  --text-inverse: #ffffff;
  
  --border-color: #e4e4e7;
  --border-focus: #dc2626;
  
  --primary: #dc2626;
  --primary-hover: #b91c1c;
  --primary-light: #fee2e2;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0284c7;
  --info-light: #e0f2fe;
  --purple: #7c3aed;
  --purple-light: #f5f3ff;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid #18181b;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid #18181b;
}

.logo-badge {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  color: #a1a1aa;
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background-color: var(--bg-sidebar-active);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #18181b;
  font-size: 0.75rem;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Main Content Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

/* Header & Search Bar */
.top-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  border-top: 3px solid #dc2626;
  padding: 0.875rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.search-box-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.search-input-group {
  display: flex;
  align-items: center;
  background-color: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  gap: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input-group:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
  background-color: #ffffff;
}

.search-input-group input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.9rem;
  color: var(--text-main);
}

.live-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  display: none;
  z-index: 50;
}

.live-search-item {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text-main);
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.1s;
}

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

.live-search-item:hover {
  background-color: var(--primary-light);
}

.live-search-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.live-search-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Page Body */
.page-content {
  padding: 1.75rem 2rem 3rem 2rem;
  flex: 1;
}

/* Typography & Headers */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.page-description {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.2rem;
}

/* Cards */
.card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.card-body {
  padding: 1.25rem;
}

/* Stats / KPI Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
}

.stat-card-link {
  cursor: pointer;
}

.stat-card-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(220, 38, 38, 0.15);
  border-color: #fca5a5;
}

.stat-card-link:hover .stat-label {
  color: var(--primary);
}

.stat-card-link:hover .stat-action-hint {
  color: var(--primary);
  transform: translateX(3px);
}

.stat-card-accent-red {
  border-top: 3px solid #dc2626;
}

.stat-card-accent-dark {
  border-top: 3px solid #09090b;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.15s ease;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.stat-icon-red {
  background-color: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.stat-icon-dark {
  background-color: #18181b;
  color: #ffffff;
  border: 1px solid #27272a;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.stat-meta {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-action-hint {
  font-weight: 700;
  font-size: 0.75rem;
  color: #a1a1aa;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  transition: all 0.15s ease;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: #f1f5f9;
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background-color: #059669;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-outline-danger {
  background: transparent;
  border-color: #fca5a5;
  color: var(--danger);
}

.btn-outline-danger:hover {
  background-color: var(--danger-light);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.725rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-primary { background-color: var(--primary-light); color: var(--primary); }
.badge-secondary { background-color: #f1f5f9; color: var(--text-muted); }
.badge-success { background-color: var(--success-light); color: #065f46; }
.badge-warning { background-color: var(--warning-light); color: #92400e; }
.badge-danger { background-color: var(--danger-light); color: #991b1b; }
.badge-info { background-color: var(--info-light); color: #155e75; }
.badge-purple { background-color: var(--purple-light); color: #5b21b6; }

/* Payment Method Specific Badges */
.badge-payment {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: 6px;
  font-size: 0.735rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.25;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.badge-payment svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Cash: Crisp Emerald Green */
.badge-payment-cash,
.badge-method-cash,
.badge.badge-method-cash {
  background-color: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}
.badge-payment-cash svg,
.badge-method-cash svg {
  stroke: #15803d !important;
}

/* Credit Card: Vibrant Royal Blue */
.badge-payment-credit-card,
.badge-payment-card,
.badge-method-credit,
.badge-method-credit-card,
.badge.badge-method-credit-card {
  background-color: #dbeafe !important;
  color: #1d4ed8 !important;
  border: 1px solid #93c5fd !important;
}
.badge-payment-credit-card svg,
.badge-payment-card svg,
.badge-method-credit svg {
  stroke: #1d4ed8 !important;
}

/* Debit Card: Electric Indigo / Cyan */
.badge-payment-debit-card,
.badge-payment-debit,
.badge-method-debit,
.badge-method-debit-card,
.badge.badge-method-debit-card {
  background-color: #e0e7ff !important;
  color: #4338ca !important;
  border: 1px solid #a5b4fc !important;
}
.badge-payment-debit-card svg,
.badge-payment-debit svg,
.badge-method-debit svg {
  stroke: #4338ca !important;
}

/* Bank Transfer: Noble Purple / Violet */
.badge-payment-bank-transfer,
.badge-payment-bank,
.badge-method-bank,
.badge-method-bank-transfer,
.badge.badge-method-bank-transfer {
  background-color: #f3e8ff !important;
  color: #7e22ce !important;
  border: 1px solid #d8b4fe !important;
}
.badge-payment-bank-transfer svg,
.badge-payment-bank svg,
.badge-method-bank svg {
  stroke: #7e22ce !important;
}

/* Check / Cheque: Warm Amber / Gold */
.badge-payment-check,
.badge-payment-cheque,
.badge-method-check,
.badge.badge-method-check {
  background-color: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}
.badge-payment-check svg,
.badge-method-check svg {
  stroke: #b45309 !important;
}

/* Mobile Payment: Fresh Teal */
.badge-payment-mobile-payment,
.badge-payment-mobile,
.badge-method-mobile,
.badge.badge-method-mobile {
  background-color: #ccfbf1 !important;
  color: #0f766e !important;
  border: 1px solid #5eead4 !important;
}
.badge-payment-mobile-payment svg,
.badge-payment-mobile svg,
.badge-method-mobile svg {
  stroke: #0f766e !important;
}

/* Fallback / Other */
.badge-payment-default,
.badge-method-default {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}
.badge-payment-default svg,
.badge-method-default svg {
  stroke: #475569 !important;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

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

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-main);
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

/* Alert Flashes */
.alert-container {
  margin-bottom: 1.25rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-success { background-color: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background-color: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background-color: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background-color: var(--info-light); color: #155e75; border: 1px solid #a5f3fc; }

/* Status Tabs */
.status-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.status-tab {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.status-tab:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.status-tab.active {
  background: var(--bg-sidebar);
  color: #ffffff;
  border-color: var(--bg-sidebar);
}

.status-tab-count {
  background: rgba(0,0,0,0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  font-size: 0.725rem;
}

.status-tab.active .status-tab-count {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 9, 11, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  padding: 1.5rem;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* Clean Printable Invoice Styling */
.invoice-container {
  max-width: 860px;
  margin: 0 auto;
  background: #ffffff;
  padding: 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.5rem;
  border-bottom: 3px solid #dc2626;
  margin-bottom: 1.5rem;
}

.invoice-brand h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #09090b;
  letter-spacing: -0.02em;
}

.invoice-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

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

.invoice-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.invoice-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.invoice-box-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.invoice-summary-table {
  margin-left: auto;
  width: 340px;
  border-collapse: collapse;
  margin-top: 1rem;
}

.invoice-summary-table td {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
}

.invoice-summary-table tr.grand-total td {
  font-size: 1.15rem;
  font-weight: 800;
  border-top: 2px solid #09090b;
  border-bottom: 2px solid #09090b;
  padding: 0.6rem 0.75rem;
}

.invoice-summary-table tr.balance-due td {
  font-size: 1.15rem;
  font-weight: 800;
  color: #b91c1c;
}

.invoice-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.signature-block {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
}

.signature-line {
  width: 240px;
  border-top: 1px solid #94a3b8;
  padding-top: 0.35rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* UAE City-Wise License Plates (Authentic 3D Metallic Embossed Design) */
.uae-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 60%, #e2e8f0 100%);
  border: 1.5px solid #09090b;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), inset 0 1px 0 #ffffff, inset 0 -1px 0 #cbd5e1;
  padding: 2px 7px;
  gap: 7px;
  position: relative;
  vertical-align: middle;
  line-height: 1;
  user-select: none;
  white-space: nowrap;
  font-feature-settings: "tnum";
  text-decoration: none;
}

.uae-plate:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 #ffffff;
}

.uae-plate-screw {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #94a3b8;
  border: 1px solid #64748b;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.4);
  flex-shrink: 0;
}

.uae-plate-logo-zone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.uae-plate-code-box {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.06);
}

.uae-plate-code-char {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Impact, sans-serif;
  font-weight: 900;
  font-size: 0.925rem;
  color: #09090b;
  letter-spacing: 0.5px;
}

.uae-plate-number-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
}

.uae-plate-digits {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Arial Black", monospace;
  font-size: 1.15rem;
  font-weight: 900;
  color: #09090b;
  letter-spacing: 1.5px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Emirate specific accent border hints */
.uae-plate.uae-plate-em-ajm {
  border-color: #8B0000;
  box-shadow: 0 1px 3px rgba(139, 0, 0, 0.2), inset 0 1px 0 #ffffff;
}

.uae-plate.uae-plate-em-dxb {
  border-color: #09090b;
  border-left: 3px solid #dc2626;
}

.uae-plate.uae-plate-em-auh {
  border-color: #991b1b;
  border-left: 3px solid #b91c1c;
}

.uae-plate.uae-plate-em-shj {
  border-color: #ea580c;
}

.uae-plate.uae-plate-em-rak {
  border-color: #991b1b;
}

/* Sizes */
.uae-plate-sm {
  padding: 1px 5px;
  gap: 5px;
}
.uae-plate-sm .uae-plate-code-char {
  font-size: 0.75rem;
}
.uae-plate-sm .uae-plate-digits {
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.uae-plate-lg {
  padding: 4px 12px;
  gap: 12px;
  border-width: 2px;
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22), inset 0 1px 0 #ffffff;
}
.uae-plate-lg .uae-plate-screw {
  width: 6px;
  height: 6px;
}
.uae-plate-lg .uae-plate-code-box {
  padding: 3px 8px;
}
.uae-plate-lg .uae-plate-code-char {
  font-size: 1.25rem;
}
.uae-plate-lg .uae-plate-digits {
  font-size: 1.6rem;
  letter-spacing: 2.5px;
}

.uae-plate-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
}

/* Print Overrides: Calibrated for ISO A4 (210mm x 297mm) */
@page {
  size: A4 portrait;
  margin: 8mm 12mm 10mm 12mm;
}

@media print {
  *, *::before, *::after {
    box-sizing: border-box !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .app-sidebar,
  .top-header,
  .page-header,
  .no-print,
  .alert-container,
  .btn,
  .modal-overlay {
    display: none !important;
  }

  .app-container,
  .app-main,
  .page-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  .invoice-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .invoice-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    border-bottom: 2.5px solid #dc2626 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .invoice-header .invoice-brand {
    max-width: 490px !important;
  }

  .invoice-header .invoice-brand img {
    height: 52px !important;
  }

  .invoice-header .invoice-brand h1 {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
  }

  .invoice-header .invoice-brand p {
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
    margin-bottom: 0.15rem !important;
  }

  .invoice-meta {
    text-align: right !important;
  }

  .invoice-info-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    padding: 0.75rem 0.95rem !important;
    margin-bottom: 0.75rem !important;
    gap: 1.25rem !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .invoice-concern-box {
    padding: 0.55rem 0.9rem !important;
    margin-bottom: 0.75rem !important;
    background: #fef2f2 !important;
    border-left: 4px solid #dc2626 !important;
    border-radius: 4px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .invoice-table-section {
    margin-bottom: 0.75rem !important;
  }

  .invoice-table-section .table {
    width: 100% !important;
    margin-bottom: 0 !important;
    border-collapse: collapse !important;
    border: 1px solid #cbd5e1 !important;
  }

  .invoice-table-section .table th {
    padding: 0.42rem 0.65rem !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    background: #f1f5f9 !important;
    border-bottom: 1.5px solid #94a3b8 !important;
    color: #0f172a !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
  }

  .invoice-table-section .table td {
    padding: 0.45rem 0.65rem !important;
    font-size: 0.86rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
  }

  .invoice-totals-section {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-top: 0.75rem !important;
    gap: 1.25rem !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .invoice-summary-table {
    width: 330px !important;
    border-collapse: collapse !important;
  }

  .invoice-summary-table td {
    padding: 0.32rem 0.65rem !important;
    font-size: 0.86rem !important;
  }

  .invoice-summary-table .grand-total td {
    padding: 0.42rem 0.65rem !important;
    font-size: 0.98rem !important;
    font-weight: 800 !important;
  }

  .invoice-summary-table .balance-due td {
    padding: 0.48rem 0.65rem !important;
    font-size: 1.12rem !important;
    font-weight: 900 !important;
  }

  .payment-history-section {
    margin-top: 0.75rem !important;
    padding-top: 0.5rem !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .payment-history-item {
    padding: 0.38rem 0.7rem !important;
    font-size: 0.84rem !important;
  }

  .invoice-terms-policy {
    margin-top: 0.75rem !important;
    padding: 0.5rem 0.8rem !important;
    font-size: 0.76rem !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .signature-block {
    display: flex !important;
    justify-content: space-between !important;
    margin-top: 1.5rem !important;
    padding-top: 0.75rem !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .signature-line {
    width: 270px !important;
    text-align: center !important;
  }

  .signature-line div[style*="height: 48px"] {
    height: 50px !important;
  }

  .invoice-barcode-container {
    display: flex !important;
    justify-content: flex-end !important;
    margin-top: 0.45rem !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .invoice-barcode-svg {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
  }

  table, tr, td, th, tbody, thead,
  .invoice-header, .invoice-info-grid, .invoice-concern-box,
  .invoice-totals-section, .invoice-terms-policy,
  .signature-block, .payment-history-section {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}

