/* ==========================================================================
   AldeaTech Design System - Fully Responsive Mobile & Tablet Styles
   ========================================================================== */

:root {
  /* Color Palette - Premium Agriculture Theme */
  --primary: #0d5c3a;
  --primary-hover: #09472c;
  --primary-light: #e6f4ed;
  --primary-glow: rgba(13, 92, 58, 0.25);
  
  --secondary: #2563eb;
  --secondary-hover: #1d4ed8;
  --secondary-light: #eff6ff;

  --accent-gold: #d97706;
  --accent-gold-light: #fef3c7;
  
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbe6;
  --success: #10b981;
  --success-light: #ecfdf5;
  --info: #0284c7;
  --info-light: #f0f9ff;

  /* Surfaces & Backgrounds */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --border-color: #e2e8f0;
  --border-focus: #0d5c3a;

  /* Text Colors */
  --text-title: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Shadows & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(13, 92, 58, 0.2);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="dark"] {
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-light: rgba(16, 185, 129, 0.15);
  --primary-glow: rgba(16, 185, 129, 0.3);

  --bg-main: #0b1120;
  --bg-card: #1e293b;
  --bg-glass: rgba(30, 41, 59, 0.85);
  --border-color: #334155;
  --border-focus: #10b981;

  --text-title: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-body);
  line-height: 1.5;
  font-size: 14px;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Brand Navigation */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #0d5c3a, #10b981);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  box-shadow: var(--shadow-glow);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-text h1 span.badge-version {
  font-size: 0.6rem;
  padding: 2px 6px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 99px;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-text p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Main Navigation Tabs with Horizontal Scroll for Mobile */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-main);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  min-height: 38px;
}

.nav-tab i {
  font-size: 0.95rem;
}

.nav-tab:hover {
  color: var(--text-title);
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .nav-tab:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-body);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-main);
  border-radius: 99px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

/* Main Container */
.main-container {
  max-width: 1440px;
  margin: 1.25rem auto;
  padding: 0 1.25rem;
  flex: 1;
  width: 100%;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

/* Visual Form Stepper / Wizard Layout */
.stepper-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stepper-progress-bar {
  position: absolute;
  top: 38%;
  left: 40px;
  right: 40px;
  height: 3px;
  background: var(--border-color);
  z-index: 1;
}

.stepper-progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  background: transparent;
  border: none;
  min-width: 60px;
}

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.step-item.active .step-number {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.step-item.active .step-label {
  color: var(--primary);
  font-weight: 700;
}

.step-item.completed .step-number {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Stepper Content Cards & Panels */
.step-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.step-panel.active {
  display: block;
}

/* Form Layout with Live Summary Sidebar */
.form-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  align-items: start;
}

/* Live Summary Sticky Card */
.live-summary-card {
  position: sticky;
  top: 85px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  box-shadow: var(--shadow-md);
}

.live-summary-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--border-color);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-label {
  color: var(--text-muted);
}

.summary-value {
  font-weight: 700;
  color: var(--text-title);
}

/* Enhanced Diagnostic Cards Grid (Diseases & Pests) */
.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.diagnostic-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  transition: all var(--transition-fast);
}

.diagnostic-card:hover {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.diagnostic-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.diagnostic-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.diagnostic-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.number-percent-input {
  width: 65px;
  padding: 4px 6px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-title);
}

/* Layout Cards & Sections */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

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

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

.card-title i {
  color: var(--primary);
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Form Styles & Grid Responsive */
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

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

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

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

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-title);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-body);
  font-size: 0.88rem;
  transition: all var(--transition-fast);
  font-family: inherit;
  min-height: 40px;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control[readonly] {
  background: var(--bg-main);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Custom Percentage Range Sliders Touch-Friendly */
.range-group {
  background: var(--bg-main);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

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

.range-title {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-title);
}

.range-badge {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
}

.range-badge.high {
  background: var(--danger-light);
  color: var(--danger);
}

.range-badge.medium {
  background: var(--warning-light);
  color: var(--accent-gold);
}

.form-range {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
  height: 24px;
}

/* Custom Tables & Touch Scroll */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch;
}

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

