/* design tokens & variables */
:root {
  /* Dark Theme variables (default) - Upgraded to Premium Neon Dark Mode */
  --bg-app: #080c14;
  --bg-sidebar: rgba(11, 16, 27, 0.75);
  --bg-card: rgba(13, 20, 35, 0.6);
  --bg-card-hover: rgba(13, 20, 35, 0.8);
  --border-color: rgba(255, 255, 255, 0.05);
  --border-hover: rgba(168, 85, 247, 0.3);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  --accent-color: #a855f7;
  --accent-light: #c084fc;
  --accent-dark: #7e22ce;
  --accent-gradient: linear-gradient(135deg, #a855f7, #10b981);
  
  --danger-color: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --success-color: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  
  /* Status Colors */
  --color-todo: #f59e0b;
  --color-todo-bg: rgba(245, 158, 11, 0.1);
  --color-progress: #3b82f6;
  --color-progress-bg: rgba(59, 130, 246, 0.1);
  --color-review: #a855f7;
  --color-review-bg: rgba(168, 85, 247, 0.1);
  --color-done: #10b981;
  --color-done-bg: rgba(16, 185, 129, 0.1);

  /* Priorities */
  --priority-high: #f43f5e;
  --priority-high-bg: rgba(244, 63, 94, 0.1);
  --priority-medium: #eab308;
  --priority-medium-bg: rgba(234, 179, 8, 0.1);
  --priority-low: #06b6d4;
  --priority-low-bg: rgba(6, 182, 212, 0.1);

  /* Glassmorphism details */
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --glass-blur: blur(16px);
  
  /* Layout sizes */
  --sidebar-width: 280px;
  --topbar-height: 80px;
}

/* Light Theme Variables */
.light-theme {
  --bg-app: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --accent-color: #4f46e5;
  --accent-light: #6366f1;
  --accent-dark: #3730a3;
  --accent-gradient: linear-gradient(135deg, #4f46e5, #9333ea);
  
  --glass-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.08);
  --color-todo-bg: rgba(245, 158, 11, 0.15);
  --color-progress-bg: rgba(59, 130, 246, 0.15);
  --color-review-bg: rgba(168, 85, 247, 0.15);
  --color-done-bg: rgba(16, 185, 129, 0.15);

  --priority-high-bg: rgba(244, 63, 94, 0.15);
  --priority-medium-bg: rgba(234, 179, 8, 0.15);
  --priority-low-bg: rgba(6, 182, 212, 0.15);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Glassmorphism Styles */
.glass {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  box-shadow: var(--glass-shadow);
  border-radius: 16px;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* Layout App Container */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px;
  z-index: 10;
  flex-shrink: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-header {
  margin-bottom: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
  filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.15));
}

/* Profile Card / Role switcher container */
.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(148, 163, 184, 0.06);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.profile-card .avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-info {
  flex-grow: 1;
  min-width: 0;
}

.profile-info label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.select-wrapper select {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  padding-right: 16px;
  appearance: none;
}

.select-wrapper::after {
  content: "▾";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--text-secondary);
  pointer-events: none;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex-grow: 1;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.nav-item a svg {
  transition: transform 0.2s ease;
}

.nav-item:hover a {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.06);
}

.nav-item:hover a svg {
  transform: translateX(2px);
}

.nav-item.active a {
  color: #fff;
  background: rgba(16, 185, 129, 0.12);
  border-left: 3px solid #10b981;
  border-radius: 0 10px 10px 0;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.nav-item.active a svg {
  color: #10b981;
  filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.5));
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  background: rgba(148, 163, 184, 0.05);
  border-radius: 20px;
  width: fit-content;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-primary);
}

.dark-theme .theme-toggle .sun-icon { display: block; }
.dark-theme .theme-toggle .moon-icon { display: none; }
.light-theme .theme-toggle .sun-icon { display: none; }
.light-theme .theme-toggle .moon-icon { display: block; }

/* Main Content Area */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  background-image: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 400px), 
                    radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.03), transparent 400px);
}

/* Top Bar Styling */
.topbar {
  height: var(--topbar-height);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(8px);
}

.topbar .page-title h1 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.topbar .page-title .subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Search Box styling */
.search-box {
  position: relative;
  width: 260px;
}

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

