/**
 * CarAssist Engineer Panel - Industrial Automotive Premium Theme
 *
 * Design Philosophy: "Cockpit Control Center"
 * - Dark industrial background like a mechanic's workshop
 * - Orange accent (racing/safety) for key actions
 * - Steel/carbon fiber textures
 * - Clean instrument cluster styling
 * - Professional, no-nonsense interface
 */

/* ============================================
   ROOT VARIABLES - COCKPIT COLOR PALETTE
   ============================================ */
:root {
  /* Primary - Dark industrial palette */
  --cockpit-bg-deep: #0a0e14;
  --cockpit-bg-main: #0d1117;
  --cockpit-bg-panel: #151b23;
  --cockpit-bg-card: #1c232d;
  --cockpit-bg-elevated: #252d38;

  /* Borders - subtle steel lines */
  --cockpit-border: rgba(56, 68, 83, 0.5);
  --cockpit-border-light: rgba(56, 68, 83, 0.3);
  --cockpit-border-accent: rgba(249, 115, 22, 0.3);

  /* Text hierarchy */
  --cockpit-text-primary: #f0f4f8;
  --cockpit-text-secondary: #8b98a8;
  --cockpit-text-muted: #5c6b7a;
  --cockpit-text-dim: #3d4a58;

  /* Accent - Racing Orange */
  --cockpit-accent: #f97316;
  --cockpit-accent-hover: #fb923c;
  --cockpit-accent-muted: rgba(249, 115, 22, 0.15);
  --cockpit-accent-glow: rgba(249, 115, 22, 0.4);

  /* Status colors - instrument cluster style */
  --cockpit-success: #22c55e;
  --cockpit-success-muted: rgba(34, 197, 94, 0.15);
  --cockpit-warning: #eab308;
  --cockpit-warning-muted: rgba(234, 179, 8, 0.15);
  --cockpit-danger: #ef4444;
  --cockpit-danger-muted: rgba(239, 68, 68, 0.15);
  --cockpit-info: #3b82f6;
  --cockpit-info-muted: rgba(59, 130, 246, 0.15);

  /* Channel colors */
  --channel-web: #3b82f6;
  --channel-telegram: #2aabee;
  --channel-viber: #7360f2;
  --channel-whatsapp: #25d366;

  /* Shadows - depth */
  --cockpit-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --cockpit-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --cockpit-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --cockpit-shadow-glow: 0 0 20px var(--cockpit-accent-glow);

  /* Typography */
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================
   GLOBAL COCKPIT STYLES
   ============================================ */
.cockpit-theme {
  background: var(--cockpit-bg-deep);
  color: var(--cockpit-text-primary);
  font-family: var(--font-display);
}

/* Ensure turbo-frame elements work with flexbox/grid spacing */
.cockpit-theme turbo-frame {
  display: block;
}

.cockpit-theme * {
  scrollbar-width: thin;
  scrollbar-color: var(--cockpit-bg-elevated) var(--cockpit-bg-panel);
}

.cockpit-theme ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.cockpit-theme ::-webkit-scrollbar-track {
  background: var(--cockpit-bg-panel);
}

.cockpit-theme ::-webkit-scrollbar-thumb {
  background: var(--cockpit-bg-elevated);
  border-radius: 3px;
}

.cockpit-theme ::-webkit-scrollbar-thumb:hover {
  background: var(--cockpit-text-muted);
}

/* ============================================
   SIDEBAR - COMMAND CENTER
   ============================================ */
.cockpit-sidebar {
  background: linear-gradient(180deg, var(--cockpit-bg-main) 0%, var(--cockpit-bg-deep) 100%);
  border-right: 1px solid var(--cockpit-border);
  display: flex;
  flex-direction: column;
}

.cockpit-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--cockpit-border);
}

.cockpit-sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--cockpit-accent) 0%, #ea580c 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--cockpit-shadow-glow);
}

.cockpit-sidebar-logo-icon svg {
  width: 22px;
  height: 22px;
  color: white;
}

.cockpit-sidebar-logo-text {
  display: flex;
  flex-direction: column;
}

.cockpit-sidebar-logo-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--cockpit-text-primary);
  letter-spacing: -0.02em;
}

.cockpit-sidebar-logo-subtitle {
  font-size: 11px;
  color: var(--cockpit-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Navigation Items */
.cockpit-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.cockpit-nav-section {
  margin-bottom: 24px;
}

.cockpit-nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--cockpit-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0 12px 8px;
}

.cockpit-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 2px 0;
  border-radius: 10px;
  color: var(--cockpit-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.15s ease,
              color 0.15s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

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

.cockpit-nav-item:active {
  transform: scale(0.98);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

.cockpit-nav-item.active {
  background: var(--cockpit-accent-muted);
  color: var(--cockpit-accent);
  border-left: 3px solid var(--cockpit-accent);
  margin-left: -3px;
  padding-left: 19px;
}

.cockpit-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--cockpit-accent);
  border-radius: 0 3px 3px 0;
}

.cockpit-nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.cockpit-nav-item .badge {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cockpit-nav-item .badge-orange {
  background: linear-gradient(135deg, var(--cockpit-accent) 0%, #ea580c 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.cockpit-nav-item .badge-blue {
  background: linear-gradient(135deg, var(--cockpit-info) 0%, #2563eb 100%);
  color: white;
}

/* User Section */
.cockpit-user-section {
  padding: 16px 20px;
  border-top: 1px solid var(--cockpit-border);
  background: var(--cockpit-bg-panel);
}

.cockpit-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cockpit-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cockpit-accent) 0%, #ea580c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.cockpit-user-info {
  flex: 1;
  min-width: 0;
}

.cockpit-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cockpit-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cockpit-user-role {
  font-size: 12px;
  color: var(--cockpit-text-muted);
}

.cockpit-logout-btn {
  padding: 8px;
  border-radius: 8px;
  color: var(--cockpit-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cockpit-logout-btn:hover {
  background: var(--cockpit-bg-elevated);
  color: var(--cockpit-danger);
}

/* ============================================
   HEADER - INSTRUMENT PANEL
   ============================================ */
.cockpit-header {
  height: 64px;
  background: var(--cockpit-bg-panel);
  border-bottom: 1px solid var(--cockpit-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.cockpit-header-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--cockpit-text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.cockpit-header-title svg {
  width: 24px;
  height: 24px;
  color: var(--cockpit-accent);
}

.cockpit-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.cockpit-main {
  background: var(--cockpit-bg-deep);
  min-height: 100vh;
  padding: 24px;
}

.cockpit-container {
  max-width: 1600px;
  margin: 0 auto;
}

/* ============================================
   GAUGE CARDS - INSTRUMENT CLUSTER
   ============================================ */
.cockpit-gauges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

.cockpit-gauge {
  background: var(--cockpit-bg-card);
  border: 1px solid var(--cockpit-border);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.15s ease,
              box-shadow 0.15s ease;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.cockpit-gauge:hover {
  transform: translateY(-3px);
  border-color: var(--cockpit-border-accent);
  box-shadow: var(--cockpit-shadow-md), 0 0 30px rgba(249, 115, 22, 0.15);
}

.cockpit-gauge:active {
  transform: translateY(-1px) scale(0.98);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

.cockpit-gauge::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gauge-color, var(--cockpit-accent));
  opacity: 0.8;
}

.cockpit-gauge-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cockpit-gauge-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gauge-bg, var(--cockpit-accent-muted));
}

.cockpit-gauge-icon svg {
  width: 24px;
  height: 24px;
  color: var(--gauge-color, var(--cockpit-accent));
}

.cockpit-gauge-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gauge-color, var(--cockpit-accent));
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 var(--gauge-glow, rgba(249, 115, 22, 0.5));
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 0 10px 5px var(--gauge-glow, rgba(249, 115, 22, 0.3));
  }
}

.cockpit-gauge-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--cockpit-text-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  line-height: 1;
}

