@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

/* Figma Dark Automotive OS Theme (Default) */
:root {
  --bg-primary: #090d16;
  --bg-sidebar: #0f172a;
  --bg-card: #131c2e;
  --bg-card-hover: #1e293b;
  --bg-input: #0b1120;
  --border-color: #1e293b;
  --border-subtle: #172033;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --gradient-brand: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --gradient-ai: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.6);
  
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* Light Mode Theme */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-cyan: #0891b2;
  --accent-purple: #7c3aed;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;

  --gradient-brand: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
  --gradient-ai: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --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 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

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

body, input, button, select, textarea, h1, h2, h3, h4, h5, h6, p, a, label {
  font-family: Arial, Helvetica, sans-serif;
}

i, .fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands, [class^="fa-"], [class*=" fa-"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
  font-style: normal !important;
  font-weight: 900 !important;
  display: inline-block;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Sidebar Layout */
.sidebar {
  width: 270px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.2rem;
  z-index: 100;
  transition: all 0.3s ease;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.35rem;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.brand-name {
  font-family: Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}
.brand-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
  text-transform: uppercase;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.9px;
  margin: 1.25rem 0 0.5rem 0.5rem;
}


.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.nav-item.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-item.ai-tab {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(219, 39, 119, 0.08) 100%);
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: var(--accent-purple);
}
.nav-item.ai-tab:hover, .nav-item.ai-tab.active {
  background: var(--gradient-ai);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(219, 39, 119, 0.3);
}

/* Main Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

/* Header Topbar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 2rem;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
}
.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
}

.role-switcher-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-primary);
  padding: 0.35rem 0.8rem;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

.role-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.role-badge.manager { background: rgba(124, 58, 237, 0.12); color: var(--accent-purple); border: 1px solid rgba(124, 58, 237, 0.3); }
.role-badge.receptionist { background: rgba(8, 145, 178, 0.12); color: var(--accent-cyan); border: 1px solid rgba(8, 145, 178, 0.3); }
.role-badge.technician { background: rgba(217, 119, 6, 0.12); color: var(--accent-amber); border: 1px solid rgba(217, 119, 6, 0.3); }
.role-badge.cashier { background: rgba(5, 150, 105, 0.12); color: var(--accent-emerald); border: 1px solid rgba(5, 150, 105, 0.3); }

.content-container {
  padding: 2rem;
  flex: 1;
}

/* Page Views Animation */
.view-section {
  display: none;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.view-section.active {
  display: block;
}

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

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

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.kpi-info h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}
.kpi-info .val {
  font-family: Arial, sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.kpi-trend {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.kpi-trend.up { color: var(--accent-emerald); }
.kpi-trend.neutral { color: var(--text-muted); }

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.kpi-icon.blue { background: rgba(37, 99, 235, 0.1); color: var(--accent-primary); }
.kpi-icon.emerald { background: rgba(5, 150, 105, 0.1); color: var(--accent-emerald); }
.kpi-icon.purple { background: rgba(124, 58, 237, 0.1); color: var(--accent-purple); }
.kpi-icon.amber { background: rgba(217, 119, 6, 0.1); color: var(--accent-amber); }

/* Table Container Cards */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 2rem;
}

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

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.custom-table th {
  background: var(--bg-primary);
  padding: 0.9rem 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}
.custom-table td {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
  color: var(--text-main);
}
.custom-table tr:hover td {
  background: var(--bg-card-hover);
}

/* Custom Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}
.status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-pill.received { background: rgba(8, 145, 178, 0.12); color: var(--accent-cyan); }
.status-pill.in_progress { background: rgba(217, 119, 6, 0.12); color: var(--accent-amber); }
.status-pill.finished { background: rgba(5, 150, 105, 0.12); color: var(--accent-emerald); }
.status-pill.invoiced { background: rgba(124, 58, 237, 0.12); color: var(--accent-purple); }
.status-pill.paid { background: rgba(5, 150, 105, 0.15); color: var(--accent-emerald); }
.status-pill.unpaid { background: rgba(225, 29, 72, 0.12); color: var(--accent-rose); }

/* Bar Chart Component */
.chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 180px;
  padding: 1rem 0.5rem 0.5rem 0.5rem;
  gap: 0.75rem;
}
.chart-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}
.chart-bar {
  width: 100%;
  max-width: 36px;
  background: var(--accent-primary);
  border-radius: 6px 6px 2px 2px;
  transition: all 0.3s ease;
  position: relative;
}
.chart-bar:hover {
  background: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}
.chart-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-weight: 600;
}
.chart-val {
  font-size: 0.7rem;
  color: var(--accent-primary);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

/* Activity Feed Timeline */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.activity-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}
.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.activity-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}
.activity-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.activity-time {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-left: auto;
  white-space: nowrap;
}

