/* ==========================================================================
   ADE-MADE GLOBAL CONCEPT LIMITED - SALES & OPERATIONS SYSTEM
   Design System: Deep Green, Warm Gold, Charcoal, Off-White
   Mobile-First, Accessible, Touch-Friendly, Print-Ready
   ========================================================================== */

:root {
  /* Brand Palette */
  --brand-green: #0C5A35;
  --brand-green-hover: #084327;
  --brand-green-light: #EBF7EE;
  --brand-green-border: #A3D9B5;

  --brand-gold: #D49B1F;
  --brand-gold-hover: #B88210;
  --brand-gold-light: #FFF9E6;
  --brand-gold-border: #F3D27E;

  --charcoal: #1F2937;
  --charcoal-light: #4B5563;
  --charcoal-muted: #9CA3AF;
  
  --bg-app: #F3F4F6;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #FFFFFF;
  --border-color: #E5E7EB;
  --border-focus: #0C5A35;

  /* Semantic Status Colors */
  --color-info: #2563EB;
  --color-info-bg: #EFF6FF;
  --color-success: #059669;
  --color-success-bg: #ECFDF5;
  --color-warning: #D97706;
  --color-warning-bg: #FFFBEB;
  --color-danger: #DC2626;
  --color-danger-bg: #FEF2F2;
  --color-purple: #7C3AED;
  --color-purple-bg: #F5F3FF;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --nav-height-mobile: 60px;
  --header-height: 64px;
  --sidebar-width: 260px;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: var(--font-family);
  font-size: 16px; /* Accessible standard, prevents mobile Safari zoom */
  line-height: 1.5;
  color: var(--charcoal);
  background-color: var(--bg-app);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Accessibility Focus States */
:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: var(--charcoal);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: var(--brand-green);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Button & Touch Targets */
button, input, select, textarea {
  font-family: inherit;
  font-size: var(--font-size-base);
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  min-height: 44px; /* Minimum mobile touch target */
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
  text-align: center;
  white-space: nowrap;
  user-select: none;
}

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

.btn-primary {
  background-color: var(--brand-green);
  color: #FFFFFF;
  border-color: var(--brand-green);
}
.btn-primary:hover {
  background-color: var(--brand-green-hover);
  border-color: var(--brand-green-hover);
}

.btn-gold {
  background-color: var(--brand-gold);
  color: #FFFFFF;
  border-color: var(--brand-gold);
}
.btn-gold:hover {
  background-color: var(--brand-gold-hover);
  border-color: var(--brand-gold-hover);
}

.btn-secondary {
  background-color: #FFFFFF;
  color: var(--charcoal);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: #F9FAFB;
  border-color: var(--charcoal-muted);
}

.btn-outline-green {
  background-color: transparent;
  color: var(--brand-green);
  border-color: var(--brand-green);
}
.btn-outline-green:hover {
  background-color: var(--brand-green-light);
}

.btn-danger {
  background-color: var(--color-danger);
  color: #FFFFFF;
  border-color: var(--color-danger);
}
.btn-danger:hover {
  background-color: #B91C1C;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  min-height: 36px;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  min-height: 50px;
  font-size: var(--font-size-base);
  border-radius: var(--radius-md);
}

.btn-whatsapp {
  background-color: #25D366;
  color: #FFFFFF;
  border-color: #25D366;
}
.btn-whatsapp:hover {
  background-color: #1EBE5D;
}

.btn-block {
  width: 100%;
}

.btn:disabled, .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Icons */
.icon {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  vertical-align: middle;
  fill: currentColor;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
}

.badge-demo {
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
  font-weight: 700;
}

.badge-live {
  background-color: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}

.badge-info { background: var(--color-info-bg); color: var(--color-info); }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-purple { background: var(--color-purple-bg); color: var(--color-purple); }
.badge-neutral { background: #E5E7EB; color: var(--charcoal); }

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

/* Top App Header */
.app-header {
  height: var(--header-height);
  background-color: var(--brand-green);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

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

.brand-logo-badge {
  width: 38px;
  height: 38px;
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--brand-green);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.brand-text-container {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.brand-title span.gold {
  color: var(--brand-gold);
}

.brand-subtitle {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #D1E7DD;
}

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

.role-switcher-select {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: var(--font-size-xs);
  cursor: pointer;
  outline: none;
}
.role-switcher-select option {
  background: var(--charcoal);
  color: #FFFFFF;
}

/* Mode Banner */
.demo-banner {
  background-color: #FFFBEB;
  border-bottom: 1px solid #FCD34D;
  padding: 0.45rem 1rem;
  font-size: var(--font-size-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #92400E;
}

.demo-banner strong {
  font-weight: 700;
}

/* Main Body Layout */
.app-main {
  display: flex;
  flex: 1;
  position: relative;
}

/* Sidebar Navigation (Desktop) */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  padding: 1rem 0;
  display: none; /* Mobile first, shown on desktop */
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.75rem;
}

.nav-item-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--charcoal-light);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item-btn:hover {
  background-color: #F3F4F6;
  color: var(--brand-green);
}

.nav-item-btn.active {
  background-color: var(--brand-green-light);
  color: var(--brand-green);
  border-left: 3px solid var(--brand-green);
}

.nav-counter {
  margin-left: auto;
  background: #E5E7EB;
  color: var(--charcoal);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}
.nav-counter.alert {
  background: var(--color-danger);
  color: #FFFFFF;
}

/* Content Area */
.app-content {
  flex: 1;
  padding: 1rem;
  padding-bottom: calc(var(--nav-height-mobile) + 1.5rem);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Bottom Navigation Bar (Mobile) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height-mobile);
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 40;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--charcoal-muted);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  position: relative;
  flex: 1;
  height: 100%;
}

.bottom-nav-btn.active {
  color: var(--brand-green);
}

.bottom-nav-badge {
  position: absolute;
  top: 4px;
  right: 25%;
  background: var(--color-danger);
  color: #FFFFFF;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: bold;
}

/* Page Views */
.view-section {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}
.view-section.active {
  display: block;
}

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

/* Page Header & Actions */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--charcoal);
}

