:root {
  /* Color Palette - Premium Dark theme */
  --bg-primary: #0a0b0d;
  --bg-secondary: rgba(18, 20, 26, 0.82);
  --bg-tertiary: rgba(30, 34, 45, 0.6);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #00f0ff;
  
  --accent-cyan: #00f0ff;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-danger: #ef4444;
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --glow-cyan: 0 0 15px rgba(0, 240, 255, 0.35);
  --glow-green: 0 0 15px rgba(16, 185, 129, 0.35);
  
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Light map theme overrides if toggled */
body.light-theme {
  --bg-primary: #f3f4f6;
  --bg-secondary: rgba(255, 255, 255, 0.88);
  --bg-tertiary: rgba(243, 244, 246, 0.95);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #3b82f6;
  
  --accent-cyan: #2563eb;
  --accent-blue: #1d4ed8;
  
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  
  --glow-cyan: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  width: 100dvw;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  position: relative;
}

/* Leaflet Map */
#map {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Custom dark tile styling using CSS filter if in dark mode */
body:not(.light-theme) .leaflet-tile-container img {
  filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

.leaflet-control-zoom {
  display: none !important; /* Hide default leaflet zoom buttons */
}
.leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.5) !important;
  color: var(--text-muted) !important;
  border-radius: 4px;
  font-size: 10px !important;
  margin: 10px !important;
}

/* Sidebar Dashboard Container */
.dashboard {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 420px;
  max-height: calc(100vh - 40px);
  z-index: 10;
  background: var(--bg-secondary);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}

/* App Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-shrink: 0;
}

/* Company Info Bar */
.company-info-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.12);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.company-info-bar::-webkit-scrollbar {
  display: none;
}

.company-info-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s;
}

.company-info-item:hover {
  color: var(--accent-cyan);
}

.company-info-item i {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--accent-cyan);
  opacity: 0.7;
}

.company-info-divider {
  width: 1px;
  height: 14px;
  background: var(--border-color);
  flex-shrink: 0;
}

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

.brand-logo {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-cyan);
}

.brand-logo i {
  color: #fff;
  width: 20px;
  height: 20px;
  transform: rotate(45deg);
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.sub-brand {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

.profile-btn {
  background: none;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.profile-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Panel Management */
.panel {
  display: none;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 150px);
  padding-right: 4px;
}

.panel::-webkit-scrollbar {
  width: 4px;
}
.panel::-webkit-scrollbar-track {
  background: transparent;
}
.panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.panel.active {
  display: flex;
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Tab Navigation Bar */
.tab-navigation {
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 4px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  border-radius: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.tab-btn.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-cyan);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.tab-btn i {
  width: 16px;
  height: 16px;
}

/* Panel Headers & Sub-headings */
.welcome-text h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.welcome-text p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.welcome-text.style-sub {
  margin-top: 10px;
  margin-bottom: 4px;
}

.welcome-text.style-sub h3 {
  font-size: 0.95rem;
  font-weight: 700;
  border-left: 3px solid var(--accent-cyan);
  padding-left: 8px;
  color: var(--text-primary);
}

.target-client-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-top: -4px;
}

/* Action Bar Layout */
.action-bar {
  display: flex;
  margin-bottom: 12px;
  flex-shrink: 0;
  gap: 8px;
  align-items: center;
}

/* Lists and Container scrolls */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex-grow: 1;
  margin-bottom: 10px;
  padding-right: 2px;
}

.compact-list {
  max-height: 220px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.01);
  border-radius: 16px;
  padding: 10px;
}

.empty-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 40px 20px;
  flex-grow: 1;
}

.empty-list i {
  width: 48px;
  height: 48px;
  stroke-width: 1.5;
  color: var(--text-muted);
}

.empty-list p {
  font-size: 0.82rem;
  line-height: 1.5;
}

/* Filter Chips (Status Category) */
.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.filter-chips::-webkit-scrollbar {
  height: 3px;
}

