/* CRITICAL MOBILE-FIRST BASE */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
body { overflow-x: hidden; min-width: 320px; }

/* Prevent horizontal overflow on all pages */
.app-container, .main-content, body, html {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Ensure flex containers don't overflow */
.flex, .depot-actions, .quotation-header, .production-header, .team-header, .depot-header {
  min-width: 0;
}

/* Better button wrapping */
.btn {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ensure grid doesn't overflow */
.dashboard-grid {
  min-width: 0;
}

/* Card text overflow */
.card, .quotation-card, .project-card, .prod-project-card, .member-card {
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ============================================
   END CRITICAL MOBILE BASE
   ============================================ */

/* ============================================
   MNR INTERIORS ERP — Design System
   Phase 1: Foundation Styles
   ============================================ */

:root {
  /* Brand Colors — Interior Design Aesthetic */
  --primary: #1a1a2e;
  --primary-light: #16213e;
  --accent: #d4a373;
  --accent-hover: #c29365;
  --accent-glow: rgba(212, 163, 115, 0.3);
  --bg: #f8f6f3;
  --bg-card: #ffffff;
  --bg-elevated: #faf9f7;
  --text: #2d2d2d;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;

  /* Status Colors */
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #3b82f6;
  --info-bg: #dbeafe;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --shadow-accent: 0 0 20px var(--accent-glow);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

.main-content {
  flex: 1;
  padding: var(--space-6);
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 768px) {
  .main-content {
    padding: var(--space-4);
  }
}

/* ============================================
   HEADER & NAV
   ============================================ */
.header {
  background: var(--primary);
  color: white;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 2px;
}

.user-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--primary);
}

.user-details {
  text-align: right;
  line-height: 1.3;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.user-role {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: capitalize;
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-2);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  .user-details {
    display: none;
  }
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
.sidebar {
  width: 260px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: var(--space-6) 0;
  position: fixed;
  left: 0;
  top: 64px;
  bottom: 0;
  overflow-y: auto;
  z-index: 90;
  transition: transform var(--transition-base);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 85;
  backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
  display: block;
}

.nav-section {
  padding: 0 var(--space-4);
  margin-bottom: var(--space-6);
}

.nav-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: var(--space-3);
  padding-left: var(--space-3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-1);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.nav-item.active .nav-icon {
  color: var(--accent);
}

.nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* Mobile Sidebar */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0 !important;
  }
}

/* Main content offset when sidebar is visible */
.main-content.with-sidebar {
  margin-left: 260px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  overflow: hidden;
}

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

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

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
  background: var(--bg-elevated);
}

/* Stat Card */
.stat-card {
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
}

.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before { background: var(--info); }

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: var(--space-2);
  line-height: 1.2;
}

.stat-change {
  font-size: 0.8rem;
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-elevated);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text);
}

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

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: 0.8rem;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 1rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-card);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-light);
}

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

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: var(--space-8);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: var(--space-2);
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--bg-elevated);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--bg-elevated);
}

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

/* ============================================
   BADGES & STATUS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success {
  background: var(--success-bg);
  color: #065f46;
}

.badge-warning {
  background: var(--warning-bg);
  color: #92400e;
}

.badge-danger {
  background: var(--danger-bg);
  color: #991b1b;
}

.badge-info {
  background: var(--info-bg);
  color: #1e40af;
}

.badge-neutral {
  background: var(--border-light);
  color: var(--text-muted);
}

/* Status Dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.status-dot.active { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.pending { background: var(--warning); }
.status-dot.inactive { background: var(--text-light); }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

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

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-base);
}

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

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

.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  line-height: 1;
  transition: color var(--transition-fast);
}

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

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  background: var(--bg-elevated);
}

/* Modal Sizes */
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1100px; }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 800px;
  height: 800px;
  background: var(--accent);
  opacity: 0.05;
  border-radius: 50%;
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: var(--accent);
  opacity: 0.03;
  border-radius: 50%;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 420px;
  padding: var(--space-10);
  position: relative;
  z-index: 1;
}

.login-brand {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-brand .brand-logo {
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
  margin: 0 auto var(--space-4);
}

.login-brand h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--primary);
}

.login-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: var(--space-2);
}

.login-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ============================================
   DASHBOARD GRID
   ============================================ */
.dashboard-grid {
  display: grid;
  gap: var(--space-6);
}

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

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   MODULE CARDS (Dashboard Navigation)
   ============================================ */
.module-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-6);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.module-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.module-card:hover::before {
  transform: scaleX(1);
}