.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 42px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(148, 163, 184, 0.1);
}

/* General Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  height: 42px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.15);
  border-color: var(--border-hover);
}

/* Sections management */
.content-section {
  display: none;
  padding: 40px;
  animation: fadeIn 0.4s ease forwards;
}

.content-section.active {
  display: block;
}

/* Metrics Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.metric-card {
  padding: 24px;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon.total { background: rgba(99, 102, 241, 0.12); color: var(--accent-light); }
.metric-icon.active { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.metric-icon.completed { background: rgba(16, 185, 129, 0.12); color: var(--success-color); }
.metric-icon.overdue { background: rgba(239, 68, 68, 0.12); color: var(--danger-color); }

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.metric-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.alert-card {
  border-color: rgba(239, 68, 68, 0.2);
}
.alert-card .metric-value {
  color: var(--danger-color);
}

/* Dashboard Details Grid (Member progress & Status stacked bar) */
.dashboard-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

@media (max-width: 1024px) {
  .dashboard-details-grid {
    grid-template-columns: 1fr;
  }
}

.details-panel {
  padding: 28px;
}

.details-panel h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* Member progress list */
.member-progress-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.member-progress-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.member-progress-row .avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.member-progress-info {
  flex-grow: 1;
}

.member-name-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.member-name-stats .percentage {
  color: var(--success-color);
  font-weight: 600;
}

/* Progress bar container */
.bar-container {
  height: 8px;
  background: rgba(148, 163, 184, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stacked Progress Bar */
.status-summary-box {
  display: flex;
  flex-direction: column;
  gap: 24px;
  justify-content: center;
  height: calc(100% - 36px);
}

.progress-bar-stacked {
  height: 24px;
  background: rgba(148, 163, 184, 0.08);
  border-radius: 12px;
  display: flex;
  overflow: hidden;
}

.progress-segment {
  height: 100%;
  transition: width 0.5s ease;
  position: relative;
}

.progress-segment:hover::before {
  content: attr(data-label);
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 10;
}

.progress-segment.todo { background-color: var(--color-todo); }
.progress-segment.in-progress { background-color: var(--color-progress); }
.progress-segment.in-review { background-color: var(--color-review); }
.progress-segment.done { background-color: var(--color-done); }

.status-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.legend-item span {
  font-weight: 700;
  color: var(--text-primary);
  margin-left: auto;
}

.bullet {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.bullet.todo { background-color: var(--color-todo); }
.bullet.in-progress { background-color: var(--color-progress); }
.bullet.in-review { background-color: var(--color-review); }
.bullet.done { background-color: var(--color-done); }

/* Master Task Table Panel */
.task-table-panel {
  padding: 24px;
}

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

.panel-header h3 {
  font-size: 1.1rem;
}

.filter-bar {
  display: flex;
  gap: 12px;
}

.filter-bar select {
  height: 38px;
  padding: 0 12px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.825rem;
  outline: none;
  cursor: pointer;
}

.table-container {
  overflow-x: auto;
}

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

.task-table th, .task-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.task-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.825rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(148, 163, 184, 0.02);
}

.task-table tr:last-child td {
  border-bottom: none;
}

.task-table tr:hover td {
  background: rgba(148, 163, 184, 0.02);
}

/* Tags & Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-todo { color: var(--color-todo); background: var(--color-todo-bg); }
.badge-progress { color: var(--color-progress); background: var(--color-progress-bg); }
.badge-review { color: var(--color-review); background: var(--color-review-bg); }
.badge-done { color: var(--color-done); background: var(--color-done-bg); }

.priority-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.priority-high { color: var(--priority-high); background: var(--priority-high-bg); }
.priority-medium { color: var(--priority-medium); background: var(--priority-medium-bg); }
.priority-low { color: var(--priority-low); background: var(--priority-low-bg); }

/* Deadline representation */
.deadline-text {
  font-weight: 500;
}
.deadline-text.overdue {
  color: var(--danger-color);
  font-weight: 700;
  animation: pulse 2s infinite;
}

/* Image Attachment Column representation */
.table-img-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: transform 0.15s ease;
}

.table-img-thumb:hover {
  transform: scale(1.15);
}

/* Actions Menu */
.action-buttons {
  display: flex;
  gap: 8px;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.1);
  border-color: var(--border-hover);
}