.filter-chips::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.08);
}

.chip.active {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #000;
  box-shadow: var(--glow-cyan);
}

/* Client Details Card view */
.client-info-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.client-info-card .info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.client-info-card .info-row i {
  color: var(--accent-cyan);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.client-info-card .info-row div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-info-card .label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.client-info-card .val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Cards (Client & Order Items) */
.client-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s;
}

.client-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-cyan);
  transform: translateX(4px);
}

.client-card .client-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.client-card .client-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.client-card .client-details {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.client-card .client-stats {
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.order-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.order-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-cyan);
}

.order-card .order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-card .order-id {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-display);
}

.order-card .product-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.35;
}

.order-card .order-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.order-card .client-name-tag {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.order-card .client-name-tag i {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

/* Status Badge mapping */
.status-badge {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
  display: inline-block;
  white-space: nowrap;
  text-align: center;
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
  border-color: rgba(245, 158, 11, 0.25);
}

.status-badge.production {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.25);
}

.status-badge.shipped {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border-color: rgba(6, 182, 212, 0.25);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
}

.status-badge.completed {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.25);
}

/* Form Styles & Input Grids */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

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

.form-group input, 
.form-group textarea, 
.form-group select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

.form-group textarea {
  height: 80px;
  resize: none;
}

.form-group input[readonly] {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

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

.input-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-unit input {
  padding-right: 50px;
  width: 100%;
}

.input-unit .unit {
  position: absolute;
  right: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
  text-transform: uppercase;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* Generated Fabric Name Preview */
.generated-preview {
  background: rgba(0, 240, 255, 0.04);
  border: 1px dashed var(--accent-cyan);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.generated-preview .preview-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.generated-preview .preview-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
  word-break: break-all;
  line-height: 1.4;
}

/* Order Detail Sheet view */
.order-detail-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-detail-card .header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.order-detail-card .order-id {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-cyan);
  display: block;
}

.order-detail-card .client-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.order-detail-card h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.order-detail-card .product-name-txt {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 10px;
  word-break: break-all;
}

.spec-table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
}

.spec-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  padding: 4px;
}

.spec-cell:not(:nth-child(3n)) {
  border-right: 1px solid var(--border-color);
}

.spec-cell .lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

.spec-cell .val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.date-section {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.date-section .lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.date-section .val {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* State Progress Indicator Tracker */
.progress-container {
  padding: 10px 10px 20px 10px;
  position: relative;
}

.progress-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  width: 0%;
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

.progress-stops {
  position: absolute;
  top: 3px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none;
}

.progress-stops .stop {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2.5px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-stops .stop i {
  width: 12px;
  height: 12px;
}

.progress-stops .stop.active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

.progress-stops .stop.completed {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #000;
}

/* Workflow Action Controls */
.workflow-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workflow-controls .primary-btn {
  width: 100%;
}
.map-controls {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--bg-secondary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  transition: all 0.2s;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-cyan);
  transform: scale(1.05);
}

.control-btn i {
  width: 20px;
  height: 20px;
}

/* Custom Marker Styling on Map */
.pulse-marker {
  width: 16px;
  height: 16px;
  background: var(--accent-cyan);
  border: 3px solid #fff;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.pulse-marker::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  width: 26px;
  height: 26px;
  border: 2px solid var(--accent-cyan);
  border-radius: 50%;
  animation: markerRipple 2s infinite ease-out;
  opacity: 0.8;
}

@keyframes markerRipple {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Warehouse Central Marker */
.warehouse-marker-inner {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #0d0f12;
  border: 2px solid var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-green);
  color: var(--accent-green);
  transition: all 0.3s;
}

/* Client Marker Pin */
.client-marker-inner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0d0f12;
  border: 2px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  color: var(--accent-cyan);
  transition: all 0.3s;
}

.client-marker-inner:hover {
  transform: scale(1.1);
  border-color: #fff;
}

.client-marker-inner.has-orders {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
}

/* Delivery Truck Marker */
.truck-marker {
  transition: transform 0.2s linear;
}

.truck-marker-inner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-cyan);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-cyan);
  color: #000;
  transform: rotate(var(--heading, 0deg));
}