/* Hourly Appointment Schedule Timeline */
.schedule-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.timeline-slot {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.slot-time {
  width: 50px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-primary);
  padding-top: 0.4rem;
}
.slot-card {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
}
.slot-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}
.slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}
.slot-customer {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}
.slot-vehicle {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.slot-service {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Confidence Badge */
.confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}


/* Modern SaaS Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-primary {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.btn-ai {
  background: var(--gradient-ai);
  color: white;
  box-shadow: 0 4px 14px rgba(219, 39, 119, 0.3);
}
.btn-ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(219, 39, 119, 0.45);
}
.btn-secondary {
  background: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
}
.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* Modals System */
.sidebar-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  z-index: 99;
}
.sidebar-backdrop.active {
  display: block;
}

.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.close-btn:hover { color: var(--text-main); background: var(--bg-card-hover); }

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 600;
}
.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

select.form-control {
  cursor: pointer;
}

select.form-control option {
  background-color: var(--bg-card, #0f172a);
  color: var(--text-main, #f8fafc);
  padding: 0.5rem;
}

/* AI Sub-Navigation Tab Bar */
.ai-subnav-bar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.6rem;
  overflow-x: auto;
}
.ai-subtab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  font-family: Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25 ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ai-subtab-btn:hover {
  border-color: var(--accent-purple);
  color: var(--text-main);
  background: rgba(139, 92, 246, 0.1);
}
.ai-subtab-btn.active {
  background: var(--gradient-ai, linear-gradient(135deg, #8b5cf6, #ec4899));
  color: white;
  border-color: transparent;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.4);
}

/* AI Result & Chat Box System */
.ai-output-box {
  background: var(--bg-primary);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text-main);
  margin-top: 1rem;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.06);
  transition: all 0.3s ease;
}

.ai-output-box h3, .ai-output-box h4 {
  font-family: Arial, sans-serif;
  color: var(--accent-purple);
  margin: 0.8rem 0 0.4rem 0;
}

.ai-output-box strong {
  color: var(--accent-cyan);
}

.ai-output-box ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.ai-output-box li {
  margin-bottom: 0.3rem;
}

/* Prompt Pills & Shortcuts */
.prompt-pill-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.prompt-pill {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: var(--accent-purple);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.prompt-pill:hover {
  background: var(--gradient-ai);
  color: white;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(219, 39, 119, 0.3);
}

/* AI Glowing Avatar & Pulse */
.ai-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  color: var(--accent-emerald);
  font-size: 0.78rem;
  font-weight: 700;
}

.ai-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: aiPulse 1.8s infinite;
}

@keyframes aiPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Typing Loader Animation */
.ai-loader {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0;
  color: var(--accent-purple);
  font-weight: 600;
}

.ai-loader span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-purple);
  animation: aiBounce 1.4s infinite ease-in-out both;
}

.ai-loader span:nth-child(1) { animation-delay: -0.32s; }
.ai-loader span:nth-child(2) { animation-delay: -0.16s; }

