/* Premium Glassmorphic Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --theme-primary: #115335; /* Dark Forest Green from 3M logo */
  --theme-primary-hover: #0a3d25;
  --theme-primary-glow: rgba(17, 83, 53, 0.12);
  --theme-success: #10b981; /* Emerald */
  --theme-success-hover: #059669;
  --theme-warning: #f59e0b; /* Amber */
  --theme-warning-hover: #d97706;
  --theme-danger: #ef4444; /* Rose */
  --theme-danger-hover: #dc2626;
  
  --neutral-primary: #0f172a; /* Slate 900 */
  --neutral-secondary: #475569; /* Slate 600 */
  --neutral-light: #cbd5e1; /* Slate 300 */
  --neutral-lighter: #f1f5f9; /* Slate 100 */
  --white: #ffffff;
  --page-background: #f8fafc; /* Slate 50 */
  
  --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05), 0 0 0 1px rgb(15 23 42 / 0.05);
  --card-hover-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1), 0 0 0 1px rgb(17 83 53 / 0.15);
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --sidebar-width: 260px;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: var(--font-family);
  background-color: var(--page-background);
  color: var(--neutral-primary);
}

/* Layout Shell */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--white);
  border-right: 1px solid var(--neutral-lighter);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
  z-index: 10;
  transition: width 0.2s ease;
  overflow: hidden;
  flex-shrink: 0;
}

/* Collapsed Sidebar CSS */
.sidebar.collapsed {
  width: 72px;
}

.sidebar.collapsed .logo-text {
  display: none !important;
}

.sidebar.collapsed .logo-container img {
  margin-right: 0 !important;
}

.sidebar.collapsed .sidebar-header {
  padding: 0 10px;
  justify-content: center !important;
}

.sidebar.collapsed #collapseSidebarBtn {
  margin-left: 0 !important;
  margin-top: 5px;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 12px 0;
}

.sidebar.collapsed .nav-link i {
  margin-right: 0 !important;
  font-size: 20px;
}

.sidebar.collapsed .nav-text {
  display: none !important;
}

.sidebar-header {
  height: 76px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  font-weight: 700;
  font-size: 18px;
  color: var(--theme-primary);
  border-bottom: 1px solid var(--neutral-lighter);
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--neutral-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: all 0.2s ease-in-out;
}

.nav-link i {
  font-size: 18px;
  margin-right: 12px;
}

.nav-link:hover {
  background-color: var(--neutral-lighter);
  color: var(--neutral-primary);
  transform: translateX(4px);
}

.nav-link.active {
  background-color: var(--theme-primary);
  color: var(--white);
  box-shadow: 0 4px 12px var(--theme-primary-glow);
}

.nav-link.active:hover {
  color: var(--white);
  transform: none;
}

.main-content {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.top-bar {
  height: 64px;
  background-color: var(--white);
  color: var(--neutral-primary);
  border-bottom: 1px solid var(--neutral-lighter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  flex-shrink: 0;
}

.top-bar-title {
  font-weight: 700;
  font-size: 20px;
}

.user-profile {
  font-size: 14px;
  cursor: pointer;
}

.top-bar .dropdown-toggle::after {
  display: none;
}

.content-wrapper {
  padding: 0;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

/* Cards & UI Elements */
.content-card {
  background-color: var(--white);
  box-shadow: var(--card-shadow);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 28px;
  transition: box-shadow 0.25s ease;
}

.content-card:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.page-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--neutral-primary);
  letter-spacing: -0.5px;
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 10px 24px;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--theme-primary);
  color: var(--white);
  box-shadow: 0 4px 12px var(--theme-primary-glow);
}

.btn-primary:hover {
  background-color: var(--theme-primary-hover);
  box-shadow: 0 6px 16px rgba(17, 83, 53, 0.25);
  color: var(--white);
}

.btn-secondary {
  background-color: var(--white);
  border-color: var(--neutral-light);
  color: var(--neutral-secondary);
}

.btn-secondary:hover {
  background-color: var(--neutral-lighter);
  color: var(--neutral-primary);
}