.custom-table th {
  background: var(--bg-main);
  color: var(--text-title);
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.custom-table tbody tr:hover {
  background: var(--primary-light);
}

/* Photo Upload Box Touch Responsive */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.photo-card {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  text-align: center;
  background: var(--bg-main);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.photo-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.photo-preview {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: none;
  margin-bottom: 0.4rem;
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  padding: 1rem 0;
}

.photo-placeholder i {
  font-size: 1.75rem;
  color: var(--primary);
}

.photo-input {
  display: none;
}

/* Buttons System Touch Friendly */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-family: inherit;
  min-height: 40px;
  touch-action: manipulation;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px var(--primary-glow);
}

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

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-body);
}

.btn-secondary:hover {
  background: var(--bg-main);
  border-color: var(--text-muted);
}

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

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

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

.btn-danger:hover {
  background: #b91c1c;
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}

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

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  min-height: 32px;
}

/* KPI Summary Cards Grid Responsive */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

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

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.kpi-icon.green { background: var(--primary-light); color: var(--primary); }
.kpi-icon.blue { background: var(--secondary-light); color: var(--secondary); }
.kpi-icon.gold { background: var(--accent-gold-light); color: var(--accent-gold); }
.kpi-icon.red { background: var(--danger-light); color: var(--danger); }

.kpi-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.kpi-info h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-title);
  line-height: 1.2;
}

/* Dashboard Charts Grid Responsive */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

/* Database Table Toolbar & Filters Responsive */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-box i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  padding-left: 2.2rem;
}

/* Modals Responsive */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 850px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.25rem;
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

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

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

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

.close-btn:hover {
  color: var(--danger);
}

/* Toast Notifications Responsive */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
  pointer-events: none;
}

@media (min-width: 600px) {
  .toast-container {
    left: auto;
    max-width: 380px;
  }
}

.toast {
  background: var(--bg-card);
  color: var(--text-title);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.1rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  animation: slideInRight 0.3s ease;
  pointer-events: auto;
}

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

@keyframes slideInRight {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 1.25rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  background: var(--bg-card);
  margin-top: auto;
}

/* ==========================================================================
   MEDIA QUERIES FOR TABLETS & MOBILE PHONES
   ========================================================================== */

/* Tablets & Small Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
  .form-with-sidebar {
    grid-template-columns: 1fr;
  }

  .live-summary-card {
    position: static;
    margin-top: 1rem;
    order: -1; /* Place summary on top for easy access on mobile */
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Phones (max-width: 768px) */
@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
    padding: 0.6rem 1rem;
  }

  .brand-text p {
    display: none;
  }

  .nav-tabs {
    order: 3;
    width: 100%;
    margin-top: 0.4rem;
  }

  .nav-tab {
    flex: 1;
    justify-content: center;
    padding: 0.45rem 0.6rem;
    font-size: 0.78rem;
  }

  .nav-tab span {
    font-size: 0.75rem;
  }

  .main-container {
    padding: 0 0.85rem;
    margin: 1rem auto;
  }

  .card {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .stepper-container {
    padding: 0.65rem 0.85rem;
  }

  .step-label {
    font-size: 0.68rem;
  }

  .step-number {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chart-container {
    height: 220px;
  }

  .step-nav-buttons {
    flex-direction: column;
    gap: 0.6rem;
  }

  .step-nav-buttons .btn {
    width: 100%;
  }

  .form-grid-3, .form-grid-2, .form-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Extra Small Phones (max-width: 480px) */
@media (max-width: 480px) {
  .brand-text h1 {
    font-size: 1rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .stepper-container {
    justify-content: flex-start;
    gap: 0.85rem;
  }

  .step-item {
    min-width: 50px;
  }

  .step-label {
    display: none; /* Hide labels on tiny screens to fit step circles cleanly */
  }

  .stepper-progress-bar {
    left: 20px;
    right: 20px;
  }

  .diagnostic-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }
}

/* Print Styles */
@media print {
  body { background: #fff; color: #000; }
  .app-header, .nav-tabs, .header-actions, .app-footer, .btn, .toolbar, .stepper-container, .live-summary-card { display: none !important; }
  .card { border: 1px solid #ccc; box-shadow: none; }
  .modal-overlay { position: static; background: none; backdrop-filter: none; }
  .modal-container { width: 100%; max-width: 100%; box-shadow: none; border: none; }
}