.action-btn.edit:hover {
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.1);
}

.action-btn.delete:hover {
  color: var(--danger-color);
  background: var(--danger-bg);
}

/* Kanban Board Styling */
.kanban-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.kanban-title-info h2 {
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.kanban-title-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: start;
  height: calc(100vh - 250px);
  min-height: 450px;
}

@media (max-width: 900px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
    overflow-y: auto;
    height: auto;
  }
}

@media (max-width: 600px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

.kanban-column {
  background: rgba(148, 163, 184, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  min-height: 380px;
  padding: 16px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.kanban-column.dragover {
  background: rgba(99, 102, 241, 0.05);
  border-color: var(--accent-light);
  border-style: dashed;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.column-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.column-header .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.column-header .dot.todo { background-color: var(--color-todo); }
.column-header .dot.in-progress { background-color: var(--color-progress); }
.column-header .dot.in-review { background-color: var(--color-review); }
.column-header .dot.done { background-color: var(--color-done); }

.column-header .task-count {
  margin-left: auto;
  background: rgba(148, 163, 184, 0.1);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.column-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex-grow: 1;
  padding-right: 4px;
}

/* Kanban Cards styling */
.kanban-card {
  padding: 16px;
  cursor: grab;
  user-select: none;
  background: var(--bg-card);
}

.kanban-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

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

.kanban-card.dragging {
  opacity: 0.4;
  transform: scale(0.98);
  border-style: dashed;
}

.card-image-wrap {
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  max-height: 120px;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.card-priority-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-priority-row .date-created {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.kanban-card h4 {
  font-size: 0.925rem;
  margin-bottom: 8px;
  line-height: 1.4;
  color: var(--text-primary);
}

.kanban-card p.desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-meta-item.overdue {
  color: var(--danger-color);
  font-weight: 600;
}

.card-assignee {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.725rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

/* Modals Overlay & Card style */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.modal-card {
  width: 100%;
  max-width: 580px;
  padding: 32px;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  max-height: 90vh;
  overflow-y: auto;
}

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

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

.modal-header h2 {
  font-size: 1.25rem;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.close-btn:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-primary);
}

/* Form layouts inside modal */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group label .required {
  color: var(--danger-color);
}

.form-group input[type="text"], 
.form-group textarea, 
.form-group select,
.form-row select,
.form-row input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus,
.form-row input:focus,
.form-row select:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  background: rgba(148, 163, 184, 0.08);
}

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

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Image Upload Area in Form */
.image-uploader {
  border: 2px dashed var(--border-color);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background: rgba(148, 163, 184, 0.02);
  transition: all 0.2s ease;
  position: relative;
}

.image-uploader:hover, .image-uploader.dragover {
  border-color: var(--accent-light);
  background: rgba(99, 102, 241, 0.04);
}

.uploader-content svg {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.uploader-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.uploader-content small {
  font-size: 0.725rem;
  color: var(--text-muted);
}

.uploader-preview {
  position: relative;
}

.uploader-preview img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 6px;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--border-color);
}

.btn-remove-image {
  margin-top: 12px;
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-remove-image:hover {
  background: rgba(239, 68, 68, 0.25);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* Lightbox Modal */
#lightbox-modal {
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Keyframes & Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

/* Stock Management Styles */
.stock-qty-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.stock-qty-normal {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.stock-qty-low {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
  animation: pulse-soft 2s infinite;
}

.stock-qty-out {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  animation: pulse-strong 1.5s infinite;
}

/* Quick Action Buttons */
.quick-action-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-quick-buy {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-quick-buy:hover {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  transform: translateY(-1px);
}

.btn-quick-use {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-quick-use:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border-color: transparent;
  transform: translateY(-1px);
}

/* Animations */
@keyframes pulse-soft {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.2);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
  }
}

@keyframes pulse-strong {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

/* Alerting Card styles */
.metric-card.alert-card {
  transition: transform 0.2s ease;
}

.metric-card.alert-card:hover {
  transform: translateY(-3px);
}

/* Attendance Styles */
.attendance-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 24px;
  align-items: flex-start;
}

.clock-panel {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.clock-icon-wrapper {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-light);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

#live-time-display {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  margin-bottom: 8px;
}

.clock-date {
  font-size: 0.95rem;
  opacity: 0.7;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.check-actions {
  width: 100%;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.active-member-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.active-member-info strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Clock In / Out Buttons */
.btn-check-action {
  width: 100%;
  max-width: 280px;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
  border: none;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-check-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-check-action:active {
  transform: translateY(0);
}

.btn-check-action.checkout {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-check-action.checkout:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Attendance completed badge */
.attendance-complete-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 14px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  max-width: 280px;
  text-align: center;
}

/* Today Check-in/out Details card */
.clock-today-details {
  display: flex;
  width: 100%;
  max-width: 280px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 16px;
  justify-content: space-around;
  gap: 12px;
}

.clock-today-details .time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.clock-today-details .time-block:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.clock-today-details .time-block .label {
  font-size: 0.75rem;
  opacity: 0.5;
  margin-bottom: 4px;
}

.clock-today-details .time-block .value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Attendance Status Badge styles in table */
.attendance-status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.attendance-status-in {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.attendance-status-out {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Tax Bills Styles */
.bill-thumbnail {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
  margin: 0 auto;
}

.bill-thumbnail:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.btn-download-image {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-download-image:hover {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  transform: translateY(-1px);
}

/* Lightbox Modal custom overlays */
#bill-image-lightbox {
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1100;
}

#bill-image-lightbox.active {
  display: flex;
}

/* Glowing Background Blobs */
.glow-bg-blob {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
  animation: floatBlobs 20s infinite alternate ease-in-out;
}

.blob-purple {
  top: -150px;
  left: -150px;
  background: #a855f7;
}

.blob-green {
  bottom: -200px;
  right: -200px;
  background: #10b981;
}

@keyframes floatBlobs {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(50px, 30px) scale(1.1);
  }
}

/* Monogram Logo styles */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.logo-icon {
  filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.4)) drop-shadow(0 0 5px rgba(16, 185, 129, 0.4));
  animation: logoPulse 4s infinite alternate ease-in-out;
}

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

.logo-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
  line-height: 1.15;
}

.logo-subtitle {
  font-size: 0.72rem;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.8px;
  text-shadow: 0 0 4px rgba(16, 185, 129, 0.3);
  text-transform: uppercase;
  margin-top: 2px;
}

@keyframes logoPulse {
  0% {
    filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.3)) drop-shadow(0 0 4px rgba(16, 185, 129, 0.3));
    transform: scale(1);
  }
  100% {
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.6)) drop-shadow(0 0 10px rgba(16, 185, 129, 0.6));
    transform: scale(1.02);
  }
}

/* Sidebar Custom Glass look overlay */
.sidebar {
  background: rgba(8, 12, 20, 0.65) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.main-content {
  position: relative;
  z-index: 1;
}

/* Glowing text modifications */
#live-time-display {
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.3), 0 0 10px rgba(168, 85, 247, 0.5);
}

.clock-panel {
  background: rgba(13, 20, 35, 0.55);
  border: 1px solid rgba(168, 85, 247, 0.15) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), 0 0 15px rgba(168, 85, 247, 0.1);
}

