/* Base Styles & Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  outline: none;
}

input, select, textarea {
  font-family: inherit;
}

/* Card Component */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-card);
  padding: 20px 22px;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.card-action-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-grade-a {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-grade-b {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-grade-c {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-status-open {
  background: #dcfce7;
  color: #166534;
}

.badge-status-negotiation {
  background: #fef3c7;
  color: #b45309;
}

.badge-status-dispatched {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-status-settled {
  background: #dcfce7;
  color: #15803d;
}

.badge-status-transit {
  background: #e0f2fe;
  color: #0284c7;
  font-weight: 700;
}

.badge-status-emergency {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: pulseEmergency 1.8s infinite;
}

.badge-buyer-type {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.buyer-type-processing { background: #fef3c7; color: #b45309; }
.buyer-type-caterer { background: #e0f2fe; color: #0369a1; }
.buyer-type-compost { background: #dcfce7; color: #15803d; }

@keyframes pulseEmergency {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
  }
}

.badge-notification {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #0c5a36 0%, #064e3b 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(12, 90, 54, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0f7244 0%, #0c5a36 100%);
  box-shadow: 0 8px 20px rgba(12, 90, 54, 0.35);
  transform: translateY(-1px);
}

.btn-gold {
  background-color: #d97706;
  color: #ffffff;
  border: 1px solid transparent;
}

.btn-gold:hover {
  background-color: #b45309;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.22);
}

.btn-outline {
  background: #ffffff;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: var(--border-strong);
  color: var(--text-main);
}

/* Form inputs */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  background-color: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  color: var(--text-main);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(12, 90, 54, 0.12);
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
}

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

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 26px;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   Tabular Numerals for Finance, Quantities & Mandi Rates
   ========================================================================== */
.tabular-nums,
.num-tabular,
.data-table,
.table td,
.metric-num,
.metric-value,
.lot-price,
.stat-value,
.stat-card-compact .num,
.deal-rate,
.price-tag {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ==========================================================================
   Smooth View Transitions for Active Portal Views
   ========================================================================== */
.portal-view.active-view,
.portal-view.active {
  animation: portalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ==========================================================================
   Chat Negotiation Offer Banner & Action Components
   ========================================================================== */
.chat-offer-badge {
  background: #ca8a04;
  color: #ffffff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(202, 138, 4, 0.3);
  flex-shrink: 0;
}

.chat-offer-text {
  color: #713f12;
  font-size: 0.84rem;
}

.chat-offer-text strong.rate-highlight {
  color: #14532d;
}

.btn-offer-accept {
  background: #15803d;
  border: 1px solid #15803d;
  color: #ffffff;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-offer-accept:hover {
  background: #166534;
  border-color: #166534;
  transform: translateY(-1px);
}

.btn-offer-recounter {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-offer-recounter:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* ==========================================================================
   Standardized Empty State Component
   ========================================================================== */
.empty-state-card {
  background: #ffffff;
  border: 1.5px dashed #cbd5e1;
  border-radius: 16px;
  padding: 44px 24px;
  text-align: center;
  max-width: 520px;
  margin: 24px auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.empty-state-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.empty-state-icon {
  width: 58px;
  height: 58px;
  background: #f0fdf4;
  color: #0c5a36;
  border: 1.5px solid #bbf7d0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
  box-shadow: 0 2px 8px rgba(12, 90, 54, 0.08);
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.empty-state-text {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 18px;
  line-height: 1.5;
}

.empty-state-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #0c5a36;
  border: 1.5px solid #86efac;
  cursor: pointer;
  transition: all 0.15s ease;
}

.empty-state-btn:hover {
  background: #f0fdf4;
  border-color: #0c5a36;
  transform: translateY(-1px);
}

/* ==========================================================================
   Modal Component Design System Tokens
   ========================================================================== */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1.5px solid var(--border-default);
  padding-bottom: 12px;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.modal-icon-badge.icon-green {
  background: #e8f5ed;
  color: #0c5a36;
}

.modal-icon-badge.icon-red {
  background: #fee2e2;
  color: #dc2626;
}

.modal-icon-badge.icon-amber {
  background: #fef3c7;
  color: #b45309;
}

.modal-title-group {
  display: flex;
  flex-direction: column;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0c5a36;
  margin: 0;
  letter-spacing: -0.01em;
}

.modal-title.title-danger {
  color: #991b1b;
}

.modal-subtitle {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 1px;
}

.modal-close-btn {
  font-size: 1.25rem;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  line-height: 1;
}

.modal-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Modal Callout & Alert Boxes */
.modal-alert-box {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.modal-alert-box.alert-green {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  color: #166534;
}

.modal-alert-box.alert-amber {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.modal-alert-box.alert-gold {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #78350f;
}

/* Modal Summary & Breakdown Strips */
.modal-summary-strip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.82rem;
}

.modal-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  color: #475569;
}

.modal-summary-row:last-child {
  margin-bottom: 0;
}

.modal-summary-row.highlight-green {
  background: #e8f5ed;
  padding: 6px 8px;
  border-radius: 6px;
  color: #0c5a36;
  font-weight: 700;
}

.modal-summary-divider {
  border-top: 1px dashed #e2e8f0;
  margin: 6px 0;
  padding-top: 6px;
}

/* Modal Action Footers */
.modal-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.modal-radio-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-radio-option:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.modal-radio-option.active {
  border-color: #0c5a36;
  background: #f0fdf4;
}

/* Upload Dropzone inside modals */
.modal-upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-upload-dropzone:hover {
  border-color: #0c5a36;
  background: #f0fdf4;
}

/* ==========================================================================
   Extracted Portal View, In-App Chat & Consignments Styles (from index.html)
   ========================================================================== */

/* Tab View Display Controller */
.portal-view {
  display: none !important;
  animation: fadeInView 0.22s ease-in-out;
}
.portal-view.active-view {
  display: flex !important;
  flex-direction: column;
}
@keyframes fadeInView {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}


/* In-App Negotiation Chat UI */
.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 620px;
  max-height: calc(100vh - 150px);
}
@media (max-width: 768px) {
  .chat-layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
}
.chat-sidebar {
  border-right: 1px solid var(--border-default);
  background: #f8fafc;
  overflow-y: auto;
  height: 100%;
}
.chat-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
}
.chat-contact:hover, .chat-contact.active {
  background: var(--primary-subtle);
}
.chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
}
.chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  flex-shrink: 0;
}
.chat-messages {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}
.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
}
.chat-bubble.incoming {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  align-self: flex-start;
  color: var(--text-main);
}
.chat-bubble.outgoing {
  background: var(--primary);
  color: #ffffff;
  align-self: flex-end;
}
.chat-input-bar {
  padding: 14px 18px;
  border-top: 1px solid var(--border-default);
  display: flex;
  gap: 10px;
  background: #ffffff;
  flex-shrink: 0;
}

/* Orders & Shipment Tracking UI Components */
.simple-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 1024px) {
  .simple-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .simple-stats-grid { grid-template-columns: 1fr; }
}
.stat-card-compact {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.stat-icon-sq {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.filter-tabs-row {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.filter-tab {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.filter-tab:hover {
  color: var(--text-main);
  background: #f8fafc;
}
.filter-tab.active {
  color: var(--primary);
  background: #ffffff;
  border-bottom: 3px solid var(--primary);
  font-weight: 800;
}

.order-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
}
.order-box:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.order-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

/* 4-Step Clean Progress Line */
.step-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 18px 0 20px;
  gap: 8px;
  text-align: center;
  position: relative;
}
.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #64748b;
  transition: all 0.2s;
}
.step-dot.done {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}
.step-dot.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.info-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 0.84rem;
  margin-bottom: 16px;
  line-height: 1.45;
}
@media (max-width: 860px) {
  .info-strip { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Mobile Navigation System: Bottom App Bar, Hamburger & Off-Canvas Drawer
   ========================================================================== */

/* Top Navbar Hamburger Button (Mobile Only) */
.btn-mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  padding: 0;
}
.btn-mobile-menu-toggle:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.btn-mobile-menu-toggle:active {
  transform: scale(0.94);
}

/* Off-Canvas Backdrop Overlay */
.mobile-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-backdrop);
  opacity: 0;
  transition: opacity 0.25s ease;
}
body.sidebar-open .mobile-sidebar-backdrop {
  display: block;
  opacity: 1;
}

/* Sticky Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-bottom-height);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-default);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: var(--z-bottom-nav);
  padding: 0 8px;
}
.mobile-bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 100%;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}
.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #64748b;
  text-decoration: none;
  padding: 6px 0;
  border-radius: 8px;
  transition: all 0.15s ease;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
}
.mob-nav-item:active {
  transform: scale(0.92);
}
.mob-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.15s ease;
}
.mob-nav-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.mob-nav-item.active {
  color: var(--primary);
}
.mob-nav-item.active .mob-nav-icon {
  transform: scale(1.1);
}
.mob-nav-item.active .mob-nav-label {
  font-weight: 800;
}
.mob-nav-item.active::before {
  content: '';
  position: absolute;
  top: 2px;
  width: 20px;
  height: 3px;
  background: var(--primary);
  border-radius: 999px;
}

/* =========================================================================
   PHASE 1 & 2: REUSABLE UTILITIES & DESIGN SYSTEM EXPANSION
   ========================================================================= */

/* Hero Glass Banners */
.hero-banner-glass {
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.95) 0%, rgba(232, 245, 237, 0.95) 100%);
  border: 1.5px solid #bbf7d0;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(12, 90, 54, 0.06);
  backdrop-filter: blur(8px);
}

.hero-banner-glass-dark {
  background: linear-gradient(135deg, #063c22 0%, #0c5a36 100%);
  border: 1.5px solid rgba(134, 239, 172, 0.25);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(6, 60, 34, 0.2);
}

/* KPI Badge Groups & Stat Pills */
.kpi-badge-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-kpi-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-kpi-pill:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

/* Horizontal Chip Scroller with Smooth Scroll */
.chip-carousel-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.chip-carousel-container::-webkit-scrollbar {
  height: 4px;
}

.chip-carousel-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

/* Glass Callout Safeguards */
.glass-callout {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.glass-callout-warning {
  background: #fffbf5;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

/* =========================================================================
   SKELETON SHIMMER LOADERS & MICRO-INTERACTIONS
   ========================================================================= */

@keyframes shimmerAnimation {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmerAnimation 1.5s infinite linear;
  border-radius: var(--radius-sm);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}

.skeleton-box {
  width: 100%;
  height: 20px;
  margin-bottom: 8px;
}

.skeleton-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-kpi {
  height: 90px;
  border-radius: 14px;
}

.skeleton-chart-placeholder {
  width: 100%;
  height: 260px;
  border-radius: 12px;
}

/* =========================================================================
   SPOTLIGHT AUTO-SUGGEST SEARCH DROPDOWN
   ========================================================================= */

.search-spotlight-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 460px;
  max-width: calc(100vw - 32px);
  max-height: 480px;
  overflow-y: auto;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  box-shadow: 0 16px 40px -4px rgba(15, 23, 42, 0.18), 0 6px 16px -2px rgba(15, 23, 42, 0.08);
  z-index: 1200;
  padding: 10px 0;
  animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spotlight-group-header {
  padding: 8px 16px 4px 16px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.spotlight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.12s ease;
  border-left: 3px solid transparent;
  gap: 12px;
}

.spotlight-item:hover,
.spotlight-item.selected {
  background: #f0fdf4;
  border-left-color: #0c5a36;
}

.spotlight-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.spotlight-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.spotlight-item-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotlight-item-title mark {
  background: #fef08a;
  color: #854d0e;
  font-weight: 800;
  padding: 0 2px;
  border-radius: 2px;
}

.spotlight-item-sub {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.spotlight-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.spotlight-price-badge {
  font-size: 0.76rem;
  font-weight: 800;
  color: #0c5a36;
  background: #e8f5ed;
  border: 1px solid #bbf7d0;
  padding: 2px 8px;
  border-radius: 6px;
}

.spotlight-footer {
  padding: 8px 16px;
  border-top: 1px solid #f1f5f9;
  margin-top: 6px;
  font-size: 0.7rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* =========================================================================
   RESPONSIVE TABLE-TO-CARD ENHANCEMENTS
   ========================================================================= */

.responsive-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .responsive-card-table thead {
    display: none;
  }
  .responsive-card-table,
  .responsive-card-table tbody,
  .responsive-card-table tr,
  .responsive-card-table td {
    display: block;
    width: 100%;
  }
  .responsive-card-table tr {
    margin-bottom: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  }
  .responsive-card-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.82rem;
  }
  .responsive-card-table td:last-child {
    border-bottom: none;
    padding-top: 10px;
    justify-content: flex-end;
  }
  .responsive-card-table td::before {
    content: attr(data-label);
    font-weight: 800;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
}

/* =========================================================================
   MOBILE DOCKING & COLLISION RESOLUTION (<= 768px)
   ========================================================================= */

@media (max-width: 768px) {
  .btn-mobile-menu-toggle {
    display: flex;
  }
  .mobile-bottom-nav {
    display: block;
  }
  /* Floating copilot button lifted above bottom nav */
  .btn-floating-copilot {
    bottom: calc(var(--nav-bottom-height) + 16px) !important;
    right: 16px !important;
    padding: 10px 16px !important;
    font-size: 0.82rem !important;
  }
  /* Floating voice mic lifted above bottom nav in Simple Mode */
  .lite-floating-mic {
    bottom: calc(var(--nav-bottom-height) + 16px) !important;
    right: 16px !important;
    padding: 12px 18px !important;
    font-size: 0.88rem !important;
  }
  .search-spotlight-dropdown {
    width: 100%;
    max-width: calc(100vw - 24px);
    left: 0;
    right: 0;
  }
}

/* =========================================================================
   DEDICATED BOARDROOM-GRADE PRINT STYLESHEET (@media print)
   ========================================================================= */

.print-only {
  display: none !important;
}

@media print {
  /* Hide all navigation, sidebars, floating widgets, and action controls */
  .sidebar,
  .top-navbar,
  .btn-floating-copilot,
  .mobile-bottom-nav,
  .lite-floating-mic,
  .btn-mobile-menu-toggle,
  .search-spotlight-dropdown,
  .dash-actions,
  .notif-btn,
  .no-print,
  button,
  .btn,
  .lite-mode-wrapper {
    display: none !important;
  }

  /* Reveal print-only headers and legal notices */
  .print-only {
    display: block !important;
  }

  /* Reset layout constraints for physical paper rendering */
  body,
  .app-container,
  .main-wrapper {
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    font-size: 11pt !important;
    line-height: 1.4 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  }

  .portal-view {
    display: none !important;
  }

  .portal-view.active-view {
    display: block !important;
  }

  .card,
  .vault-contract-card,
  .responsive-table-wrapper,
  .hero-banner-glass {
    border: 1pt solid #cbd5e1 !important;
    page-break-inside: avoid !important;
    margin-bottom: 12pt !important;
    box-shadow: none !important;
    padding: 12pt !important;
    background: #ffffff !important;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  th, td {
    border: 1pt solid #cbd5e1 !important;
    padding: 6pt 8pt !important;
    color: #0f172a !important;
  }

  th {
    background: #f8fafc !important;
    font-weight: 800 !important;
  }

  .badge {
    border: 1pt solid #94a3b8 !important;
    background: transparent !important;
    color: #0f172a !important;
  }

  @page {
    margin: 1.2cm;
    size: A4 portrait;
  }
}

/* ==========================================================================
   Advanced Responsive Data Table & Sticky Columns System
   ========================================================================== */
.data-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
  background: #ffffff;
}

.data-table thead th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--border-default);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.15s ease;
}

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

.data-table td {
  padding: 13px 16px;
  color: var(--text-main);
  vertical-align: middle;
}

/* Sticky Column for Lot ID / Key Identifier */
.table-sticky-col {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 2;
  box-shadow: 2px 0 6px rgba(15, 23, 42, 0.05);
}

.data-table thead th.table-sticky-col {
  background: #f8fafc;
  z-index: 3;
}

.data-table tbody tr:hover td.table-sticky-col {
  background-color: #f8fafc;
}

/* Touch-Target & Action Button Polish */
.btn-icon,
.btn-xs,
.table-action-btn {
  min-height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

/* Standardized Modal Body Constraints & Sticky Footer */
.modal-content {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.modal-body {
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.modal-footer,
.modal-actions-row {
  position: sticky;
  bottom: 0;
  background: #ffffff;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 16px;
  z-index: 5;
}

/* Mobile Responsive Cards for Narrow Viewports */
@media (max-width: 768px) {
  .data-table-responsive-cards thead {
    display: none;
  }

  .data-table-responsive-cards,
  .data-table-responsive-cards tbody,
  .data-table-responsive-cards tr,
  .data-table-responsive-cards td {
    display: block;
    width: 100%;
  }

  .data-table-responsive-cards tr {
    margin-bottom: 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
  }

  .data-table-responsive-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-subtle);
    font-size: 0.82rem;
  }

  .data-table-responsive-cards td:last-child {
    border-bottom: none;
    padding-top: 10px;
    justify-content: flex-end;
  }

  .data-table-responsive-cards td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .modal-content {
    width: 95%;
    max-height: 92vh;
    padding: 18px;
    border-radius: var(--radius-lg);
  }
}

/* =============================================================
   LIVE REAL-TIME AUTO-SYNC INDICATOR BADGE
   ============================================================= */
.live-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #166534;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
  user-select: none;
  transition: all 0.25s ease;
}

.live-sync-badge .live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  animation: pulse-sync-dot 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pulse-sync-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    transform: scale(0.95);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(22, 163, 74, 0);
    transform: scale(1.1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
    transform: scale(0.95);
  }
}

.live-sync-badge .live-sync-title {
  color: #15803d;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.live-sync-badge .live-sync-time {
  color: #0f172a;
  background: #ffffff;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #bbf7d0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.live-sync-badge.synced-pulse {
  background: #dcfce7;
  border-color: #22c55e;
  transform: scale(1.03);
}