.btn-success {
  background-color: var(--theme-success);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.btn-success:hover {
  background-color: var(--theme-success-hover);
}

.btn-danger {
  background-color: var(--theme-danger);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

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

.btn-warning {
  background-color: var(--theme-warning);
  color: var(--neutral-primary);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.btn-warning:hover {
  background-color: var(--theme-warning-hover);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--neutral-secondary);
  padding: 16px 20px;
  border-bottom: 2px solid var(--neutral-lighter);
}

.table td {
  padding: 16px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--neutral-lighter);
}

.table tr:hover {
  background-color: var(--neutral-lighter);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9999px;
}

.bg-success {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
}

.bg-secondary {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
}

.bg-primary {
  background-color: #e0e7ff !important;
  color: #3730a3 !important;
}

.bg-warning {
  background-color: #fef3c7 !important;
  color: #92400e !important;
}

.bg-danger {
  background-color: #fee2e2 !important;
  color: #991b1b !important;
}

/* File Upload Styles */
.file-drop-zone {
  border: 2px dashed var(--neutral-light);
  border-radius: 8px;
  padding: 36px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background-color: var(--white);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: var(--theme-primary);
  background-color: var(--theme-lighter);
}

.file-drop-zone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-preview-container {
  margin-top: 12px;
  text-align: center;
}

.file-preview {
  max-width: 100%;
  max-height: 220px;
  display: none;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  margin-top: 8px;
}

.drop-zone-text {
  font-size: 14px;
  color: var(--neutral-secondary);
  pointer-events: none;
}

.drop-zone-icon {
  font-size: 32px;
  color: var(--theme-primary);
  margin-bottom: 8px;
  pointer-events: none;
}

/* Footer */
.footer {
  background-color: var(--white);
  border-top: 1px solid var(--neutral-lighter);
  padding: 12px 0;
  margin-top: auto;
}

/* Fancy Card Hover effects */
.card-hover-effect {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.card-hover-effect::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%);
  opacity: 0.8;
  pointer-events: none;
}

.card-hover-effect:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -6px rgba(0, 0, 0, 0.08);
}

.card-hover-effect .card-body {
  border-radius: 12px;
  padding: 24px;
  position: relative;
  z-index: 2;
}

/* Translucent Circle Icon container */
.card-icon-container {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.25);
  margin-bottom: 16px;
  font-size: 20px;
}

/* HSL-Tailored Stats Card Gradients */
.gradient-indigo-blue {
  background: linear-gradient(135deg, #115335 0%, #198754 100%) !important;
}
.gradient-emerald-teal {
  background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%) !important;
}
.gradient-slate-charcoal {
  background: linear-gradient(135deg, #64748b 0%, #334155 100%) !important;
}
.gradient-coral-rose {
  background: linear-gradient(135deg, #f97316 0%, #f43f5e 100%) !important;
}

/* Kanban Board Styling */
.kanban-board {
  display: flex;
  gap: 24px;
  padding: 8px 0;
  overflow-x: auto;
  min-height: calc(100vh - 250px);
}

.kanban-column {
  flex: 1;
  min-width: 320px;
  max-width: 400px;
  background-color: #f1f5f9; /* Slate 100 background for columns */
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(15, 23, 42, 0.05);
  transition: background-color 0.2s ease;
}

.kanban-column.drag-over {
  background-color: #e2e8f0; /* Slate 200 highlighting */
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.kanban-column-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--neutral-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-card-count {
  background-color: var(--white);
  color: var(--neutral-secondary);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.kanban-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  padding: 2px;
  min-height: 150px;
}

/* Kanban Card */
.kanban-card {
  background-color: var(--white);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.04);
  cursor: grab;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.kanban-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
  border-color: rgba(17, 83, 53, 0.2);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.4;
  transform: scale(0.95);
  border: 2px dashed var(--theme-primary);
}

.kanban-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.kanban-card-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--theme-primary);
  background-color: var(--theme-lighter);
  padding: 2px 8px;
  border-radius: 4px;
}

.kanban-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-primary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--neutral-lighter);
  padding-top: 12px;
  font-size: 11px;
  color: var(--neutral-secondary);
}

.kanban-card-assignees {
  display: flex;
  align-items: center;
}

.kanban-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--theme-primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
  border: 2px solid var(--white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Translucent Drop Overlay Preview */
.kanban-drop-preview {
  border: 2px dashed var(--theme-primary);
  background-color: var(--theme-lighter);
  border-radius: 12px;
  height: 80px;
  opacity: 0.6;
}

/* Live Chat Styling */
.chat-dock-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  z-index: 1000;
  pointer-events: none; /* Let clicks pass through gaps */
}