/* Daily Progress Gallery Grid */
.progress-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.progress-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  height: 100%;
}

.progress-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.2);
}

.progress-card-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.progress-card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.progress-card:hover .progress-card-image {
  transform: scale(1.05);
}

.progress-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.progress-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.progress-card-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-card-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
}

.progress-card-date {
  font-weight: 600;
  opacity: 0.8;
}

.progress-card-desc {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 16px;
  flex-grow: 1;
  word-break: break-word;
}

.progress-card-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
  margin-top: auto;
}

.btn-delete-progress {
  background: transparent;
  color: var(--danger-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete-progress:hover {
  background: var(--danger-bg);
  border-color: var(--danger-color);
  transform: translateY(-1px);
}

/* Group Chat Styles */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height) - 40px);
  border-radius: 16px;
  overflow: hidden;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.3);
}

.chat-header-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.chat-subtitle {
  font-size: 0.8rem;
  color: #10b981;
  text-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
  font-weight: 600;
}

.chat-history {
  flex-grow: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(8, 12, 20, 0.2);
}

/* Custom scrollbar for chat history */
.chat-history::-webkit-scrollbar {
  width: 6px;
}
.chat-history::-webkit-scrollbar-track {
  background: transparent;
}
.chat-history::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}
.chat-history::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