.cockpit-gauge-label {
  font-size: 13px;
  color: var(--cockpit-text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Gauge color variants */
.cockpit-gauge--open {
  --gauge-color: var(--cockpit-warning);
  --gauge-bg: var(--cockpit-warning-muted);
  --gauge-glow: rgba(234, 179, 8, 0.5);
}

.cockpit-gauge--progress {
  --gauge-color: var(--cockpit-info);
  --gauge-bg: var(--cockpit-info-muted);
  --gauge-glow: rgba(59, 130, 246, 0.5);
}

.cockpit-gauge--closed {
  --gauge-color: var(--cockpit-success);
  --gauge-bg: var(--cockpit-success-muted);
  --gauge-glow: rgba(34, 197, 94, 0.5);
}

.cockpit-gauge--queue {
  --gauge-color: #8b5cf6;
  --gauge-bg: rgba(139, 92, 246, 0.15);
  --gauge-glow: rgba(139, 92, 246, 0.5);
}

/* ============================================
   PANEL CARDS - INFORMATION DISPLAYS
   ============================================ */
.cockpit-panel {
  background: var(--cockpit-bg-card);
  border: 1px solid var(--cockpit-border);
  border-radius: 16px;
  overflow: hidden;
}

.cockpit-panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--cockpit-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, var(--cockpit-bg-elevated) 0%, var(--cockpit-bg-card) 100%);
}

.cockpit-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--cockpit-text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.cockpit-panel-title svg {
  width: 20px;
  height: 20px;
  color: var(--cockpit-accent);
}

.cockpit-panel-action {
  font-size: 13px;
  color: var(--cockpit-accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.cockpit-panel-action:hover {
  color: var(--cockpit-accent-hover);
}

.cockpit-panel-body {
  padding: 0;
}

/* ============================================
   STATS GRID
   ============================================ */
.cockpit-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px;
}

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

.cockpit-stat {
  background: var(--cockpit-bg-elevated);
  border-radius: 12px;
  padding: 16px;
  position: relative;
}

.cockpit-stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--stat-color, var(--cockpit-accent));
}

.cockpit-stat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cockpit-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--stat-bg, var(--cockpit-accent-muted));
}

.cockpit-stat-icon svg {
  width: 16px;
  height: 16px;
  color: var(--stat-color, var(--cockpit-accent));
}

.cockpit-stat-label {
  font-size: 12px;
  color: var(--cockpit-text-muted);
}

.cockpit-stat-value {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--stat-color, var(--cockpit-accent));
}

.cockpit-stat--blue {
  --stat-color: var(--cockpit-info);
  --stat-bg: var(--cockpit-info-muted);
}

.cockpit-stat--green {
  --stat-color: var(--cockpit-success);
  --stat-bg: var(--cockpit-success-muted);
}

.cockpit-stat--purple {
  --stat-color: #8b5cf6;
  --stat-bg: rgba(139, 92, 246, 0.15);
}

.cockpit-stat--amber {
  --stat-color: var(--cockpit-warning);
  --stat-bg: var(--cockpit-warning-muted);
}

/* ============================================
   CONVERSATION LIST
   ============================================ */
.cockpit-conversation-list {
  display: flex;
  flex-direction: column;
}

.cockpit-conversation-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--cockpit-border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

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

.cockpit-conversation-row:hover {
  background: var(--cockpit-bg-elevated);
}

.cockpit-conversation-row:active {
  transform: scale(0.995);
  background: var(--cockpit-bg-panel);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1), background 0.08s ease;
}

.cockpit-conversation-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: var(--cockpit-shadow-sm);
}

.cockpit-conversation-avatar svg {
  width: 22px;
  height: 22px;
}

.cockpit-conversation-content {
  flex: 1;
  min-width: 0;
}

.cockpit-conversation-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.cockpit-conversation-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cockpit-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cockpit-conversation-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cockpit-conversation-status--open {
  background: var(--cockpit-success-muted);
  color: var(--cockpit-success);
}

.cockpit-conversation-status--closed {
  background: var(--cockpit-bg-elevated);
  color: var(--cockpit-text-muted);
}

.cockpit-conversation-preview {
  font-size: 13px;
  color: var(--cockpit-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cockpit-conversation-preview strong {
  color: var(--cockpit-text-muted);
  font-weight: 500;
}

.cockpit-conversation-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--cockpit-text-muted);
}

.cockpit-conversation-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cockpit-conversation-meta-item svg {
  width: 14px;
  height: 14px;
}

.cockpit-conversation-arrow {
  width: 20px;
  height: 20px;
  color: var(--cockpit-text-dim);
  flex-shrink: 0;
}

/* ============================================
   SYSTEM STATUS
   ============================================ */
.cockpit-status-list {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cockpit-status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--cockpit-bg-elevated);
  border-radius: 10px;
}

.cockpit-status-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cockpit-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
}

.cockpit-status-dot--active {
  background: var(--cockpit-success);
}

.cockpit-status-dot--active::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--cockpit-success);
  opacity: 0.3;
  animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.3); opacity: 0; }
}

.cockpit-status-dot--inactive {
  background: var(--cockpit-text-muted);
}

.cockpit-status-label {
  font-size: 14px;
  color: var(--cockpit-text-secondary);
}

.cockpit-status-value {
  font-size: 13px;
  font-weight: 600;
}

.cockpit-status-value--active {
  color: var(--cockpit-success);
}

.cockpit-status-value--inactive {
  color: var(--cockpit-text-muted);
}

/* ============================================
   ROLE BADGES
   ============================================ */