.page-subtitle {
  font-size: var(--font-size-sm);
  color: var(--charcoal-light);
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Filter Bar */
.filter-bar {
  background: var(--bg-surface);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.625rem 0.75rem 0.625rem 2.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  background: #FFFFFF;
}

.search-icon-pos {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--charcoal-muted);
  pointer-events: none;
}

.filter-controls-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.select-filter {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  background: #FFFFFF;
  color: var(--charcoal);
}

/* Metric / KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-green);
}

.kpi-card.alert-card {
  border-left: 4px solid var(--color-danger);
}

.kpi-card.warning-card {
  border-left: 4px solid var(--color-warning);
}

.kpi-card.success-card {
  border-left: 4px solid var(--color-success);
}

.kpi-card.gold-card {
  border-left: 4px solid var(--brand-gold);
}

.kpi-title {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--charcoal-muted);
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--charcoal);
  line-height: 1.1;
}

.kpi-subtext {
  font-size: 0.75rem;
  color: var(--charcoal-light);
  margin-top: 0.35rem;
}

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

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

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--charcoal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body {
  padding: 1rem;
}

/* Responsive Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--font-size-sm);
}

.data-table th {
  background-color: #F9FAFB;
  padding: 0.75rem 0.875rem;
  font-weight: 600;
  color: var(--charcoal-muted);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

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

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

/* Mobile Record Cards (Alternative to Wide Tables on Phone) */
.record-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.record-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s ease;
}

.record-card:hover {
  border-color: var(--brand-green);
}

.record-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.record-primary-text {
  font-weight: 700;
  color: var(--charcoal);
  font-size: var(--font-size-base);
}

.record-meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--font-size-xs);
  color: var(--charcoal-light);
  flex-wrap: wrap;
}

.record-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
  margin-top: 0.25rem;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
  overflow-y: auto;
}

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

.modal-dialog {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.25s ease-out;
}

.modal-dialog.modal-lg {
  max-width: 850px;
}

.modal-dialog.modal-xl {
  max-width: 1050px;
}

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

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--charcoal);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--charcoal-muted);
  cursor: pointer;
  padding: 0.25rem;
}
.btn-close-modal:hover {
  color: var(--charcoal);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: #F9FAFB;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

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

.form-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--charcoal);
}

.form-label.required::after {
  content: " *";
  color: var(--color-danger);
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  background-color: #FFFFFF;
  color: var(--charcoal);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(12, 90, 53, 0.15);
  outline: none;
}

.form-help {
  font-size: 0.75rem;
  color: var(--charcoal-muted);
}

.form-alert {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  margin-bottom: 1rem;
}
.form-alert-warning {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning);
  color: #92400E;
}
.form-alert-danger {
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger);
  color: #991B1B;
}