.truck-marker-inner i {
  width: 18px;
  height: 18px;
}

/* Dotted route path transition styles */
.route-path {
  stroke-dasharray: 8, 8;
  animation: routeDash 30s linear infinite;
}

@keyframes routeDash {
  to {
    stroke-dashoffset: -1000;
  }
}

/* Toast alert notification styling */
.toast-container {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(18, 20, 26, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-cyan);
  padding: 14px 20px;
  border-radius: 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 250px;
  max-width: 350px;
  pointer-events: auto;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.toast.toast-success {
  border-left-color: var(--accent-green);
}

.toast.toast-success i {
  color: var(--accent-green);
}

.toast.toast-info {
  border-left-color: var(--accent-blue);
}

.toast.toast-info i {
  color: var(--accent-blue);
}

.toast.toast-danger i {
  color: var(--accent-danger);
}

.toast i {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--accent-cyan);
}

#btn-toggle-dashboard {
  display: none !important;
}

/* Responsive UI Adjustment for Mobile devices */
@media (max-width: 768px) {
  #btn-toggle-dashboard {
    display: flex !important;
  }

  .dashboard.collapsed {
    max-height: 80px !important;
    padding-top: 22px;
    padding-bottom: 12px;
  }

  .dashboard.collapsed::before {
    background: rgba(255, 255, 255, 0.4);
  }

  .dashboard.collapsed .company-info-bar,
  .dashboard.collapsed .tab-navigation,
  .dashboard.collapsed .panel {
    display: none !important;
  }

  .dashboard {
    width: 100%;
    left: 0;
    top: auto;
    bottom: 0;
    max-height: 80dvh;
    border-radius: 28px 28px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
    padding: 24px 20px calc(15px + env(safe-area-inset-bottom)) 20px;
  }

  /* Bottom sheet handle visual */
  .dashboard::before {
    content: '';
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
  }

  .panel {
    max-height: calc(80dvh - 120px);
  }

  /* Compact Header on Mobile */
  .app-header {
    margin-bottom: 14px;
  }
  .brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .brand-logo i {
    width: 16px;
    height: 16px;
  }
  .brand h1 {
    font-size: 1rem;
  }
  .sub-brand {
    font-size: 0.65rem;
  }
  .profile-btn {
    width: 32px;
    height: 32px;
  }

  /* Compact Welcome Text */
  .welcome-text h2 {
    font-size: 1.25rem;
  }
  .welcome-text p {
    font-size: 0.8rem;
  }

  /* Compact Inputs */
  .search-box {
    padding: 12px;
    border-radius: 16px;
    gap: 8px;
  }
  .input-wrapper input {
    font-size: 0.9rem;
    padding: 6px 30px 6px 0;
  }
  .input-group {
    gap: 10px;
  }
  .input-divider {
    margin-left: 20px;
  }

  /* Compact Favorites */
  .quick-locations {
    gap: 8px;
  }
  .location-item {
    padding: 10px;
    border-radius: 12px;
    gap: 10px;
  }
  .icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .icon-circle i {
    width: 16px;
    height: 16px;
  }
  .location-item .name {
    font-size: 0.85rem;
  }
  .location-item .address {
    font-size: 0.7rem;
  }

  /* Compact Ride Selection */
  .ride-options-list {
    gap: 8px;
  }
  .ride-option-card {
    padding: 12px;
    border-radius: 16px;
  }
  .ride-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .ride-icon-wrapper i {
    width: 20px;
    height: 20px;
  }
  .ride-name {
    font-size: 0.88rem;
  }
  .ride-description {
    font-size: 0.7rem;
  }
  .ride-eta {
    font-size: 0.72rem;
  }
  .ride-price {
    font-size: 1rem;
  }
  .payment-method {
    padding: 12px;
    border-radius: 12px;
  }
  .payment-text {
    font-size: 0.8rem;
  }

  /* Compact Matching Radar */
  .matching-container {
    gap: 14px;
    padding: 10px 0;
  }
  .matching-container h2 {
    font-size: 1.15rem;
  }
  .matching-container p {
    font-size: 0.8rem;
  }
  .radar-animation {
    width: 130px;
    height: 130px;
    margin-bottom: 0;
  }
  .pulse-icon {
    width: 52px;
    height: 52px;
  }
  .matching-car-icon {
    width: 24px;
    height: 24px;
  }

  /* Compact Tracking & Driver details */
  .tracking-header h2 {
    font-size: 1.25rem;
  }
  .driver-card {
    padding: 12px;
    border-radius: 16px;
  }
  .avatar-wrapper {
    width: 50px;
    height: 50px;
  }
  .driver-name {
    font-size: 0.88rem;
  }
  .vehicle-model {
    font-size: 0.75rem;
  }
  .plate-number {
    font-size: 0.72rem;
    padding: 2px 6px;
  }

  /* Compact Feedback */
  .feedback-container {
    gap: 14px;
  }
  .celebration-icon {
    width: 60px;
    height: 60px;
  }
  .celebration-icon i {
    width: 30px;
    height: 30px;
  }
  .feedback-container h2 {
    font-size: 1.2rem;
  }
  .rating-stars {
    gap: 8px;
  }
  .star-btn i {
    width: 28px;
    height: 28px;
  }
  .comment-box textarea {
    height: 80px;
    padding: 10px;
    font-size: 0.82rem;
  }

  /* Reposition Map controls to top right to avoid overlap */
  .map-controls {
    top: 20px;
    bottom: auto;
    right: 16px;
    gap: 8px;
  }
  .control-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .control-btn i {
    width: 18px;
    height: 18px;
  }

  /* Reposition Toast notifications to top */
  .toast-container {
    top: 20px;
    bottom: auto;
    left: 16px;
    right: 16px;
  }
  .toast {
    min-width: 0;
    width: 100%;
    padding: 10px 16px;
    font-size: 0.8rem;
  }
}