.cockpit-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cockpit-role-badge--tech_specialist {
  background: linear-gradient(135deg, var(--cockpit-info) 0%, #2563eb 100%);
  color: white;
}

.cockpit-role-badge--supervisor {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.cockpit-role-badge--manager {
  background: linear-gradient(135deg, var(--cockpit-success) 0%, #16a34a 100%);
  color: white;
}

.cockpit-role-badge--director {
  background: linear-gradient(135deg, var(--cockpit-accent) 0%, #ea580c 100%);
  color: white;
}

.cockpit-role-badge--admin {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

/* ============================================
   ONLINE STATUS INDICATOR
   ============================================ */
.cockpit-online-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.cockpit-online-status--online {
  background: var(--cockpit-success-muted);
  color: var(--cockpit-success);
}

.cockpit-online-status--online .cockpit-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cockpit-success);
  position: relative;
}

.cockpit-online-status--online .cockpit-online-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--cockpit-success);
  animation: ping 1.5s infinite;
}

@keyframes ping {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

.cockpit-online-status--offline {
  background: var(--cockpit-bg-elevated);
  color: var(--cockpit-text-muted);
}

.cockpit-online-status--offline .cockpit-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cockpit-text-muted);
}

/* ============================================
   BUTTONS - With tactile feedback
   ============================================ */
.cockpit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.15s ease,
              background 0.15s ease,
              border-color 0.15s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Ripple effect base */
.cockpit-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%),
              rgba(255, 255, 255, 0.3) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0);
  transition: transform 0.4s ease-out, opacity 0.3s ease-out;
  pointer-events: none;
}

.cockpit-btn:active::after {
  opacity: 1;
  transform: scale(2.5);
  transition: transform 0.1s ease-out, opacity 0s;
}

/* Primary button */
.cockpit-btn--primary {
  background: linear-gradient(135deg, var(--cockpit-accent) 0%, #ea580c 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.cockpit-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.45);
}

.cockpit-btn--primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.08s ease;
}

/* Secondary button */
.cockpit-btn--secondary {
  background: var(--cockpit-bg-elevated);
  color: var(--cockpit-text-secondary);
  border: 1px solid var(--cockpit-border);
}

.cockpit-btn--secondary::after {
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%),
              rgba(249, 115, 22, 0.2) 0%, transparent 60%);
}

.cockpit-btn--secondary:hover {
  background: var(--cockpit-bg-panel);
  color: var(--cockpit-text-primary);
  border-color: var(--cockpit-border-accent);
  transform: translateY(-1px);
}

.cockpit-btn--secondary:active {
  transform: translateY(0) scale(0.97);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Danger button */
.cockpit-btn--danger {
  background: linear-gradient(135deg, var(--cockpit-danger) 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.cockpit-btn--danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

.cockpit-btn--danger:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.08s ease;
}

/* Success button */
.cockpit-btn--success {
  background: linear-gradient(135deg, var(--cockpit-success) 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.cockpit-btn--success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);
}

.cockpit-btn--success:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.08s ease;
}

/* Ghost/Icon-only button */
.cockpit-btn--ghost {
  background: transparent;
  color: var(--cockpit-text-secondary);
  padding: 8px;
}

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

.cockpit-btn--ghost:active {
  transform: scale(0.92);
  background: var(--cockpit-bg-panel);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

.cockpit-btn svg {
  width: 18px;
  height: 18px;
}

/* Button sizes */
.cockpit-btn--sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.cockpit-btn--lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 12px;
}

/* Disabled state */
.cockpit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.cockpit-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.cockpit-empty {
  text-align: center;
  padding: 60px 20px;
}

.cockpit-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: var(--cockpit-bg-elevated);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cockpit-empty-icon svg {
  width: 32px;
  height: 32px;
  color: var(--cockpit-text-muted);
}

.cockpit-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--cockpit-text-secondary);
  margin-bottom: 8px;
}

.cockpit-empty-text {
  font-size: 14px;
  color: var(--cockpit-text-muted);
}

/* ============================================
   GRID LAYOUTS
   ============================================ */
.cockpit-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.cockpit-grid-3 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

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

/* ============================================
   MOBILE HEADER
   ============================================ */
.cockpit-mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--cockpit-bg-panel);
  border-bottom: 1px solid var(--cockpit-border);
}

@media (max-width: 1024px) {
  .cockpit-mobile-header {
    display: block;
  }

  .cockpit-sidebar {
    display: none;
  }

  .cockpit-main {
    padding-top: 80px;
  }
}

.cockpit-mobile-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 16px;
}

.cockpit-mobile-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cockpit-mobile-logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--cockpit-accent) 0%, #ea580c 100%);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cockpit-mobile-logo-icon svg {
  width: 16px;
  height: 16px;
  color: white;
}

.cockpit-mobile-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--cockpit-text-primary);
}

.cockpit-mobile-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cockpit-mobile-nav-item {
  padding: 8px;
  border-radius: 8px;
  color: var(--cockpit-text-muted);
  position: relative;
}

.cockpit-mobile-nav-item.active {
  background: var(--cockpit-bg-elevated);
  color: var(--cockpit-accent);
}

.cockpit-mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

.cockpit-mobile-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--cockpit-accent) 0%, #ea580c 100%);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--cockpit-bg-panel);
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.cockpit-theme-toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--cockpit-bg-elevated);
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
}

.cockpit-theme-toggle.active {
  background: var(--cockpit-accent);
}

.cockpit-theme-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background: white;
  box-shadow: var(--cockpit-shadow-sm);
  transition: transform 0.2s ease;
}

.cockpit-theme-toggle.active .cockpit-theme-toggle-knob {
  transform: translateX(20px);
}

/* ============================================
   LANGUAGE TOGGLE
   ============================================ */
.cockpit-lang-toggle {
  display: flex;
  gap: 6px;
}