/* Pipeline Flow Stages */
.pipeline-stepper {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.pipeline-step-chip {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  background: #E5E7EB;
  color: var(--charcoal-light);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.pipeline-step-chip.current {
  background: var(--brand-green);
  color: #FFFFFF;
}

.pipeline-step-chip.completed {
  background: var(--brand-green-light);
  color: var(--brand-green);
  border: 1px solid var(--brand-green-border);
}

/* WhatsApp Simulator UI */
.whatsapp-sim-container {
  display: flex;
  flex-direction: column;
  height: 520px;
  background: #E5DDD5;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid #C4B5A5;
}

.whatsapp-sim-header {
  background: #075E54;
  color: #FFFFFF;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.whatsapp-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #FFFFFF;
  color: #075E54;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.whatsapp-chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wa-bubble {
  max-width: 82%;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.35;
  position: relative;
  word-wrap: break-word;
}

.wa-bubble.customer {
  align-self: flex-start;
  background: #FFFFFF;
  color: #111827;
  border-top-left-radius: 0;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.wa-bubble.agent {
  align-self: flex-end;
  background: #E1FFC7;
  color: #111827;
  border-top-right-radius: 0;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.wa-time {
  font-size: 0.65rem;
  color: #6B7280;
  text-align: right;
  margin-top: 0.2rem;
}

.whatsapp-sim-footer {
  background: #F0F2F5;
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Empty State Box */
.empty-state {
  padding: 2.5rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.empty-state-icon {
  width: 54px;
  height: 54px;
  color: var(--charcoal-muted);
}

.empty-state-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--charcoal);
}

.empty-state-text {
  font-size: var(--font-size-sm);
  color: var(--charcoal-muted);
  max-width: 360px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 1rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
}

.toast {
  background: var(--charcoal);
  color: #FFFFFF;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  animation: toastIn 0.25s ease-out;
}

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

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

/* Document Printable Preview */
.printable-document {
  background: #FFFFFF;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  color: #111827;
  font-size: 0.9rem;
}

.doc-header-banner {
  border-bottom: 2px solid var(--brand-green);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.doc-company-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand-green);
}

.doc-company-slogan {
  font-size: 0.75rem;
  color: var(--brand-gold-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

.doc-company-details {
  font-size: 0.8rem;
  color: var(--charcoal-light);
  line-height: 1.4;
  margin-top: 0.35rem;
}

.doc-type-badge {
  text-align: right;
}

.doc-type-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--charcoal);
  text-transform: uppercase;
}

.doc-type-ref {
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-green);
}

.doc-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #F9FAFB;
  border-radius: var(--radius-sm);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.doc-table th {
  background-color: var(--brand-green);
  color: #FFFFFF;
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  text-align: left;
}

.doc-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #E5E7EB;
}

.doc-totals-box {
  margin-left: auto;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.doc-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.doc-total-row.grand-total {
  font-size: 1.1rem;
  font-weight: 800;
  border-top: 2px solid var(--charcoal);
  padding-top: 0.4rem;
  color: var(--brand-green);
}

.doc-terms-box {
  border-top: 1px solid #E5E7EB;
  padding-top: 1rem;
  font-size: 0.75rem;
  color: var(--charcoal-light);
  line-height: 1.5;
}

/* ==========================================================================
   PRINT MEDIA QUERY - CLEAN PAPER INVOICES / RECEIPTS / WAYBILLS
   ========================================================================== */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  .app-header,
  .demo-banner,
  .app-sidebar,
  .mobile-bottom-nav,
  .toast-container,
  .modal-backdrop:not(.active),
  .modal-header,
  .modal-footer,
  .no-print {
    display: none !important;
  }
  .modal-backdrop.active {
    position: static;
    background: none;
    padding: 0;
  }
  .modal-dialog {
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
  }
  .modal-body {
    padding: 0 !important;
    overflow: visible !important;
  }
  .printable-document {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  .doc-table th {
    background-color: #0C5A35 !important;
    color: #FFFFFF !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ==========================================================================
   DESKTOP MEDIA QUERY (min-width: 900px)
   ========================================================================== */
@media (min-width: 900px) {
  .app-sidebar {
    display: flex;
  }
  .mobile-bottom-nav {
    display: none;
  }
  .app-content {
    padding: 1.75rem;
    padding-bottom: 2rem;
  }
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
  }
  .form-grid.grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .filter-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .search-input-wrapper {
    max-width: 320px;
  }
}

/* ==========================================================================
   COMPLETELY REMOVE AND SUPPRESS "POWERED BY NETLIFY" / NETLIFY DRAWER
   ========================================================================== */
netlify-drawer,
netlify-badge,
iframe[src*="netlify"],
iframe[id*="netlify"],
iframe[title*="Netlify"],
iframe[class*="netlify"],
[data-netlify-drawer],
[id*="netlify-drawer"],
[class*="netlify-drawer"],
[class*="netlify-badge"],
[id*="netlify-feedback"],
[id*="netlify-collaborate"],
[class*="netlify-pill"],
.netlify-badge,
#netlify-badge,
div[class*="NetlifyBadge"],
div[id*="netlify"],
div[aria-label*="Netlify"],
a[href*="netlify.com"][style*="fixed"],
div:has(> iframe[src*="netlify"]) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  position: absolute !important;
  bottom: -9999px !important;
  right: -9999px !important;
  z-index: -99999 !important;
}

/* ==========================================================================
   CLOSING CALL TO ACTION BANNER (Dark Green High-Contrast Guarantee)
   ========================================================================== */
.closing-cta-section {
  background: linear-gradient(135deg, #073820 0%, #0C5A35 60%, #073820 100%) !important;
  background-color: #073820 !important;
  color: #FFFFFF !important;
  text-align: center !important;
  padding: 4.5rem 1rem !important;
}

.closing-cta-shell {
  max-width: 780px !important;
  margin: 0 auto !important;
}

.closing-cta-title {
  font-size: 2.1rem !important;
  font-weight: 900 !important;
  color: #FFFFFF !important;
  margin-bottom: 0.75rem !important;
}

.closing-cta-text {
  font-size: 1.05rem !important;
  color: #E6F4EA !important;
  line-height: 1.6 !important;
  max-width: 720px !important;
  margin: 0 auto 2rem !important;
}