/* Processing Options (가공 특성) Styles */
.processing-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 6px;
}

.option-checkbox {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s;
  user-select: none;
  border: 1px solid transparent;
}

.option-checkbox input {
  display: none; /* Hide default checkbox */
}

.option-checkbox:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

/* Checked state styling */
.option-checkbox.checked {
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--accent-cyan);
  box-shadow: 0 2px 10px rgba(0, 240, 255, 0.05);
}

/* Previous Orders Spec Loader Styling */
.previous-orders-selector {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.previous-orders-selector .selector-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.previous-orders-selector .selector-title i {
  width: 13px;
  height: 13px;
  color: var(--accent-cyan);
}

.previous-orders-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 100px;
  overflow-y: auto;
  padding-right: 4px;
}

.previous-orders-list::-webkit-scrollbar {
  width: 4px;
}

.previous-orders-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.load-spec-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.load-spec-btn:hover {
  background: rgba(0, 240, 255, 0.05);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.load-spec-btn .spec-date {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.previous-orders-list .no-history {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
  font-style: italic;
}

/* Search Box Styling */
.search-box {
  position: relative;
  flex: 1;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s;
}

.search-box input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

/* ==========================================================================
   Report Modal & Dashboard Styling
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 10, 19, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.report-modal-content {
  background: #0f1322;
  background: linear-gradient(135deg, #0f1322 0%, #151b30 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  width: 95%;
  max-width: 880px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  padding: 24px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .report-modal-content {
  transform: translateY(0);
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

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

.report-brand h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.report-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

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

/* KPI Grid */
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 580px) {
  .report-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card-mini {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.kpi-card-mini .kpi-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 6px;
}

.kpi-card-mini .kpi-val {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1.2;
}

.kpi-card-mini:nth-child(2) .kpi-val {
  color: #a78bfa;
}

.kpi-card-mini:nth-child(3) .kpi-val {
  color: var(--accent-green);
}

.kpi-card-mini .kpi-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Analysis Section */
.report-analysis-section {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-progress-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.color-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-name-label {
  width: 70px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.color-bar-wrapper {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.color-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width 0.8s ease-out;
}

.color-val-label {
  width: 50px;
  text-align: right;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Detailed Table */
.report-table-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow-x: auto;
  margin-bottom: 20px;
  background: rgba(8, 10, 19, 0.2);
}

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

.report-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

.report-table td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.report-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-primary);
}

.report-table td.txt-right, .report-table th.txt-right {
  text-align: right;
}

/* Footer Actions */
.report-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
}

/* Custom Scrollbar for Report Modal */
.report-modal-content::-webkit-scrollbar {
  width: 6px;
}

.report-modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* ==========================================================================
   Print Layout Override
   ========================================================================== */
@media print {
  /* Hide all dashboard layout components and background map */
  body {
    background: #fff !important;
    color: #000 !important;
  }
  
  #map,
  .dashboard,
  .map-controls,
  .toast-container,
  .report-footer,
  .report-header-actions {
    display: none !important;
  }

  .modal-overlay {
    display: none !important;
  }

  .modal-overlay.active {
    position: relative !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    background: transparent !important;
    backdrop-filter: none !important;
    display: block !important;
    z-index: auto !important;
  }

  .report-modal-content {
    background: #fff !important;
    color: #000 !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    transform: none !important;
  }

  .report-brand h3 {
    color: #000 !important;
    font-size: 1.6rem !important;
  }

  .report-date {
    color: #555 !important;
  }

  .kpi-card-mini {
    background: #fff !important;
    border: 1px solid #ddd !important;
  }

  .kpi-card-mini .kpi-label,
  .kpi-card-mini .kpi-sub {
    color: #555 !important;
  }

  .kpi-card-mini .kpi-val {
    color: #000 !important;
  }

  .report-analysis-section {
    background: #fff !important;
    border: 1px solid #ddd !important;
  }

  .section-title {
    color: #000 !important;
  }

  .color-name-label {
    color: #333 !important;
  }

  .color-bar-wrapper {
    background: #eee !important;
    border: 1px solid #ccc !important;
  }

  .color-bar-fill {
    /* Print background colors properly */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .color-val-label {
    color: #333 !important;
  }

  .report-table-wrapper {
    border: 1px solid #ccc !important;
    background: #fff !important;
  }

  .report-table th {
    background: #f5f5f5 !important;
    color: #000 !important;
    border-bottom: 1px solid #ccc !important;
  }

  .report-table td {
    color: #111 !important;
    border-bottom: 1px solid #eee !important;
  }

  .status-badge {
    border: 1px solid #999 !important;
    background: transparent !important;
    color: #000 !important;
  }
}

/* ==========================================================================
   User Authentication (Login & Signup) Portal
   ========================================================================== */
.auth-portal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, #111827 0%, #030712 100%);
  background-size: cover;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.5s ease;

  /* Force dark theme variables on authentication screen */
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border-color: rgba(255, 255, 255, 0.08);
}

.auth-portal.hide {
  opacity: 0;
  pointer-events: none;
}

.auth-card {
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  width: 90%;
  max-width: 420px;
  padding: 36px 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 
              0 0 50px rgba(0, 240, 255, 0.03);
  display: flex;
  flex-direction: column;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  width: 50px;
  height: 50px;
  background: rgba(0, 240, 255, 0.05);
  border: 1.5px solid rgba(0, 240, 255, 0.25);
  box-shadow: var(--glow-cyan);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}

.auth-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.auth-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.auth-form.active {
  display: flex;
  animation: authFadeIn 0.4s ease forwards;
}

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

.auth-form label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.auth-btn {
  background: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  color: #000;
  font-size: 0.88rem;
  box-shadow: var(--glow-cyan);
  transition: all 0.3s;
}

.auth-btn:hover {
  background: #00d8e6;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
}

/* User Display label styles */
.user-display-name {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 16px;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Animations */
@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* User Approval Cards */
.user-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.user-card .user-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.user-card .user-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-card .user-email {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: monospace;
}

.user-card .user-actions {
  display: flex;
  gap: 6px;
}

.user-card .user-actions button {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.user-card .btn-approve-user {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.18) !important;
  color: var(--accent-green);
}

.user-card .btn-approve-user:hover {
  background: var(--accent-green);
  color: #000;
  box-shadow: var(--glow-green);
}

.user-card .btn-reject-user {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15) !important;
  color: var(--accent-danger);
}

.user-card .btn-reject-user:hover {
  background: var(--accent-danger);
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.user-card .btn-revoke-user {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.15) !important;
  color: var(--accent-orange);
}

.user-card .btn-revoke-user:hover {
  background: var(--accent-orange);
  color: #000;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

@media (max-width: 480px) {
  .user-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .user-card .user-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Extra print override to hide auth screen just in case */
@media print {
  .auth-portal {
    display: none !important;
  }
}

/* ==========================================================================
   Dynamic Color Manager CSS Styles
   ========================================================================== */
.color-manager-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.color-manager-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.color-meta-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-preview-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 8px var(--item-glow, rgba(255, 255, 255, 0.1));
}

.color-title-txt {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.color-code-txt {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: monospace;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 6px;
}

.btn-delete-color {
  background: none;
  border: none;
  color: var(--accent-danger);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-delete-color:hover {
  background: rgba(239, 68, 68, 0.1);
  transform: scale(1.05);
}

.btn-delete-color i {
  width: 14px;
  height: 14px;
}

.color-manager-item.is-default {
  border-color: rgba(255, 255, 255, 0.03);
}

.color-manager-item.is-default .btn-delete-color {
  display: none !important; /* Default colors cannot be deleted */
}

/* Rollback Action Button */
.revert-btn {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15) !important;
  color: #f87171;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  width: 100%;
}

.revert-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}

.revert-btn i {
  width: 14px;
  height: 14px;
}

/* Production Scheduler Tab & Card Styles */
.schedule-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease-in-out;
  margin-bottom: 8px;
}

.schedule-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 240, 255, 0.2);
}