.cockpit-lang-btn {
  width: 32px;
  height: 24px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cockpit-lang-btn--inactive {
  background: var(--cockpit-bg-elevated);
  color: var(--cockpit-text-muted);
}

.cockpit-lang-btn--inactive:hover {
  background: var(--cockpit-bg-panel);
  color: var(--cockpit-text-secondary);
}

.cockpit-lang-btn--ua {
  background: #005bbb;
  color: white;
}

.cockpit-lang-btn--ru {
  background: #d52b1e;
  color: white;
}

/* ============================================
   FLASH MESSAGES
   ============================================ */
.cockpit-flash {
  margin: 24px 24px 0;
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cockpit-flash--success {
  background: var(--cockpit-success-muted);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.cockpit-flash--success svg {
  color: var(--cockpit-success);
}

.cockpit-flash--success p {
  color: var(--cockpit-success);
}

.cockpit-flash--error {
  background: var(--cockpit-danger-muted);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.cockpit-flash--error svg {
  color: var(--cockpit-danger);
}

.cockpit-flash--error p {
  color: var(--cockpit-danger);
}

.cockpit-flash svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.cockpit-flash p {
  font-size: 14px;
  font-weight: 500;
}

/* ============================================
   TEAM STATS CARD
   ============================================ */
.cockpit-team-stats {
  padding: 20px;
}

.cockpit-team-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--cockpit-border-light);
}

.cockpit-team-stat-row:last-child {
  border-bottom: none;
}

.cockpit-team-stat-label {
  font-size: 14px;
  color: var(--cockpit-text-secondary);
}

.cockpit-team-stat-value {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.cockpit-team-stat-value--green {
  color: var(--cockpit-success);
}

.cockpit-team-stat-value--default {
  color: var(--cockpit-text-primary);
}

.cockpit-team-stat-value--amber {
  color: var(--cockpit-warning);
}

/* ============================================
   SETTINGS FOOTER (Language/Theme)
   ============================================ */
.cockpit-settings-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--cockpit-border);
  background: var(--cockpit-bg-panel);
}

.cockpit-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.cockpit-settings-label {
  font-size: 12px;
  color: var(--cockpit-text-muted);
}

/* ============================================
   GLOBAL TACTILE FEEDBACK - ACTION BUTTONS
   Subtle but satisfying click effects
   ============================================ */

/* Base button click effect for all action buttons */
.cockpit-theme button,
.cockpit-theme [type="submit"],
.cockpit-theme .btn-action {
  position: relative;
  transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.15s ease,
              filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Scale down on click - satisfying press effect */
.cockpit-theme button:active:not(:disabled),
.cockpit-theme [type="submit"]:active:not(:disabled),
.cockpit-theme .btn-action:active {
  transform: scale(0.96);
  transition: transform 0.06s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Orange/Primary buttons - enhanced glow on click */
.cockpit-theme button[class*="bg-orange"]:active:not(:disabled),
.cockpit-theme button[class*="from-orange"]:active:not(:disabled) {
  transform: scale(0.96);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Green/Success buttons */
.cockpit-theme button[class*="bg-emerald"]:active:not(:disabled),
.cockpit-theme button[class*="bg-green"]:active:not(:disabled),
.cockpit-theme button[class*="from-emerald"]:active:not(:disabled) {
  transform: scale(0.96);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Blue buttons (solid and gradient) */
.cockpit-theme button[class*="bg-blue"]:active:not(:disabled),
.cockpit-theme button[class*="from-blue"]:active:not(:disabled) {
  transform: scale(0.96);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Teal/Cyan buttons (AI toggle) */
.cockpit-theme button[class*="bg-teal"]:active:not(:disabled),
.cockpit-theme button[class*="bg-cyan"]:active:not(:disabled),
.cockpit-theme button[class*="from-teal"]:active:not(:disabled) {
  transform: scale(0.96);
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Red/Danger buttons */
.cockpit-theme button[class*="bg-red"]:active:not(:disabled),
.cockpit-theme button[class*="from-red"]:active:not(:disabled) {
  transform: scale(0.96);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Slate/Secondary buttons - subtle effect */
.cockpit-theme button[class*="bg-slate-100"]:active:not(:disabled),
.cockpit-theme button[class*="bg-slate-200"]:active:not(:disabled),
.cockpit-theme button[class*="dark:bg-slate-700"]:active:not(:disabled) {
  transform: scale(0.97);
  filter: brightness(0.95);
}

/* Icon-only buttons (attach file, etc) - various sizing patterns */
.cockpit-theme button[class*="rounded-xl"][class*="w-10"]:active:not(:disabled),
.cockpit-theme button[class*="rounded-lg"][class*="w-9"]:active:not(:disabled),
.cockpit-theme button[class*="rounded-lg"][class*="w-8"]:active:not(:disabled) {
  transform: scale(0.88);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Small icon buttons with padding-based sizing (p-2, p-2.5, p-3) */
.cockpit-theme button[class*="rounded-lg"][class*="p-2"]:active:not(:disabled),
.cockpit-theme button[class*="rounded-xl"][class*="p-2"]:active:not(:disabled),
.cockpit-theme button[class*="rounded-lg"][class*="p-3"]:active:not(:disabled),
.cockpit-theme button[class*="rounded-xl"][class*="p-3"]:active:not(:disabled) {
  transform: scale(0.90);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Label elements acting as buttons (file inputs) */
.cockpit-theme label[class*="cursor-pointer"]:active {
  transform: scale(0.92);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar navigation items (links that look like buttons) */
.sidebar-nav-item:active {
  transform: scale(0.92);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme toggle - satisfying click */
.theme-toggle-small:active,
.theme-toggle-ios-mobile:active {
  transform: scale(0.92);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dropdown trigger buttons */
.cockpit-theme button[data-action*="dropdown"]:active:not(:disabled),
.cockpit-theme button[data-action*="toggle"]:active:not(:disabled) {
  transform: scale(0.95);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ripple effect keyframes */
@keyframes btn-ripple {
  0% {
    transform: scale(0);
    opacity: 0.6;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Bounce back after click */
@keyframes btn-bounce-back {
  0% {
    transform: scale(0.96);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* Apply bounce-back on focus after click */
.cockpit-theme button:focus:not(:active):not(:disabled),
.cockpit-theme [type="submit"]:focus:not(:active):not(:disabled) {
  animation: btn-bounce-back 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Hover lift effect for colored buttons */
.cockpit-theme button[class*="bg-orange"]:hover:not(:disabled),
.cockpit-theme button[class*="bg-emerald"]:hover:not(:disabled),
.cockpit-theme button[class*="bg-green"]:hover:not(:disabled),
.cockpit-theme button[class*="bg-teal"]:hover:not(:disabled),
.cockpit-theme button[class*="bg-blue"]:hover:not(:disabled),
.cockpit-theme button[class*="from-orange"]:hover:not(:disabled),
.cockpit-theme button[class*="from-blue"]:hover:not(:disabled),
.cockpit-theme button[class*="from-emerald"]:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* Keep subtle hover effects for cockpit-btn */
.cockpit-btn--primary:hover,
.cockpit-btn--success:hover,
.cockpit-btn--danger:hover {
  filter: brightness(1.05);
}

/* ============================================
   FOCUS STATES (Accessibility)
   ============================================ */
.cockpit-theme button:focus-visible,
.cockpit-theme a:focus-visible,
.cockpit-theme [role="button"]:focus-visible {
  outline: 2px solid var(--cockpit-accent);
  outline-offset: 2px;
}

/* ============================================
   MICRO-ANIMATIONS
   ============================================ */

/* Message slide-in animation */
@keyframes message-slide-in {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  60% {
    opacity: 1;
    transform: translateY(-3px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-message-in {
  animation: message-slide-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* New message highlight pulse */
@keyframes message-highlight {
  0% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(249, 115, 22, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
  }
}

.animate-message-new {
  animation: message-slide-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             message-highlight 0.6s ease-out 0.2s;
}

/* Bounce animation for new ticket */
@keyframes ticket-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  15% {
    transform: translateY(-12px);
  }
  30% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-6px);
  }
  60% {
    transform: translateY(0);
  }
  75% {
    transform: translateY(-2px);
  }
}

.animate-ticket-bounce {
  animation: ticket-bounce 0.8s cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
}

/* Ticket pop-in animation */
@keyframes ticket-pop-in {
  0% {
    opacity: 0;
    transform: scale(0.8) translateX(-20px);
  }
  50% {
    opacity: 1;
    transform: scale(1.05) translateX(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
}

.animate-ticket-new {
  animation: ticket-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             ticket-bounce 0.8s cubic-bezier(0.36, 0, 0.66, -0.56) 0.4s;
}

/* Success checkmark animation */
@keyframes checkmark-draw {
  0% {
    stroke-dashoffset: 24;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.animate-checkmark {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: checkmark-draw 0.4s ease-out forwards;
}

/* Fade in up */
@keyframes fade-in-up {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fade-in-up 0.3s ease-out forwards;
}

/* Fade in scale */
@keyframes fade-in-scale {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in-scale {
  animation: fade-in-scale 0.25s ease-out forwards;
}

/* Shake animation for errors */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

/* Badge pulse for notifications */
@keyframes badge-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.5);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(249, 115, 22, 0);
  }
}

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

/* Typing indicator dots */
@keyframes typing-dot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  background: var(--cockpit-bg-elevated);
  border-radius: 16px;
}

.typing-indicator .dot {
  width: 6px;
  height: 6px;
  background: var(--cockpit-text-muted);
  border-radius: 50%;
  animation: typing-dot 1.4s ease-in-out infinite;
}

.typing-indicator .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* ============================================
   GLASSMORPHISM EFFECTS
   ============================================ */

.glass-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-card-light {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Modal glassmorphism */
.glass-modal {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

html:not(.dark) .glass-modal {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Glass backdrop for modals */
.glass-backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ============================================
   CONTEXTUAL CHANNEL COLORS
   ============================================ */

/* Telegram theme */
.channel-context-telegram {
  --channel-primary: #2aabee;
  --channel-primary-muted: rgba(42, 171, 238, 0.15);
  --channel-primary-glow: rgba(42, 171, 238, 0.3);
  --channel-gradient: linear-gradient(135deg, #2aabee 0%, #229ed9 100%);
}

.channel-context-telegram .cockpit-gauge--open,
.channel-context-telegram .kpi-card:first-child {
  --gauge-color: var(--channel-primary);
  --gauge-bg: var(--channel-primary-muted);
}

.channel-context-telegram .message-bubble-client {
  background: var(--channel-gradient) !important;
}

/* Viber theme */
.channel-context-viber {
  --channel-primary: #7360f2;
  --channel-primary-muted: rgba(115, 96, 242, 0.15);
  --channel-primary-glow: rgba(115, 96, 242, 0.3);
  --channel-gradient: linear-gradient(135deg, #7360f2 0%, #665ae0 100%);
}

.channel-context-viber .cockpit-gauge--open,
.channel-context-viber .kpi-card:first-child {
  --gauge-color: var(--channel-primary);
  --gauge-bg: var(--channel-primary-muted);
}

.channel-context-viber .message-bubble-client {
  background: var(--channel-gradient) !important;
}

/* WhatsApp theme */
.channel-context-whatsapp {
  --channel-primary: #25d366;
  --channel-primary-muted: rgba(37, 211, 102, 0.15);
  --channel-primary-glow: rgba(37, 211, 102, 0.3);
  --channel-gradient: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
}

.channel-context-whatsapp .cockpit-gauge--open,
.channel-context-whatsapp .kpi-card:first-child {
  --gauge-color: var(--channel-primary);
  --gauge-bg: var(--channel-primary-muted);
}

.channel-context-whatsapp .message-bubble-client {
  background: var(--channel-gradient) !important;
}

/* Web theme (default/neutral) */
.channel-context-web {
  --channel-primary: #3b82f6;
  --channel-primary-muted: rgba(59, 130, 246, 0.15);
  --channel-primary-glow: rgba(59, 130, 246, 0.3);
  --channel-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* Channel header accent line */
.channel-accent-line {
  height: 3px;
  background: var(--channel-gradient, linear-gradient(135deg, var(--cockpit-accent) 0%, #ea580c 100%));
  border-radius: 0 0 3px 3px;
}

/* Channel glow effect on conversation header */
.channel-header-glow {
  position: relative;
}

.channel-header-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: radial-gradient(ellipse at top, var(--channel-primary-glow, rgba(249, 115, 22, 0.1)) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   CONFETTI EFFECT (CSS-only simple version)
   ============================================ */

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

@keyframes confetti-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(15px); }
  75% { transform: translateX(-15px); }
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confetti-fall 3s ease-in-out forwards,
             confetti-shake 0.5s ease-in-out infinite;
}

.confetti-piece:nth-child(odd) {
  border-radius: 50%;
}

.confetti-piece:nth-child(1) { left: 10%; background: #f97316; animation-delay: 0s; }
.confetti-piece:nth-child(2) { left: 20%; background: #22c55e; animation-delay: 0.1s; }
.confetti-piece:nth-child(3) { left: 30%; background: #3b82f6; animation-delay: 0.2s; }
.confetti-piece:nth-child(4) { left: 40%; background: #eab308; animation-delay: 0.15s; }
.confetti-piece:nth-child(5) { left: 50%; background: #8b5cf6; animation-delay: 0.25s; }
.confetti-piece:nth-child(6) { left: 60%; background: #ef4444; animation-delay: 0.05s; }
.confetti-piece:nth-child(7) { left: 70%; background: #06b6d4; animation-delay: 0.3s; }
.confetti-piece:nth-child(8) { left: 80%; background: #f97316; animation-delay: 0.12s; }
.confetti-piece:nth-child(9) { left: 90%; background: #22c55e; animation-delay: 0.22s; }
.confetti-piece:nth-child(10) { left: 15%; background: #ec4899; animation-delay: 0.18s; }
.confetti-piece:nth-child(11) { left: 25%; background: #14b8a6; animation-delay: 0.08s; }
.confetti-piece:nth-child(12) { left: 35%; background: #f59e0b; animation-delay: 0.28s; }
.confetti-piece:nth-child(13) { left: 45%; background: #6366f1; animation-delay: 0.13s; }
.confetti-piece:nth-child(14) { left: 55%; background: #10b981; animation-delay: 0.23s; }
.confetti-piece:nth-child(15) { left: 65%; background: #f43f5e; animation-delay: 0.03s; }
.confetti-piece:nth-child(16) { left: 75%; background: #0ea5e9; animation-delay: 0.33s; }
.confetti-piece:nth-child(17) { left: 85%; background: #a855f7; animation-delay: 0.17s; }
.confetti-piece:nth-child(18) { left: 95%; background: #84cc16; animation-delay: 0.27s; }
.confetti-piece:nth-child(19) { left: 5%; background: #fb923c; animation-delay: 0.07s; }
.confetti-piece:nth-child(20) { left: 50%; background: #2dd4bf; animation-delay: 0.35s; }

/* ============================================
   SKELETON LOADING STATES
   ============================================ */

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--cockpit-bg-elevated) 0%,
    var(--cockpit-bg-panel) 20%,
    var(--cockpit-bg-elevated) 40%,
    var(--cockpit-bg-elevated) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

html:not(.dark) .skeleton {
  background: linear-gradient(
    90deg,
    #e2e8f0 0%,
    #f1f5f9 20%,
    #e2e8f0 40%,
    #e2e8f0 100%
  );
  background-size: 200% 100%;
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
}

.skeleton-text-sm {
  height: 10px;
  border-radius: 3px;
}

.skeleton-text-lg {
  height: 20px;
  border-radius: 5px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.skeleton-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.skeleton-avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.skeleton-button {
  height: 40px;
  border-radius: 10px;
}

.skeleton-card {
  border-radius: 16px;
  padding: 20px;
}

/* Skeleton message bubble */
.skeleton-message {
  display: flex;
  gap: 12px;
  padding: 12px 0;
}

.skeleton-message-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Skeleton conversation row */
.skeleton-conversation-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--cockpit-border);
}

.skeleton-conversation-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================
   ORDER SUMMARY - Professional Invoice Style
   ============================================ */
.order-summary-pro {
  margin: 12px 0;
  background: var(--cockpit-bg-card);
  border-radius: 8px;
  border: 1px solid var(--cockpit-border);
  overflow: hidden;
  max-width: 380px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.order-summary-pro .osc-pro-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--cockpit-border);
  background: var(--cockpit-bg-panel);
}

.order-summary-pro .osc-pro-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-summary-pro .osc-pro-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--cockpit-accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 4px;
}

.order-summary-pro .osc-pro-body {
  padding: 16px 20px;
}

/* Professional table styling */
.order-summary-pro .osc-pro-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.order-summary-pro .osc-pro-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cockpit-text-muted);
  padding: 0 0 8px 0;
  border-bottom: 1px solid var(--cockpit-border);
}

.order-summary-pro .osc-th-num {
  width: 28px;
}

.order-summary-pro .osc-item-row td {
  padding: 10px 0;
  border-bottom: 1px dashed var(--cockpit-border-light);
  font-size: 14px;
  color: var(--cockpit-text-primary);
}

.order-summary-pro .osc-item-row:last-child td {
  border-bottom: none;
}

.order-summary-pro .osc-item-num {
  color: var(--cockpit-text-muted);
  font-size: 12px;
  font-weight: 500;
}

.order-summary-pro .osc-item-name {
  font-weight: 500;
}

/* Total section */
.order-summary-pro .osc-pro-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 6px;
  margin-top: 8px;
}

.order-summary-pro .osc-pro-total-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.order-summary-pro .osc-pro-total-value {
  font-size: 22px;
  font-weight: 700;
  color: #22c55e;
  letter-spacing: -0.5px;
}

/* Footer sections */
.order-summary-pro .osc-pro-footer {
  padding: 16px 20px;
  background: var(--cockpit-bg-panel);
  border-top: 1px solid var(--cockpit-border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.order-summary-pro .osc-pro-section {
  min-width: 0;
}

.order-summary-pro .osc-pro-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cockpit-text-muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--cockpit-border-light);
}

.order-summary-pro .osc-pro-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-summary-pro .osc-pro-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.order-summary-pro .osc-pro-label {
  font-size: 10px;
  color: var(--cockpit-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.order-summary-pro .osc-pro-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--cockpit-text-primary);
  word-break: break-word;
}

.order-summary-pro .osc-pro-phone {
  font-family: 'SF Mono', 'Roboto Mono', monospace;
  letter-spacing: 0.5px;
}

.osc-pro-after-text {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--cockpit-text-secondary);
}

/* ============================================
   ORDER SUMMARY - Minimal Compact Style
   ============================================ */
.osc-mini {
  margin: 8px 0;
  padding: 10px 12px;
  background: var(--cockpit-bg-card);
  border-radius: 8px;
  border: 1px solid var(--cockpit-border);
  max-width: 280px;
  font-size: 13px;
}

.osc-mini-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--cockpit-accent);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--cockpit-border-light);
}

.osc-mini-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.osc-mini-item {
  font-size: 13px;
  color: var(--cockpit-text-primary);
  line-height: 1.3;
}

.osc-mini-num {
  color: var(--cockpit-text-muted);
  font-weight: 500;
  margin-right: 4px;
}

.osc-mini-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.osc-mini-total strong {
  font-size: 16px;
  font-weight: 700;
  color: #22c55e;
}

.osc-mini-after {
  margin-top: 8px;
  font-size: 13px;
  color: var(--cockpit-text-secondary);
}

/* ============================================
   INVOICE CARD V2 - Professional Redesign
   ============================================ */
.invoice-wrapper {
  display: inline-block;
  max-width: 100%;
}

/* Base card - V2 version */
.inv.inv--v2 {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  min-width: 220px;
  max-width: 280px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header with badge */
.inv--v2 .inv-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.inv--v2 .inv-num {
  font-weight: 700;
  font-size: 14px;
  color: #f1f5f9;
}

.inv--v2 .inv-date {
  font-size: 11px;
  color: #64748b;
  flex: 1;
}

/* Status badges */
.inv-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.inv-badge--amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.inv-badge--blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.inv-badge--purple {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.inv-badge--green {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.inv-badge--gray {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Body - rows layout */
.inv--v2 .inv-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.inv-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.inv-value {
  font-size: 12px;
  color: #e2e8f0;
  text-align: right;
  word-break: break-word;
}

.inv-value--highlight {
  font-size: 16px;
  font-weight: 700;
  color: #4ade80;
}

.inv-value--muted {
  color: #64748b;
  font-style: italic;
}

/* Next step hint */
.inv-hint {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #334155;
  font-size: 11px;
  color: #94a3b8;
}

/* Expandable details for products */
.inv-details {
  text-align: right;
}

.inv-details summary {
  cursor: pointer;
  font-size: 12px;
  color: #60a5fa;
  list-style: none;
}

.inv-details summary::-webkit-details-marker {
  display: none;
}

.inv-details summary::after {
  content: " ▸";
  font-size: 10px;
}

.inv-details[open] summary::after {
  content: " ▾";
}

.inv-details-content {
  margin-top: 4px;
  padding: 6px 8px;
  background: #1e293b;
  border-radius: 4px;
  font-size: 11px;
  color: #cbd5e1;
  text-align: left;
  line-height: 1.4;
}

/* Client message - collapsed by default */
.inv-client-msg {
  margin-top: 8px;
  border-top: 1px solid #334155;
}

.inv-client-msg summary {
  padding: 8px 12px;
  font-size: 11px;
  color: #64748b;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.inv-client-msg summary::-webkit-details-marker {
  display: none;
}

.inv-client-msg summary::before {
  content: "▸";
  font-size: 10px;
  transition: transform 0.15s ease;
}

.inv-client-msg[open] summary::before {
  transform: rotate(90deg);
}

.inv-client-msg-content {
  padding: 0 12px 10px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

/* Legacy styles - keep for backward compatibility */
.inv:not(.inv--v2) {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  min-width: 220px;
  max-width: 280px;
}

.inv:not(.inv--v2) .inv-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.inv:not(.inv--v2) .inv-num {
  font-weight: 700;
  font-size: 13px;
}

.inv:not(.inv--v2) .inv-date {
  font-size: 10px;
  opacity: 0.85;
}

.inv:not(.inv--v2) .inv-body {
  padding: 8px 10px;
}

.inv-product {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.inv-info {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.3;
  margin-bottom: 6px;
}

.inv-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid #334155;
}

.inv-pay {
  font-size: 10px;
  color: #64748b;
}

.inv-sum {
  font-size: 15px;
  font-weight: 700;
  color: #4ade80;
}

.invoice-after {
  margin-top: 8px;
  font-size: 12px;
  color: var(--cockpit-text-secondary);
}

/* Invoice Card - Calculator items display */
.inv--invoice {
  min-width: 280px;
  max-width: 340px;
}

.inv-section-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.inv-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inv-item {
  padding: 6px 8px;
  background: #1e293b;
  border-radius: 4px;
  border-left: 2px solid #3b82f6;
}

.inv-item-name {
  font-size: 12px;
  font-weight: 500;
  color: #e2e8f0;
  margin-bottom: 2px;
}

.inv-item-detail {
  font-size: 11px;
  color: #94a3b8;
}

.inv-item-cost {
  font-size: 10px;
  color: #64748b;
  font-style: italic;
  margin-top: 2px;
}

.inv-divider {
  height: 1px;
  background: #334155;
  margin: 8px 0;
}

.inv-value--profit {
  font-size: 13px;
  font-weight: 600;
  color: #fbbf24;
}

/* Legacy card - keep for backward compatibility */
.order-summary-card {
  margin: 8px 0;
  background: linear-gradient(145deg, var(--cockpit-bg-card) 0%, var(--cockpit-bg-panel) 100%);
  border-radius: 12px;
  border: 1px solid var(--cockpit-border);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  max-width: 340px;
}

.order-summary-card .osc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--cockpit-accent) 0%, #ea580c 100%);
  color: white;
}

.order-summary-card .osc-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.order-summary-card .osc-icon svg {
  stroke: white;
}

.order-summary-card .osc-title {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
  flex: 1;
}

.order-summary-card .osc-price {
  font-size: 18px;
  font-weight: 700;
  text-align: right;
}

.order-summary-card .osc-price small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.9;
  margin-left: 2px;
}

.order-summary-card .osc-body {
  padding: 14px;
}

.order-summary-card .osc-section {
  margin-bottom: 0;
}

.order-summary-card .osc-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cockpit-text-muted);
  margin-bottom: 6px;
}

.order-summary-card .osc-parts {
  font-size: 13px;
  color: var(--cockpit-text-primary);
  line-height: 1.5;
}

.order-summary-card .osc-part {
  padding: 4px 0;
  border-bottom: 1px solid var(--cockpit-border-light);
}

.order-summary-card .osc-part:last-child {
  border-bottom: none;
}

.order-summary-card .osc-divider {
  height: 1px;
  background: var(--cockpit-border);
  margin: 12px 0;
}

.order-summary-card .osc-delivery {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-summary-card .osc-delivery-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--cockpit-text-secondary);
}

.order-summary-card .osc-delivery-row svg {
  flex-shrink: 0;
  stroke: var(--cockpit-accent);
  opacity: 0.8;
}

.order-summary-card .osc-delivery-row span {
  color: var(--cockpit-text-primary);
}

.osc-after-text {
  margin-top: 10px;
  font-size: 13px;
  color: var(--cockpit-text-secondary);
}

/* Legacy compact card (for backward compatibility) */
.order-summary-card-compact {
  margin: 4px 0;
  background: var(--cockpit-bg-panel);
  border-radius: 8px;
  border: 1px solid var(--cockpit-border);
  overflow: hidden;
}

.order-summary-card-compact .osc-header {
  padding: 6px 10px;
  background: var(--cockpit-accent);
  color: white;
  font-weight: 600;
  font-size: 11px;
}

.order-summary-card-compact .osc-body {
  padding: 8px 10px;
}

.order-summary-card-compact .osc-product {
  font-size: 12px;
  color: var(--cockpit-text-primary);
  margin-bottom: 4px;
}

.order-summary-card-compact .osc-product b {
  color: var(--cockpit-accent);
  font-weight: 600;
}

.order-summary-card-compact .osc-delivery {
  font-size: 11px;
  color: var(--cockpit-text-secondary);
  line-height: 1.4;
}

/* ============================================
   TICKETS TABLE - STABLE LAYOUT
   No animations to prevent visual jumping
   ============================================ */
.tickets-table-container {
  -webkit-tap-highlight-color: transparent;
}

/* Allow text selection only inside input fields */
.ticket-group input,
.ticket-group textarea {
  user-select: text;
  -webkit-user-select: text;
}

/* ============================================
   COLUMN RESIZE HANDLES
   ============================================ */
.column-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  cursor: col-resize;
  background: transparent;
  transition: background-color 0.15s ease;
  z-index: 20;
}

.column-resize-handle:hover,
.column-resize-handle:active {
  background-color: var(--cockpit-accent);
}

/* Prevent text selection while resizing */
.tickets-table-container.resizing {
  user-select: none;
  -webkit-user-select: none;
}

/* Prevent cell content overflow during resize */
.tickets-table-container td {
  overflow: hidden;
  box-sizing: border-box;
}

.tickets-table-container .inline-edit-cell {
  max-width: 100%;
  overflow: hidden;
}

/* Focused state (single click) - shows selection, arrow keys navigate cells */
.tickets-table-container .inline-edit-cell.is-focused [data-inline-edit-target="display"] {
  outline: 2px solid #3B82F6;
  outline-offset: -1px;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Dark mode focused state */
@media (prefers-color-scheme: dark) {
  .tickets-table-container .inline-edit-cell.is-focused [data-inline-edit-target="display"] {
    outline-color: #60A5FA;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3);
  }
}

/* ============================================
   CELL MARK CONTEXT MENU
   ============================================ */
.cell-mark-menu {
  position: fixed;
  z-index: 99999;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 4px;
  min-width: 160px;
}

@media (prefers-color-scheme: dark) {
  .cell-mark-menu {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  }
}

.cell-mark-menu.hidden {
  display: none;
}

.cell-mark-menu-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cell-mark-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
  text-align: left;
  width: 100%;
  transition: background-color 0.15s ease;
}

@media (prefers-color-scheme: dark) {
  .cell-mark-option {
    color: #e2e8f0;
  }
}

.cell-mark-option:hover {
  background: #f1f5f9;
}

@media (prefers-color-scheme: dark) {
  .cell-mark-option:hover {
    background: #334155;
  }
}

.cell-mark-option.is-active {
  background: #e0f2fe;
}

@media (prefers-color-scheme: dark) {
  .cell-mark-option.is-active {
    background: #0c4a6e;
  }
}

.cell-mark-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cell-mark-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 8px;
}

@media (prefers-color-scheme: dark) {
  .cell-mark-divider {
    background: #475569;
  }
}

/* ============================================
   ROW DRAG & DROP
   ============================================ */
.drag-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease;
  z-index: 5;
}

.ticket-group:hover .drag-handle {
  opacity: 1;
}

.drag-handle:hover {
  background-color: rgba(249, 115, 22, 0.1);
}

.drag-handle:active {
  cursor: grabbing;
}

/* Dragging state */
.ticket-group.dragging {
  opacity: 0.5;
  background-color: rgba(249, 115, 22, 0.1) !important;
}

/* Drop target indicator */
.ticket-group.drop-target {
  border-top: 2px solid var(--cockpit-accent) !important;
}

/* Placeholder while dragging */
.drag-placeholder {
  background-color: var(--cockpit-bg-elevated);
  border: 2px dashed var(--cockpit-border);
}

/* Light mode adjustments */
@media (prefers-color-scheme: light) {
  .drag-handle:hover {
    background-color: rgba(249, 115, 22, 0.15);
  }

  .ticket-group.dragging {
    background-color: rgba(249, 115, 22, 0.1) !important;
  }
}

/* ========================================
   Price List Calculator Styles
   ======================================== */

.price-list-header {
  display: grid;
  grid-template-columns: 1fr 120px 120px 40px;
  gap: 8px;
  padding: 8px 12px;
  background: var(--cockpit-bg-elevated, #f1f5f9);
  border-radius: 10px;
  margin-bottom: 8px;
}

.dark .price-list-header {
  background: rgba(51, 65, 85, 0.5);
}

.price-list-header span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cockpit-text-muted, #94a3b8);
}

.price-list-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.price-list-item {
  display: grid;
  grid-template-columns: 1fr 120px 120px 40px;
  gap: 8px;
  align-items: center;
}

.price-list-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--cockpit-border, #e2e8f0);
  background: white;
  font-size: 14px;
  color: var(--cockpit-text-primary, #1e293b);
  transition: all 0.15s ease;
}

.dark .price-list-input {
  background: rgba(51, 65, 85, 0.5);
  border-color: rgba(71, 85, 105, 0.5);
  color: #f1f5f9;
}

.price-list-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.price-list-input::placeholder {
  color: var(--cockpit-text-muted, #94a3b8);
}

.price-list-cost {
  text-align: right;
}

.price-list-price {
  font-weight: 600;
  color: var(--cockpit-text-primary, #1e293b);
  text-align: right;
  padding-right: 4px;
}

.dark .price-list-price {
  color: #f1f5f9;
}

.price-list-remove {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--cockpit-text-muted, #94a3b8);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.price-list-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Price List v2 - with markup column */
.price-list-header-v2 {
  display: grid;
  grid-template-columns: 1fr 100px 100px 80px 40px;
  gap: 8px;
  padding: 8px 12px;
  background: var(--cockpit-bg-elevated, #f1f5f9);
  border-radius: 10px;
  margin-bottom: 8px;
}

.dark .price-list-header-v2 {
  background: rgba(51, 65, 85, 0.5);
}

.price-list-header-v2 span {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.price-list-item-v2 {
  display: grid;
  grid-template-columns: 1fr 100px 100px 80px 40px;
  gap: 8px;
  align-items: center;
}

.price-list-input-name {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--cockpit-border, #e2e8f0);
  background: white;
  font-size: 14px;
  color: var(--cockpit-text-primary, #1e293b);
  transition: all 0.15s ease;
}

.dark .price-list-input-name {
  background: rgba(51, 65, 85, 0.5);
  border-color: rgba(71, 85, 105, 0.5);
  color: #f1f5f9;
}

.price-list-input-name:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.price-list-input-name::placeholder {
  color: var(--cockpit-text-muted, #94a3b8);
}

.price-list-input-cost {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  font-size: 14px;
  color: #1d4ed8;
  text-align: right;
  transition: all 0.15s ease;
}

.dark .price-list-input-cost {
  background: rgba(30, 58, 138, 0.3);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.price-list-input-cost:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.price-list-input-cost::placeholder {
  color: #93c5fd;
}

.price-list-price-value {
  font-weight: 700;
  color: #059669;
  text-align: right;
  padding: 8px 4px;
  background: #ecfdf5;
  border-radius: 8px;
  font-size: 14px;
}

.dark .price-list-price-value {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.price-list-markup-value {
  font-weight: 600;
  color: #d97706;
  text-align: center;
  padding: 6px 4px;
  font-size: 13px;
}

.dark .price-list-markup-value {
  color: #fbbf24;
}

.price-list-remove-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--cockpit-text-muted, #94a3b8);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.price-list-remove-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Toast animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.2s ease-out;
}

/* ========================================
   AI Assistant Modal Styles
   ======================================== */

.ai-assistant-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-assistant-example {
  padding: 6px 12px;
  border-radius: 9999px;
  background: var(--cockpit-bg-elevated, #f1f5f9);
  border: 1px solid var(--cockpit-border, #e2e8f0);
  font-size: 12px;
  color: var(--cockpit-text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dark .ai-assistant-example {
  background: rgba(51, 65, 85, 0.5);
  border-color: rgba(71, 85, 105, 0.5);
  color: #94a3b8;
}

.ai-assistant-example:hover {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}