.chat-dock-container > * {
  pointer-events: auto; /* Re-enable clicks on widgets */
}

.chat-launcher {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--theme-primary);
  color: var(--white) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(17, 83, 53, 0.4);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
}

.chat-launcher:hover {
  transform: scale(1.08) translateY(-2px);
  background-color: var(--theme-primary-hover);
}

.chat-launcher i {
  font-size: 24px;
}

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Chat admin directory panel */
.chat-admin-panel {
  width: 320px;
  height: 460px;
  background-color: var(--white);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--neutral-lighter);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: bottom right;
}

.chat-admin-panel.collapsed {
  display: none !important;
}

.chat-panel-header {
  background-color: var(--theme-primary);
  color: var(--white);
  padding: 14px 18px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* Chat Box element */
.chat-box {
  width: 300px;
  height: 380px;
  background-color: var(--white);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--neutral-lighter);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: height 0.2s ease-in-out, width 0.2s ease-in-out;
}

.chat-box.minimized {
  height: 48px !important;
}

.chat-box.maximized {
  width: 440px;
  height: 520px;
}

.chat-box-header {
  background-color: var(--neutral-lighter);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  padding: 10px 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--neutral-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-box-header:hover {
  background-color: var(--neutral-light);
}

.chat-box-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-box-footer {
  padding: 8px;
  border-top: 1px solid var(--neutral-lighter);
  display: flex;
  gap: 6px;
}

.chat-bubble {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-bubble.incoming {
  background-color: var(--neutral-lighter);
  color: var(--neutral-primary);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-bubble.outgoing {
  background-color: var(--theme-primary);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chat-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.chat-user-item:hover {
  background-color: var(--neutral-lighter);
}

/* Responsive Mobile Layout Upgrades */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    bottom: 0;
    width: 260px;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
  }
  
  .sidebar.show {
    left: 0;
  }
  
  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  
  .sidebar-backdrop.show {
    display: block;
    opacity: 1;
  }
  
  .top-bar {
    padding: 0 16px;
  }
  
  .content-wrapper {
    padding: 0 !important;
  }

  /* Make horizontal layouts wrap on tablets/mobiles, preserve vertical columns */
  .d-flex:not(.flex-column) {
    flex-wrap: wrap !important;
  }
  
  .top-bar .d-flex {
    flex-wrap: nowrap !important;
  }
  
  /* Stack tables and w2ui grids */
  .content-card {
    padding: 16px;
    margin-bottom: 16px;
  }
}

@media (max-width: 575.98px) {
  .top-bar-title {
    font-size: 16px;
  }
  
  /* Hide text inside Get Mobile App button on very small screens */
  .top-bar .btn-outline-secondary span,
  .top-bar .btn-outline-secondary {
    padding: 6px 12px;
  }
}

/* Chat Emoji Picker Floating Panel */
.chat-emoji-picker {
  position: absolute;
  bottom: 48px;
  left: 10px;
  background-color: var(--white);
  border: 1px solid var(--neutral-light);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.15);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: 170px;
  z-index: 1050;
}

.chat-emoji-picker span {
  font-size: 18px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s ease;
  user-select: none;
}

.chat-emoji-picker span:hover {
  transform: scale(1.3);
}

/* ==========================================
   Header Live Time & Weather Widget (Premium Glassmorphism)
   ========================================== */
.header-premium-widget {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(17, 83, 53, 0.18);
  box-shadow: 0 4px 18px rgba(17, 83, 53, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  padding: 6px 18px;
  height: 42px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 550;
  color: var(--neutral-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-premium-widget:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 6px 22px rgba(17, 83, 53, 0.12);
  border-color: rgba(17, 83, 53, 0.35);
  background: rgba(255, 255, 255, 0.85);
}

.widget-section-time {
  display: flex;
  align-items: center;
  padding-right: 14px;
  border-right: 1.5px dashed rgba(17, 83, 53, 0.25);
}

.widget-section-time i {
  color: #115335;
  text-shadow: 0 0 8px rgba(17, 83, 53, 0.3);
  font-size: 14px;
}

#live-time-display {
  font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--neutral-primary);
}

.clock-colon {
  animation: flashColon 1s step-end infinite;
  color: #115335;
  font-weight: bold;
  padding: 0 1px;
}

@keyframes flashColon {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.clock-ampm {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  background: linear-gradient(135deg, #115335, #198754);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-left: 2px;
}

.widget-section-weather {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weather-badge-temp {
  font-weight: 700;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* Temperature Color States */
.weather-temp-hot {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff !important;
}

.weather-temp-moderate {
  background: linear-gradient(135deg, #10b981, #3b82f6);
  color: #ffffff !important;
}

.weather-temp-cool {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #ffffff !important;
}

/* Float & Spin animations for icons */
.weather-icon-animate-spin {
  animation: premiumSunSpin 15s linear infinite;
}

.weather-icon-animate-float {
  animation: premiumWeatherFloat 3s ease-in-out infinite;
}

@keyframes premiumSunSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes premiumWeatherFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Select2 Premium Theme Overrides */
.select2-container--default .select2-selection--single {
    height: 38px !important;
    padding: 5px 12px;
    font-size: 0.95rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #115335 !important;
    box-shadow: 0 0 0 0.25rem rgba(17, 83, 53, 0.25) !important;
    outline: 0;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #212529;
    padding-left: 0;
    padding-right: 0;
    line-height: 26px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    position: absolute;
    top: 1px;
    right: 8px;
    width: 20px;
}

.select2-dropdown {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 1060;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.9rem;
    outline: none;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #115335;
    box-shadow: 0 0 0 0.2rem rgba(17, 83, 53, 0.15);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #115335 !important;
    color: white;
}

.select2-container--default .select2-results__option {
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* ========================================================
   W2UI Modern Grid & Advanced Search Styling
   ======================================================== */
.w2ui-grid {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    font-family: inherit !important;
}

.w2ui-grid .w2ui-grid-toolbar {
    background-color: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 6px 10px !important;
}

.w2ui-grid .w2ui-grid-table th {
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 0.8125rem !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #cbd5e1 !important;
    padding: 8px 10px !important;
}

.w2ui-grid .w2ui-grid-table td {
    border-bottom: 1px solid #f1f5f9 !important;
    color: #1e293b !important;
    font-size: 0.85rem !important;
    padding: 7px 10px !important;
    vertical-align: middle !important;
}

.w2ui-grid .w2ui-grid-table tr:hover td {
    background-color: #f8fafc !important;
}

.w2ui-grid .w2ui-grid-footer {
    background-color: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    color: #64748b !important;
    font-size: 0.8125rem !important;
    padding: 6px 12px !important;
}

/* W2UI Advanced Search Overlay */
.w2ui-overlay {
    border-radius: 10px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    z-index: 10500 !important;
}

.w2ui-grid-search-advanced {
    padding: 14px 18px !important;
    background: #ffffff !important;
}

.w2ui-grid-search-advanced .search-title {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin-bottom: 12px !important;
}

.w2ui-grid-search-advanced td.caption {
    font-weight: 600 !important;
    color: #475569 !important;
    font-size: 0.85rem !important;
    padding: 5px 12px 5px 0 !important;
    text-align: right !important;
}

.w2ui-grid-search-advanced td.operator {
    padding: 5px 6px !important;
}

.w2ui-grid-search-advanced td.value {
    padding: 5px 0 !important;
}

.w2ui-grid-search-advanced select.w2ui-input,
.w2ui-grid-search-advanced input.w2ui-input {
    height: 30px !important;
    padding: 3px 8px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    font-size: 0.85rem !important;
    box-sizing: border-box !important;
}

.w2ui-grid-search-advanced select.w2ui-input:focus,
.w2ui-grid-search-advanced input.w2ui-input:focus {
    border-color: #2563eb !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

.w2ui-grid-search-advanced .search-bottom {
    padding-top: 14px !important;
    border-top: 1px solid #f1f5f9 !important;
    margin-top: 10px !important;
}

.w2ui-grid-search-advanced .w2ui-btn {
    border-radius: 6px !important;
    padding: 5px 14px !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
}

/* Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.775rem;
    font-weight: 600;
}
.status-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.badge-status-active, .badge-status-open {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}
.badge-status-active .status-pulse-dot, .badge-status-open .status-pulse-dot {
    background-color: #10b981;
}
.badge-status-inactive, .badge-status-closed {
    background-color: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.badge-status-inactive .status-pulse-dot, .badge-status-closed .status-pulse-dot {
    background-color: #94a3b8;
}
.badge-status-progress {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}
.badge-status-progress .status-pulse-dot {
    background-color: #3b82f6;
}

/* Priority Badges */
.badge-priority {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.775rem;
    font-weight: 600;
}
.badge-prio-high {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.badge-prio-med {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}
.badge-prio-low {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Role Badges */
.badge-role {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.775rem;
    font-weight: 600;
}
.badge-role-admin { background-color: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-role-agent { background-color: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.badge-role-customer { background-color: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.badge-role-user { background-color: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }

/* Grid Action Buttons */
.grid-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.775rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 5px;
    text-decoration: none;
    line-height: 1.2;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
}
.grid-action-view {
    background-color: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}
.grid-action-view:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}
.grid-action-edit {
    background-color: #eff6ff;
    color: #2563eb;
    border-color: #dbeafe;
}
.grid-action-edit:hover {
    background-color: #2563eb;
    color: #ffffff;
}
.grid-action-delete {
    background-color: #fef2f2;
    color: #dc2626;
    border-color: #fee2e2;
}
.grid-action-delete:hover {
    background-color: #dc2626;
    color: #ffffff;
}
.badge-code, .badge-issue-type {
    background-color: #f1f5f9;
    color: #334155;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.775rem;
    border: 1px solid #e2e8f0;
}

/* ========================================================
   W2UI Classic Screenshot Matched Search Popover
   ======================================================== */
.w2ui-adv-search-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 14px 18px 16px 18px;
    min-width: 440px;
    max-width: 520px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    user-select: none;
}

.w2ui-adv-search-box .adv-header {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 8px;
}

.w2ui-adv-search-box .btn-close-adv {
    width: 32px;
    height: 24px;
    border: 1px solid #b0b7c3;
    background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.12s ease;
}

.w2ui-adv-search-box .btn-close-adv:hover {
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    color: #0f172a;
    border-color: #94a3b8;
}

.w2ui-adv-search-box .adv-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.w2ui-adv-search-box .adv-table td.label-col {
    text-align: right;
    font-size: 13px;
    color: #334155;
    font-weight: 500;
    padding-right: 14px;
    white-space: nowrap;
    width: 32%;
}

.w2ui-adv-search-box .adv-table td.input-col {
    width: 68%;
}

.w2ui-adv-search-box .adv-input {
    width: 100%;
    height: 30px;
    padding: 3px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background-color: #ffffff;
    font-size: 13px;
    color: #1e293b;
    box-sizing: border-box;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.w2ui-adv-search-box .adv-input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.w2ui-adv-search-box select.adv-input {
    cursor: pointer;
    background-color: #ffffff !important;
}

.w2ui-adv-search-box .adv-footer {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 14px;
    padding-top: 10px;
}

.w2ui-adv-search-box .btn-adv-reset {
    padding: 5px 22px;
    border: 1px solid #b0b7c3;
    background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
    border-radius: 4px;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.12s ease;
}

.w2ui-adv-search-box .btn-adv-reset:hover {
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    border-color: #94a3b8;
    color: #0f172a;
}

.w2ui-adv-search-box .btn-adv-search {
    padding: 5px 26px;
    border: 1px solid #1d4ed8;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 4px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    transition: all 0.12s ease;
}

.w2ui-adv-search-box .btn-adv-search:hover {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
}

/* Action pill edit button in grid */
.btn-grid-edit-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 14px;
    border-radius: 14px;
    border: 1.5px solid #2563eb;
    background: #ffffff;
    color: #2563eb !important;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.btn-grid-edit-pill:hover {
    background: #2563eb;
    color: #ffffff !important;
}

/* ========================================================
   Select2 z-index Fix for W2UI Overlay and Popovers
   ======================================================== */
.select2-container {
    z-index: 99999990 !important;
}

.select2-container--open {
    z-index: 99999999 !important;
}

.select2-dropdown {
    z-index: 99999999 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
    font-size: 13px !important;
}

.select2-results__option {
    padding: 6px 12px !important;
    font-size: 13px !important;
}

.w2ui-adv-search-box .select2-container {
    width: 100% !important;
}

.w2ui-adv-search-box .select2-container--default .select2-selection--single {
    height: 30px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 0 !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    background-color: #ffffff !important;
}

.w2ui-adv-search-box .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px !important;
    font-size: 13px !important;
    color: #1e293b !important;
    padding-left: 8px !important;
    padding-right: 24px !important;
}

.w2ui-adv-search-box .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 28px !important;
    right: 4px !important;
}