.schedule-rank-badge {
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.76rem;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.schedule-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.schedule-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-meta {
  font-size: 0.74rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-meta .client-name {
  font-weight: 600;
  color: var(--accent-green);
}

.schedule-controls {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.schedule-move-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.schedule-move-btn:hover:not(:disabled) {
  background: rgba(0, 240, 255, 0.08);
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

.schedule-move-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.schedule-move-btn i {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Light Theme Modals (Production/Delivery Reports, Schedule & Color Manager)
   ========================================================================== */
body.light-theme .report-modal-content {
  background: #ffffff;
  background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

body.light-theme .report-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-theme .report-brand h3 {
  color: #111827 !important;
}

body.light-theme .report-date {
  color: #6b7280 !important;
}

body.light-theme .kpi-card-mini {
  background: #f9fafb;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-theme .kpi-card-mini .kpi-label {
  color: #4b5563 !important;
}

body.light-theme .kpi-card-mini .kpi-sub {
  color: #6b7280 !important;
}

body.light-theme .kpi-card-mini .kpi-val {
  color: #2563eb !important;
}

body.light-theme .kpi-card-mini:nth-child(2) .kpi-val {
  color: #7c3aed !important;
}

body.light-theme .kpi-card-mini:nth-child(3) .kpi-val {
  color: #10b981 !important;
}

body.light-theme .report-analysis-section {
  background: #f9fafb;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-theme .section-title {
  color: #111827 !important;
}

body.light-theme .color-name-label {
  color: #374151 !important;
}

body.light-theme .color-bar-wrapper {
  background: rgba(0, 0, 0, 0.05);
}

body.light-theme .color-val-label {
  color: #4b5563 !important;
}

body.light-theme .report-table-wrapper {
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #ffffff;
}

body.light-theme .report-table th {
  background: #f9fafb;
  color: #4b5563 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-theme .report-table td {
  color: #374151 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

body.light-theme .report-table tbody tr:hover td {
  background: #f9fafb;
  color: #111827 !important;
}

body.light-theme .report-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-theme #report-table-body td:nth-child(5) {
  color: #6d28d9 !important;
}

body.light-theme .product-name-link {
  color: #2563eb !important;
}

body.light-theme .product-name-link:hover {
  color: #1d4ed8 !important;
}

body.light-theme .schedule-move-btn {
  background: #f3f4f6;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #4b5563;
}

body.light-theme .schedule-move-btn:hover:not(:disabled) {
  background: #e5e7eb;
  border-color: #cbd5e1;
  color: #111827;
}

body.light-theme .schedule-move-btn:disabled {
  opacity: 0.3;
}

body.light-theme .chip.active {
  color: #ffffff !important;
}

body.light-theme #btn-auto-schedule {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #d97706 !important;
}

body.light-theme #btn-auto-schedule:hover {
  background: rgba(245, 158, 11, 0.15);
}

body.light-theme #btn-auto-schedule i {
  color: #d97706 !important;
}

body.light-theme #delivery-report-modal input[type="date"],
body.light-theme #report-modal input[type="date"] {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  color: #111827 !important;
}

body.light-theme #btn-filter-delivery-dates {
  background: #2563eb !important;
  color: #ffffff !important;
}

body.light-theme #btn-filter-delivery-dates:hover {
  background: #1d4ed8 !important;
}