.module-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: var(--space-4);
  transition: all var(--transition-base);
}

.module-card:hover .module-icon {
  background: var(--accent);
  color: var(--primary);
}

.module-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.module-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.module-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 300px;
  max-width: 400px;
  animation: slideIn 300ms ease;
  border-left: 4px solid var(--accent);
}

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

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

@keyframes fadeOut {
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast.hiding {
  animation: fadeOut 300ms ease forwards;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  padding: var(--space-3) var(--space-5);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 300ms ease;
}

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

/* ============================================
   PROGRESS STEPS
   ============================================ */
.progress-track {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-6) 0;
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--border-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition-base);
}

.step.active .step-circle {
  background: var(--accent);
  color: var(--primary);
  box-shadow: var(--shadow-accent);
}

.step.completed .step-circle {
  background: var(--success);
  color: white;
}

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

.step.active .step-label {
  color: var(--text);
  font-weight: 600;
}

.step-line {
  flex: 1;
  min-width: 30px;
  height: 2px;
  background: var(--border-light);
  margin-top: -18px;
}

.step-line.completed {
  background: var(--success);
}

/* ============================================
   FILE UPLOAD
   ============================================ */
.file-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
  background: var(--bg-elevated);
}

.file-dropzone:hover,
.file-dropzone.dragover {
  border-color: var(--accent);
  background: var(--bg-card);
}

.file-dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
  color: var(--text-light);
}

.file-dropzone-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.file-dropzone-hint {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.empty-state-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto var(--space-6);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

/* ============================================
   UTILITIES
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-center { text-align: center; }

.hidden { display: none !important; }

/* Responsive utilities */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 641px) {
  .show-mobile-only { display: none !important; }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .header, .sidebar, .mobile-menu-btn, .btn {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
    padding: 0;
  }
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================
   RESPONSIVE FIXES — MNR Interiors ERP
   ============================================ */

/* Fix header actions overflow */
.depot-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 768px) {
  .depot-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .depot-actions .btn {
    flex: 1 1 auto;
    min-width: 120px;
    font-size: 0.8rem;
    padding: var(--space-2) var(--space-3);
  }
  .depot-actions .flex.gap-2 {
    width: 100%;
    justify-content: stretch;
  }
  .depot-actions .flex.gap-2 .btn {
    flex: 1;
  }
}

/* Fix quotation header specifically */
.quotation-header .depot-actions,
.production-header .depot-actions,
.team-header .depot-actions {
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .quotation-header,
  .production-header,
  .team-header,
  .depot-header {
    flex-direction: column;
    align-items: stretch;
  }
  .quotation-header .depot-actions,
  .production-header .depot-actions,
  .team-header .depot-actions,
  .depot-header .depot-actions {
    justify-content: stretch;
    width: 100%;
  }
  .quotation-header .depot-actions .btn,
  .production-header .depot-actions .btn,
  .team-header .depot-actions .btn,
  .depot-header .depot-actions .btn {
    flex: 1 1 auto;
  }
}