.chat-message-row {
  display: flex;
  width: 100%;
}

.chat-message-row.msg-incoming {
  justify-content: flex-start;
}

.chat-message-row.msg-outgoing {
  justify-content: flex-end;
}

.chat-message-wrapper {
  max-width: 70%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-message-row.msg-incoming .chat-message-wrapper {
  align-items: flex-start;
}

.chat-message-row.msg-outgoing .chat-message-wrapper {
  align-items: flex-end;
}

.chat-message-user-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.chat-message-user-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: white;
}

.chat-message-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-message-row.msg-incoming .chat-message-bubble {
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-top-left-radius: 4px;
}

.chat-message-row.msg-outgoing .chat-message-bubble {
  background: rgba(168, 85, 247, 0.18);
  color: #fff;
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.1);
  border-top-right-radius: 4px;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.2);
}

.chat-message-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.chat-input-area {
  display: flex;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.3);
  gap: 12px;
}

.chat-input-area input {
  flex-grow: 1;
  background: rgba(8, 12, 20, 0.5);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  outline: none;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.chat-input-area input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.15);
}

.btn-chat-send {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  height: auto;
}

/* Connection Status Badge */
.sync-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sync-status-badge.online {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.05);
}

.sync-status-badge.offline {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.05);
}

.sync-status-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.sync-status-badge.online .status-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGreen 2s infinite;
}

.sync-status-badge.offline .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: pulseOrange 2s infinite;
}

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

@keyframes pulseOrange {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Hamburger toggle button (default hidden on desktop) */
.hamburger-btn {
  display: none;
}

/* Sidebar overlay default style */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 998;
}

/* Responsive Overrides (max-width: 768px) */
@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 100;
  }
  
  /* Sidebar Drawer styling */
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* Hidden by default */
    width: 280px;
    height: 100%;
    z-index: 999;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 25px rgba(0, 0, 0, 0.6);
  }
  
  .sidebar.active {
    left: 0; /* Slide in */
  }
  
  .sidebar-overlay.active {
    display: block;
  }
  
  /* Adjust topbar for mobile */
  .topbar {
    padding: 0 16px;
    gap: 12px;
  }
  
  .topbar .page-title h1 {
    font-size: 1.1rem;
  }
  
  .topbar .page-title p {
    display: none; /* Hide subtitle to save space */
  }
  
  .topbar-actions {
    gap: 8px;
  }
  
  .search-box {
    max-width: 120px;
    padding: 6px 10px;
  }
  
  .search-box input {
    font-size: 0.8rem;
  }
  
  /* Mobile Chat Adjustments */
  .chat-container {
    height: calc(100dvh - var(--topbar-height) - 16px) !important;
    border-radius: 8px;
  }
  
  .chat-history {
    padding: 12px;
    gap: 8px;
  }
  
  .chat-input-area {
    padding: 10px 12px;
    gap: 8px;
  }
  
  .chat-input-area input {
    padding: 10px 12px;
    font-size: 0.88rem;
  }
  
  .btn-chat-send {
    padding: 0 14px;
    font-size: 0.88rem;
  }
  
  .chat-message-bubble {
    padding: 8px 12px;
    font-size: 0.88rem;
  }
}



/* Multi-file preview grid styles */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
}

.preview-grid .preview-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-grid .preview-item img,
.preview-grid .preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.multi-file-indicator {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: bold;
}

.lightbox-media-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  gap: 15px;
}

/* Chat Attachments and Emoji Styles */
.btn-chat-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-chat-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.emoji-picker-popup {
  position: absolute;
  bottom: 100%;
  left: 24px;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.emoji-grid span {
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.1s;
}

.emoji-grid span:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.2);
}

.chat-bubble-attachment {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bubble-attachment img,
.chat-bubble-attachment video {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  cursor: pointer;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-file-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

.chat-file-attachment:hover {
  background: rgba(0, 0, 0, 0.4);
}

.chat-file-icon {
  background: var(--accent-gradient);
  border-radius: 6px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