@keyframes aiBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* Notification Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
}
.toast {
  background: var(--bg-sidebar);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.8rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* VietQR Bank Payment Component */
.qr-card-box {
  background: linear-gradient(135deg, #131c2e 0%, #0f172a 100%);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.qr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}
.qr-bank-title {
  font-family: Arial, sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent-rose);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.qr-image-wrapper {
  background: #ffffff;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  display: inline-block;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  margin-bottom: 1rem;
}
.qr-image-wrapper img {
  width: 210px;
  height: 210px;
  object-fit: contain;
  display: block;
}
.qr-account-info {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  text-align: left;
  margin-bottom: 1rem;
}
.qr-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  font-size: 0.88rem;
}
.qr-info-row:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}
.qr-info-label {
  color: var(--text-muted);
}
.qr-info-val {
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.copy-chip {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.copy-chip:hover {
  background: var(--accent-primary);
  color: white;
}

/* 4-Step Wizard Stepper CSS */
.wizard-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.wizard-step.active {
  opacity: 1;
  background: var(--bg-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}
.wizard-step .step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.wizard-step.active .step-num {
  background: var(--accent-primary);
  color: white;
  border-color: transparent;
}
.wizard-step .step-title {
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Workflow Status Badges */
.status-pill.ai_draft {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.status-pill.under_review {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.status-pill.approved {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Mobile Responsive Design System */
.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
}

.mobile-bottom-nav {
  display: none;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99;
}
.sidebar-backdrop.active {
  display: block;
}

/* Responsive Grid System Utility Classes */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-split-dashboard {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.grid-split-appointments {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 1.5rem;
}

.grid-5col-benchmark {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  text-align: center;
}

/* ==========================================================================
   Multi-Device Responsive Breakpoints System (Grid & Layout Adaptation)
   ========================================================================== */

/* 1. Large Desktops & Ultra-Wide (> 1400px) */
@media (min-width: 1401px) {
  .content-container {
    max-width: 1440px;
    margin: 0 auto;
  }
}

/* 2. Laptops & Standard Desktops (1025px - 1400px) */
@media (max-width: 1400px) and (min-width: 1025px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

/* 3. Tablets, iPads & All Mobile Devices (<= 1024px) */
@media (max-width: 1024px) {
  body {
    flex-direction: column !important;
  }

  /* Off-Canvas Mobile Drawer Sidebar */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -320px !important;
    bottom: 0 !important;
    width: 280px !important;
    height: 100vh !important;
    z-index: 9999 !important;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6) !important;
  }

  .sidebar.mobile-open {
    left: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Main Wrapper - Takes 100% Screen Width */
  .main-wrapper {
    width: 100% !important;
    max-width: 100vw !important;
    flex: 1 1 100% !important;
    min-height: 100vh;
    padding-bottom: 80px !important;
    overflow-x: hidden !important;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
  }

  .top-bar {
    padding: 0.85rem 1rem !important;
  }
  .top-bar h2 {
    font-size: 1.05rem !important;
  }

  .header-controls {
    gap: 0.5rem;
  }
  .role-switcher-container span:first-child {
    display: none !important;
  }

  .content-container {
    padding: 1rem 0.85rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Responsive Grid Adaptations */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
    margin-bottom: 1.25rem !important;
  }
  .kpi-card {
    padding: 0.85rem 1rem !important;
  }
  .kpi-info .val {
    font-size: 1.3rem !important;
  }

  .grid-split-dashboard,
  .grid-split-appointments,
  .grid-2col {
    grid-template-columns: 1fr !important;
    gap: 1.0rem !important;
  }

  .grid-5col-benchmark {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Filter bars */
  div[style*="background: var(--bg-sidebar)"] {
    flex-direction: column;
    align-items: stretch !important;
  }
  div[style*="background: var(--bg-sidebar)"] select,
  div[style*="background: var(--bg-sidebar)"] input {
    width: 100% !important;
  }

  /* Stepper mobile layout */
  .wizard-stepper {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .wizard-step {
    flex: 1 1 45%;
    padding: 0.5rem;
  }
  .wizard-step .step-title {
    font-size: 0.75rem;
  }

  /* Modals */
  .modal-card {
    width: 95%;
    padding: 1.25rem;
    max-height: 85vh;
  }

  /* Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    z-index: 9990;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.5rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    flex: 1;
    padding: 0.4rem 0;
    transition: all 0.2s ease;
  }
  .mobile-nav-item i {
    font-size: 1.15rem;
  }
  .mobile-nav-item.active {
    color: var(--accent-primary);
  }
  .mobile-nav-item.ai-tab.active {
    color: var(--accent-purple);
  }
}

/* 4. Extra Small Phones (< 480px) */
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr !important;
  }
  .grid-5col-benchmark {
    grid-template-columns: 1fr !important;
  }
  .wizard-step {
    flex: 1 1 100% !important;
  }
  .top-bar {
    padding: 0.65rem 0.75rem !important;
  }
  .top-bar h2 {
    font-size: 0.95rem !important;
  }
  .role-switcher-container {
    padding: 0.2rem 0.4rem !important;
  }
  .role-badge {
    display: none !important;
  }
  .btn {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.78rem !important;
  }
}

/* GarageAI Assistant Modal & Floating Widget */
.garage-ai-modal {
  font-family: Arial, sans-serif;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.garage-ai-input:focus {
  border-color: #2b7a8c !important;
  box-shadow: 0 0 0 3px rgba(43, 122, 140, 0.25) !important;
}

.garage-ai-send-btn:hover {
  background: #236574 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(43, 122, 140, 0.4);
}

.garage-ai-send-btn:active {
  transform: translateY(0);
}

.garage-ai-body::-webkit-scrollbar {
  width: 6px;
}
.garage-ai-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 4px;
}

.floating-ai-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #164e63 0%, #0891b2 100%);
  color: #67e8f9;
  border: 1px solid rgba(103, 232, 249, 0.3);
  box-shadow: 0 8px 24px rgba(8, 145, 178, 0.4);
  font-size: 1.35rem;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-ai-trigger:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px rgba(8, 145, 178, 0.55);
  color: #ffffff;
}

@media (max-width: 768px) {
  .floating-ai-trigger {
    bottom: 80px;
    right: 16px;
    width: 46px;
    height: 46px;
    font-size: 1.15rem;
  }
}