/* Fix status filters on mobile */
.status-filters {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-2);
}
.status-pill {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Fix search bar on mobile */
.search-bar {
  position: relative;
  width: 100%;
  max-width: 400px;
}
.search-bar input {
  padding-left: var(--space-10);
  width: 100%;
}
@media (max-width: 768px) {
  .search-bar {
    max-width: 100%;
  }
}

/* Fix modal on mobile */
@media (max-width: 640px) {
  .modal {
    max-width: 100% !important;
    margin: var(--space-2);
    max-height: 95vh;
  }
  .modal-xl, .modal-lg {
    max-width: 100% !important;
  }
  .modal-body {
    padding: var(--space-4);
  }
}

/* Fix card grids on mobile */
@media (max-width: 768px) {
  .dashboard-grid.grid-3 {
    grid-template-columns: 1fr !important;
  }
  .dashboard-grid.grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .dashboard-grid.grid-4 {
    grid-template-columns: 1fr !important;
  }
  .dashboard-grid.grid-2 {
    grid-template-columns: 1fr !important;
  }
}

/* Fix table overflow */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Fix quotation card amount on mobile */
@media (max-width: 480px) {
  .quotation-card-header {
    flex-direction: column;
    gap: var(--space-2);
  }
  .quotation-amount {
    text-align: left;
    font-size: 1.2rem;
  }
  .quotation-meta {
    flex-direction: column;
    gap: var(--space-1);
  }
}

/* Fix pipeline grid on very small screens */
@media (max-width: 480px) {
  .pipeline-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Fix member card actions */
@media (max-width: 480px) {
  .member-actions {
    flex-direction: column;
    gap: var(--space-2);
  }
  .member-actions .btn {
    width: 100%;
  }
}

/* Fix progress dashboard on mobile */
@media (max-width: 640px) {
  .progress-dashboard {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Fix filter tabs scrolling */
.filter-tabs,
.team-tabs,
.tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-2);
}

/* Fix form grids in modals */
@media (max-width: 640px) {
  .modal .dashboard-grid.grid-2 {
    grid-template-columns: 1fr !important;
  }
}

/* Fix line items on mobile */
@media (max-width: 768px) {
  .line-item-row {
    grid-template-columns: 1fr 1fr !important;
    gap: var(--space-2);
  }
  .line-item-header {
    display: none !important;
  }
}

/* Fix client preview on mobile */
@media (max-width: 640px) {
  .client-preview {
    padding: var(--space-4) !important;
  }
  .client-preview-header {
    flex-direction: column;
    gap: var(--space-3);
  }
  .client-preview-table th,
  .client-preview-table td {
    padding: var(--space-2);
    font-size: 0.75rem;
  }
}

/* Fix stage selector */
@media (max-width: 640px) {
  .stage-selector {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Fix send options */
@media (max-width: 480px) {
  .send-options {
    grid-template-columns: 1fr !important;
  }
}

/* Ensure main content doesn't overflow */
.main-content {
  overflow-x: hidden;
  min-width: 0;
}

/* Fix app container */
.app-container {
  overflow-x: hidden;
}

/* Better mobile header */
@media (max-width: 768px) {
  .header {
    padding: var(--space-3) var(--space-4);
  }
  .brand-name {
    font-size: 1.1rem;
  }
  .user-details {
    display: none;
  }
}

/* Fix empty state on mobile */
@media (max-width: 480px) {
  .empty-state {
    padding: var(--space-8) var(--space-4) !important;
  }
}

/* Fix quotation totals on mobile */
@media (max-width: 480px) {
  .quotation-totals {
    padding: var(--space-3);
  }
  .total-row {
    font-size: 0.85rem;
  }
  .total-row.grand {
    font-size: 1rem;
  }
}

/* Fix approval actions on mobile */
@media (max-width: 480px) {
  .approval-actions {
    flex-direction: column;
  }
  .approval-actions .btn {
    width: 100%;
  }
}

/* Hide sidebar properly on mobile */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content.with-sidebar {
    margin-left: 0 !important;
  }
}

/* Fix stat cards on mobile */
@media (max-width: 480px) {
  .stat-value {
    font-size: 1.5rem;
  }
  .stat-card {
    padding: var(--space-4);
  }
}

/* Ensure all images are responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Fix iframe in file preview */
iframe {
  max-width: 100%;
}

/* ============================================
   MOBILE SIDEBAR FIX — MNR Interiors ERP
   ============================================ */

/* Sidebar overlay must cover everything */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 85;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
  display: block !important;
}

/* Sidebar must be above overlay */
.sidebar {
  z-index: 90;
  background: var(--bg-card);
  box-shadow: var(--shadow-xl);
}

/* When sidebar is open, prevent body scroll */
body.sidebar-open {
  overflow: hidden;
}

/* Mobile menu button should always be visible on mobile */
@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
}

/* Fix sidebar width on mobile */
@media (max-width: 480px) {
  .sidebar {
    width: 280px;
    max-width: 85vw;
  }
}

/* Ensure main content doesn't shift weirdly */
.main-content {
  transition: margin-left 0.3s ease;
}

/* Fix header on very small screens */
@media (max-width: 480px) {
  .header {
    padding: var(--space-2) var(--space-3);
    min-height: 56px;
  }
  .brand-logo {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .brand-name {
    font-size: 1rem;
  }
  .brand-tagline {
    font-size: 0.6rem;
  }
  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
}

/* Fix quick actions buttons on mobile */
@media (max-width: 640px) {
  .quick-actions {
    flex-direction: column;
  }
  .quick-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Fix module cards on mobile */
@media (max-width: 640px) {
  .module-card {
    padding: var(--space-4);
  }
  .module-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  .module-title {
    font-size: 1rem;
  }
}

/* Fix stat cards on mobile */
@media (max-width: 480px) {
  .stat-value {
    font-size: 1.4rem;
  }
  .stat-label {
    font-size: 0.7rem;
  }
  .stat-card {
    padding: var(--space-3);
  }
}

/* Fix filter tabs on mobile */
@media (max-width: 480px) {
  .filter-tabs,
  .status-filters,
  .team-tabs,
  .tabs {
    gap: var(--space-1);
  }
  .filter-tab,
  .status-pill,
  .team-tab-btn,
  .tab-btn {
    padding: var(--space-1) var(--space-3);
    font-size: 0.8rem;
  }
}

/* Fix pipeline grid on mobile */
@media (max-width: 640px) {
  .pipeline-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: var(--space-2);
  }
  .pipeline-card {
    padding: var(--space-3);
  }
  .pipeline-icon {
    font-size: 1.4rem;
  }
  .pipeline-count {
    font-size: 1.2rem;
  }
  .pipeline-label {
    font-size: 0.6rem;
  }
}

/* Fix production project cards */
@media (max-width: 640px) {
  .prod-card-header {
    flex-direction: column;
    gap: var(--space-2);
  }
  .prod-progress-track {
    height: 6px;
  }
}

/* Fix member cards */
@media (max-width: 480px) {
  .member-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .member-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Fix assignment cards */
@media (max-width: 480px) {
  .assignment-header {
    flex-direction: column;
    gap: var(--space-2);
  }
  .assignment-meta {
    flex-direction: column;
    gap: var(--space-1);
  }
}

/* Fix quotation cards */
@media (max-width: 480px) {
  .quotation-card-header {
    flex-direction: column;
    gap: var(--space-2);
  }
  .quotation-amount {
    text-align: left;
    font-size: 1.2rem;
  }
}

/* Fix modal sizes on mobile */
@media (max-width: 640px) {
  .modal-xl,
  .modal-lg {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 2.5vw;
  }
  .modal {
    border-radius: var(--radius-md);
  }
  .modal-header {
    padding: var(--space-4);
  }
  .modal-body {
    padding: var(--space-4);
  }
  .modal-footer {
    padding: var(--space-3) var(--space-4);
    flex-direction: column;
    gap: var(--space-2);
  }
  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Fix stage timeline on mobile */
@media (max-width: 640px) {
  .stage-timeline {
    gap: var(--space-1);
  }
  .stage-node {
    min-width: 60px;
    padding: var(--space-1);
  }
  .stage-node-circle {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .stage-node-label {
    font-size: 0.6rem;
  }
  .stage-connector {
    min-width: 10px;
  }
}

/* Fix progress dashboard */
@media (max-width: 480px) {
  .progress-dashboard {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-2);
  }
  .progress-card {
    padding: var(--space-3);
  }
  .progress-card-value {
    font-size: 1.4rem;
  }
}

/* Fix checkin timeline on mobile */
@media (max-width: 640px) {
  .checkin-timeline {
    padding-left: var(--space-5);
  }
  .checkin-item::before {
    left: -22px;
    width: 10px;
    height: 10px;
  }
}

/* Fix work timeline on mobile */
@media (max-width: 640px) {
  .work-timeline {
    padding-left: var(--space-5);
  }
  .work-item::before {
    left: -22px;
    width: 10px;
    height: 10px;
  }
}

/* Fix materials used grid */
@media (max-width: 480px) {
  .materials-used-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Fix attachment grid */
@media (max-width: 480px) {
  .attachment-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Fix employee detail header */
@media (max-width: 640px) {
  .employee-detail-header {
    flex-direction: column;
    text-align: center;
  }
  .employee-detail-avatar {
    margin: 0 auto;
  }
}

/* Fix client preview on mobile */
@media (max-width: 640px) {
  .client-preview {
    padding: var(--space-4) !important;
  }
  .client-preview-header {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }
  .client-preview-brand {
    justify-content: center;
  }
  .client-preview-title {
    font-size: 1.1rem;
  }
  .client-preview-table th,
  .client-preview-table td {
    padding: var(--space-2);
    font-size: 0.75rem;
  }
}

/* Fix login page on mobile */
@media (max-width: 480px) {
  .login-card {
    padding: var(--space-6);
    margin: var(--space-4);
  }
  .login-brand h1 {
    font-size: 1.3rem;
  }
}

/* Fix demo accounts on mobile */
@media (max-width: 480px) {
  .demo-account {
    flex-direction: column;
    gap: var(--space-1);
    font-size: 0.7rem;
  }
}

/* Ensure all pages have proper mobile padding */
@media (max-width: 768px) {
  .main-content {
    padding: var(--space-4);
  }
}

/* Fix toast notifications on mobile */
@media (max-width: 480px) {
  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    top: var(--space-4);
  }
  .toast {
    min-width: auto;
    max-width: 100%;
  }
}
