/* FoodField Pro - Design System & Modern CSS Stylesheet */

:root {
  --bg-main: #0b0f19;
  --bg-surface: #131b2e;
  --bg-surface-hover: #1c2742;
  --bg-card: #19233c;
  --bg-card-alt: #1f2c4a;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(16, 185, 129, 0.3);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #10b981;
  --accent-primary-hover: #059669;
  --accent-secondary: #6366f1;
  --accent-secondary-hover: #4f46e5;
  --accent-orange: #f59e0b;
  --accent-pink: #ec4899;
  --accent-red: #ef4444;

  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

html, body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Container Layout */
.app-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 24px;
  box-shadow: var(--shadow-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 28px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-primary);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.pro-badge {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.brand-sub {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.month-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.month-selector-wrapper label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.month-input {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-half-width {
  width: 50%;
  min-width: 90px;
  box-sizing: border-box;
  text-align: center;
}

.btn-primary {
  background: var(--accent-primary);
  color: #042f20;
  font-weight: 700;
}
.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent-secondary);
  color: #fff;
}
.btn-accent:hover {
  background: var(--accent-secondary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-outline:hover {
  background: var(--bg-surface-hover);
  border-color: var(--text-muted);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: var(--accent-red);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Expandable Stats Container */
.metrics-collapsible-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.metrics-header-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-card);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.metrics-header-toggle:hover {
  background: var(--bg-surface-hover);
}

.metrics-bar-content {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

/* Metrics Dashboard Bar */
.metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-glow);
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.metric-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Navigation Tabs */
.app-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-surface);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.tab-btn.active {
  background: var(--accent-primary);
  color: #042f20;
  font-weight: 700;
}

.badge-count {
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
}
.tab-btn.active .badge-count {
  background: #042f20;
  color: #fff;
}

/* Main Content Area & Tab Panes */
.main-content {
  min-height: 500px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-pane.active {
  display: block;
}

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

.pane-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 20px;
  gap: 12px;
  width: 100%;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  width: 100%;
  outline: none;
}

.filter-group {
  display: flex;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.filter-group .select-input {
  flex: 1 1 50%;
  width: 50%;
  min-width: 0;
  box-sizing: border-box;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.select-input, .input-control, .textarea-control {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s ease;
}

.select-input:focus, .input-control:focus, .textarea-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.textarea-control {
  resize: vertical;
  width: 100%;
}

/* Single Column Layout for Visits, Banners, Takeaways, and Drawers */
.visits-grid,
#takeawaysContainer,
.takeaways-container,
#bannersContainer,
.banners-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.visit-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: all 0.2s ease;
  box-sizing: border-box;
  overflow: hidden;
}

.visit-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.visit-card-compact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.visit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.company-title-wrap h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.industry-tag {
  font-size: 11px;
  color: var(--accent-secondary);
  font-weight: 600;
}

/* Status Badges */
.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  display: inline-block;
}

.badge-visit { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.3); }
.badge-sample { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-feedback { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-followup { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-trial { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-active { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-notinterested { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Card Metrics Pills */
.metrics-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-card);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.metric-pill-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.metric-pill-item strong {
  color: var(--text-primary);
}

.contact-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
  word-break: break-word;
}

.contact-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Card Feedback Section */
.card-feedback-preview {
  background: var(--bg-card-alt);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback-stars-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 6px;
}

.star-text {
  color: #fbbf24;
  font-weight: 700;
}

.feedback-quote {
  font-size: 12px;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* TAB 2: PIPELINE KANBAN BOARD */
.pane-header {
  margin-bottom: 20px;
}
.pane-header h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  color: #fff;
}
.pane-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 12px;
}

.pipeline-column {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

.column-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.column-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
}

.column-count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: 10px;
}

.stage-sample { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }
.stage-feedback { background: rgba(168, 85, 247, 0.1); color: #c084fc; }
.stage-followup { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.stage-trial { background: rgba(99, 102, 241, 0.1); color: #818cf8; }
.stage-active { background: rgba(16, 185, 129, 0.1); color: #34d399; }

.column-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.pipeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pipeline-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.pipeline-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.pipeline-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

/* TAB 3: FOLLOW-UP MANAGER */
.followup-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.filter-tab.active {
  background: var(--accent-secondary);
  color: #fff;
  border-color: var(--accent-secondary);
}

.followup-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.followup-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.followup-info h4 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.followup-date-tag {
  font-size: 12px;
  color: var(--accent-orange);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.followup-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* TAB 4: ORDER TRACKER & TABLES */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.orders-summary-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.table-card h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  margin-bottom: 16px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* TAB 5: JSON DATA CENTER */
.json-center-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.json-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.card-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.json-card h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  margin-bottom: 6px;
}

.json-card p {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}

.json-preview-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
}

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

.json-code-block {
  background: #060911;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: monospace;
  font-size: 12px;
  color: #34d399;
  max-height: 350px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 100%;
}

/* MODAL SYSTEM */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

/* SLIDE-IN RIGHT DRAWER OVERLAY */
.drawer-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: flex-end;
  z-index: 1200;
}

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

.drawer-panel {
  background: var(--bg-surface);
  border-left: 1.5px solid var(--border-color);
  width: 100%;
  max-width: 480px;
  height: 100%;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  box-sizing: border-box;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.modal-lg {
  max-width: 800px;
}

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

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: #fff;
}

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

.modal-close:hover {
  color: #fff;
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.full-width {
  grid-column: span 2;
}

.form-section-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-primary);
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 6px;
}

/* Star Rating Controls */
.ratings-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.rating-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
}

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

.rating-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.rating-display {
  font-size: 12px;
  color: #fbbf24;
  font-weight: 700;
}

.star-rating-selector {
  display: flex;
  gap: 8px;
  font-size: 22px;
  cursor: pointer;
}

.star-rating-selector .star {
  color: #475569;
  transition: color 0.15s ease, transform 0.15s ease;
}

.star-rating-selector .star:hover,
.star-rating-selector .star.selected {
  color: #fbbf24;
  transform: scale(1.1);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Detail Drawer Lists */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.detail-card {
  background: var(--bg-card);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.detail-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.detail-val {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-top: 2px;
}

.detail-val.highlight {
  color: var(--accent-primary);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.history-item {
  background: var(--bg-card);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  border-left: 3px solid var(--accent-primary);
}

/* Helpers & Utilities */
.margin-top { margin-top: 16px; }
.margin-top-sm { margin-top: 8px; }

/* Quick Filter Pill Buttons Bar */
.filter-quick-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.filter-pill-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill-btn:hover {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-primary);
  border-color: rgba(16, 185, 129, 0.3);
}

.filter-pill-btn.active {
  background: var(--accent-primary);
  color: #042f20;
  border-color: var(--accent-primary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--accent-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
}

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

/* Responsive Media Queries */
@media (max-width: 1200px) {
  .metrics-bar {
    grid-template-columns: repeat(3, 1fr);
  }
  .pipeline-board {
    grid-template-columns: repeat(3, 1fr);
  }
  .json-center-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .header-right {
    flex-wrap: wrap;
  }
  .metrics-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .full-width {
    grid-column: span 1;
  }
  .visits-grid {
    grid-template-columns: 1fr;
  }
}

/* GPS Status Pill & Accuracy Styling */
.gps-status-pill {
  margin-top: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color-glow);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--accent-primary);
  animation: fadeIn 0.2s ease;
}

.badge-accuracy {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.gps-badge-card {
  font-size: 11px;
  color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   MOBILE-FIRST ENHANCEMENTS & NAVIGATION
   ========================================================================== */

/* Mobile Bottom Sticky Navigation Bar */
.mobile-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(19, 27, 46, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  z-index: 999;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.mobile-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-nav-icon {
  font-size: 20px;
}

.mobile-nav-label {
  font-size: 11px;
  font-weight: 600;
}

.mobile-nav-btn.active {
  color: var(--accent-primary);
}

.mobile-nav-btn.active .mobile-nav-icon {
  transform: translateY(-2px);
}

/* Floating Action Button (FAB) */
.mobile-fab-btn {
  position: fixed;
  bottom: 78px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  border: none;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
  z-index: 998;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-fab-btn:active {
  transform: scale(0.92);
}

/* Screen size adaptive adjustments */
@media (max-width: 768px) {
  body {
    padding-bottom: 76px; /* Space for bottom nav */
  }

  .app-container {
    padding: 10px 12px;
    gap: 14px;
  }

  /* Compact Mobile Header */
  .app-header {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
  }

  .header-left {
    justify-content: space-between;
  }

  .month-selector-wrapper {
    width: 100%;
    justify-content: space-between;
  }

  .header-right {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  .header-right .btn {
    flex: 1;
  }

  /* Desktop tab nav hide on mobile (use bottom bar) */
  .app-tabs {
    display: none;
  }

  /* Mobile Metrics 2-column grid */
  .metrics-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .metric-card {
    padding: 10px;
  }

  .metric-value {
    font-size: 18px;
  }

  /* Touch-friendly inputs (16px prevents iOS zoom) */
  .input-control, .select-input, .textarea-control {
    font-size: 16px;
    min-height: 48px;
    padding: 12px 14px;
  }

  .btn {
    min-height: 44px;
    font-size: 14px;
  }

  /* Mobile enlarged star selector */
  .star-rating-selector {
    font-size: 34px;
    gap: 12px;
    justify-content: space-around;
  }

  /* Mobile Bottom-Sheet Modal pattern */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card {
    max-width: 100%;
    max-height: 92vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 20px 16px;
    animation: slideUp 0.25s ease;
  }

  @keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .pipeline-board {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pipeline-column {
    min-height: auto;
  }
}

@media (min-width: 769px) {
  .mobile-bottom-nav,
  .mobile-fab-btn {
    display: none !important;
  }
}

/* Phone Dialer Link */
.phone-dialer-link {
  color: var(--accent-primary);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.phone-dialer-link:hover {
  color: #34d399;
}

/* WAMP Server Status Badge */
.server-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.server-status-badge.offline {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.3);
}

.server-status-badge.syncing {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-orange);
  border-color: rgba(245, 158, 11, 0.3);
}

/* Call & Talk Logger Workspace */
.call-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .call-workspace-grid {
    grid-template-columns: 1fr;
  }
}

.timeline-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.thali-qty-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.conf-date-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

/* Right Slide-over Drawer Styles for Show Existing Records */
.drawer-right-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(9, 13, 22, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9200;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.drawer-right-card {
  width: 480px;
  max-width: 90vw;
  height: 100vh;
  background: #0f172a;
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-right-overlay.open .drawer-right-card {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-item-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.drawer-item-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

/* Distinct background highlighting for items logged today (Current Date) */
.is-today-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(30, 41, 59, 0.95) 100%) !important;
  border: 1.5px solid var(--accent-primary) !important;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.25) !important;
}

.today-badge-pill {
  background: var(--accent-primary) !important;
  color: #042f20 !important;
  font-weight: 800 !important;
  font-size: 10px !important;
  padding: 3px 8px !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

/* Mobile 1-Column Layout Enforcements for Banners, Takeaways, Visits & Drawers */
@media (max-width: 768px) {
  .visits-grid,
  .banners-container,
  .takeaways-container,
  .drawer-body {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  .drawer-right-card {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .drawer-item-card,
  .visit-card {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .btn,
  .input-control,
  .select-input {
    min-height: 48px !important;
    touch-action: manipulation !important;
  }
}

/* Global Mobile First Touch Enhancements */
button, input, select, textarea, a {
  -webkit-tap-highlight-color: transparent;
}