body.light-theme .schedule-rank-badge {
  background: rgba(37, 99, 235, 0.08) !important;
  border: 1px solid rgba(37, 99, 235, 0.25) !important;
  color: #2563eb !important;
  box-shadow: none !important;
}

body.light-theme #color-manager-modal #form-add-color {
  background: #f9fafb !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.light-theme #color-manager-modal #form-add-color label {
  color: #4b5563 !important;
}

body.light-theme #color-manager-modal input[type="text"] {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  color: #111827 !important;
}

body.light-theme .color-manager-item {
  background: #f9fafb !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .color-manager-item:hover {
  background: #f3f4f6 !important;
}

body.light-theme .color-title-txt {
  color: #111827 !important;
}

body.light-theme .color-code-txt {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #4b5563 !important;
}

body.light-theme .empty-list p {
  color: #4b5563 !important;
}

body.light-theme .icon-btn {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-theme .icon-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* Light theme status badges contrast boost */
body.light-theme .status-badge.pending {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #fde68a !important;
}

body.light-theme .status-badge.production {
  background: #f5f3ff !important;
  color: #6d28d9 !important;
  border-color: #ddd6fe !important;
}

body.light-theme .status-badge.shipped {
  background: #ecfeff !important;
  color: #0891b2 !important;
  border-color: #cffafe !important;
  box-shadow: none !important;
}

body.light-theme .status-badge.completed {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border-color: #d1fae5 !important;
}

/* Light theme overrides for toast alerts */
body.light-theme .toast {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-left: 4px solid var(--accent-cyan) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .toast.toast-success {
  border-left-color: #10b981 !important;
}

body.light-theme .toast.toast-success i {
  color: #10b981 !important;
}

body.light-theme .toast.toast-info {
  border-left-color: #3b82f6 !important;
}

body.light-theme .toast.toast-info i {
  color: #3b82f6 !important;
}

body.light-theme .toast.toast-danger {
  border-left-color: #ef4444 !important;
}

body.light-theme .toast.toast-danger i {
  color: #ef4444 !important;
}

body.light-theme .toast i {
  color: var(--accent-cyan) !important;
}




