/* Smart Inventory — Modern Yellow & Blue LED Glassmorphism Design System */

:root {
  --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-heading: 'Outfit', var(--font-family-base);
  --font-family-mono: 'JetBrains Mono', monospace;

  /* Color Palette — Futuristic Obsidian Glass with Electric Accents */
  --bg-base: #0b0f19;
  --bg-surface: rgba(15, 23, 42, 0.75);
  --bg-surface-elevated: rgba(30, 41, 59, 0.7);
  --bg-glass: rgba(11, 15, 25, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);

  /* Electric Yellow Accent */
  --accent-yellow: #facc15;
  --accent-yellow-dark: #ca8a04;
  --yellow-glow: 0 0 20px rgba(250, 204, 21, 0.35);

  /* Electric Cyber Blue & Cyan Accents */
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-blue-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --blue-glow: 0 0 20px rgba(6, 182, 212, 0.35);

  /* Dual LED Gradient (Yellow + Blue Signature Accent) */
  --led-gradient: linear-gradient(135deg, #facc15 0%, #06b6d4 50%, #3b82f6 100%);

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-surface: rgba(255, 255, 255, 0.9);
  --bg-surface-elevated: #ffffff;
  --bg-glass: rgba(248, 250, 252, 0.9);

  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
}

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

html, body {
  font-family: var(--font-family-base);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden !important;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(250, 204, 21, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
}

/* App Structure */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* Professional Topbar Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 1.75rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.brand-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.35));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-family-heading);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.68rem;
  color: var(--accent-yellow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Location Context Selector Chip */
.location-selector-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
  transition: all 0.2s ease;
}

.location-selector-chip:hover {
  border-color: var(--accent-yellow);
  box-shadow: var(--yellow-glow);
}

/* Universal Smart Bar Input */
.topbar-center {
  flex: 1;
  max-width: 580px;
  margin: 0 1.5rem;
}

.smart-bar-container {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.5rem 0.25rem 1rem;
  transition: all 0.2s ease;
}

.smart-bar-container:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: var(--blue-glow);
}

.smart-bar-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

.smart-bar-btn {
  background: var(--accent-blue-gradient);
  border: none;
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--blue-glow);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Push to Talk Voice Button */
.voice-talk-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
  color: #0f172a;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--yellow-glow);
  transition: all 0.2s ease;
}

.voice-talk-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 25px rgba(250, 204, 21, 0.6);
}

.voice-talk-btn.listening {
  animation: pulse-yellow 1.2s infinite;
  background: #ef4444;
  color: #fff;
}

@keyframes pulse-yellow {
  0% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(250, 204, 21, 0); }
  100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); }
}

/* Split-Screen Workspace Container — Strictly Fits Screen */
.split-workspace {
  display: flex;
  flex: 1;
  width: 100%;
  overflow-x: hidden;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-subtle);
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
}

.nav-item.active {
  background: var(--accent-blue-gradient);
  color: #ffffff;
  box-shadow: var(--blue-glow);
}

.workspace-main {
  flex: 1;
  min-width: 0; /* Prevents flex children from causing horizontal scroll */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem;
}

/* Right Split AI Drawer */
.ai-drawer-panel {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

@media (max-width: 1200px) {
  .ai-drawer-panel {
    display: none; /* Hide drawer on narrower screens to ensure ZERO side scrolling */
  }
}

.ai-drawer-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(250, 204, 21, 0.05);
}

.ai-drawer-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-bubble {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 90%;
}

.chat-bubble.assistant {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--accent-cyan);
  color: var(--text-main);
  align-self: flex-start;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.1);
}

.chat-bubble.user {
  background: var(--accent-blue-gradient);
  color: #fff;
  align-self: flex-end;
  box-shadow: var(--blue-glow);
}

/* Cards & Components */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  width: 100%;
  overflow-x: auto; /* Handles inner table overflow gracefully without shaking body */
}

.glass-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.15);
}

.glass-card.highlight {
  border: 1px solid var(--accent-yellow);
  box-shadow: var(--yellow-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-blue-gradient);
  color: #fff;
  box-shadow: var(--blue-glow);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-yellow {
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
  color: #0f172a;
  box-shadow: var(--yellow-glow);
}

.btn-yellow:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}

.chip-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.chip-badge.yellow {
  background: rgba(250, 204, 21, 0.15);
  color: var(--accent-yellow);
  border-color: rgba(250, 204, 21, 0.3);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 90%;
  max-width: 580px;
  box-shadow: var(--shadow-lg);
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}
