@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-app: #080b11;
  --bg-sidebar: #0f131a;
  --bg-card: rgba(21, 27, 38, 0.6);
  --bg-card-hover: rgba(29, 37, 52, 0.8);
  --bg-input: #121721;
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-glow: rgba(99, 102, 241, 0.3);
  --border-color-hover: rgba(255, 255, 255, 0.12);
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  --accent-primary: #6366f1;
  --accent-primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --accent-glow: rgba(99, 102, 241, 0.15);
  
  --status-quote: #a855f7;
  --status-todo: #3b82f6;
  --status-inprogress: #06b6d4;
  --status-onhold: #f59e0b;
  --status-review: #ec4899;
  --status-complete: #10b981;
  --status-invoice: #14b8a6;
  
  --priority-low: #64748b;
  --priority-medium: #eab308;
  --priority-high: #f97316;
  --priority-urgent: #ef4444;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px 0 rgba(99, 102, 241, 0.25);
  --border-radius: 12px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Glassmorphism Panel base */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

/* Sidebar Styling */
aside {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  flex-shrink: 0;
  z-index: 50;
}

.sidebar-logo {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  color: #B91C3C;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-primary-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
}

.sidebar-logo-img {
  width: 160px;
  height: auto;
  object-fit: contain;
}

.sidebar-menu {
  list-style: none;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar-link:hover, .sidebar-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
  background: var(--accent-glow);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

/* Main Workspace */
main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: #f8f9fc;
  color: #1e293b;

  /* Light theme overrides for all content inside main */
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f1f5f9;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-hover: rgba(0, 0, 0, 0.15);
  --border-color-glow: rgba(99, 102, 241, 0.35);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent-glow: rgba(99, 102, 241, 0.08);
  --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
}

/* Header */
header {
  height: 70px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: #ffffff;
  backdrop-filter: blur(12px);
  z-index: 40;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-title {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
  color: #1e293b;
}

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

/* Role Switcher Container */
.role-switcher-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.role-switcher-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.role-select {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  font-family: var(--font-family);
  padding-right: 4px;
}

.role-select option {
  background: #1e293b;
  color: #f1f5f9;
  font-weight: 500;
}

/* Search Box */
.search-container {
  position: relative;
  width: 240px;
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px 8px 36px;
  border-radius: 99px;
  font-family: var(--font-family);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

/* View Container */
.view-panel {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
  display: none;
}

.view-panel.active {
  display: block;
}

/* Dashboard View */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card.quote {
  background: rgba(168, 85, 247, 0.22);
  border-left: 4px solid rgba(168, 85, 247, 0.85);
}
.stat-card.quote:hover {
  background: rgba(168, 85, 247, 0.32);
}

.stat-card.todo {
  background: rgba(59, 130, 246, 0.22);
  border-left: 4px solid rgba(59, 130, 246, 0.85);
}
.stat-card.todo:hover {
  background: rgba(59, 130, 246, 0.32);
}

.stat-card.inprogress {
  background: rgba(6, 182, 212, 0.22);
  border-left: 4px solid rgba(6, 182, 212, 0.85);
}
.stat-card.inprogress:hover {
  background: rgba(6, 182, 212, 0.32);
}

.stat-card.complete {
  background: rgba(16, 185, 129, 0.22);
  border-left: 4px solid rgba(16, 185, 129, 0.85);
}
.stat-card.complete:hover {
  background: rgba(16, 185, 129, 0.32);
}

.stat-title {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.dashboard-block {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.block-title {
  font-weight: 700;
  font-size: 1.1rem;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  outline: none;
  font-family: var(--font-family);
}

.btn-primary {
  background: var(--accent-primary-gradient);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  border-color: transparent;
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.4);
}

.btn-success:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-success.btn-saved {
  background: linear-gradient(135deg, #047857, #059669);
  pointer-events: none;
}

.btn-icon-only {
  padding: 8px;
  border-radius: 8px;
}

/* ============================================
   Generic Horizontal Scroll Navigation Arrows
   Both arrows side-by-side on the right
   ============================================ */
.scroll-nav-wrapper {
  position: relative;
}

.scroll-nav-arrows {
  position: absolute;
  top: -44px;
  right: 0;
  display: flex;
  gap: 4px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.scroll-nav-wrapper.has-overflow .scroll-nav-arrows {
  opacity: 1;
  pointer-events: auto;
}

.scroll-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

.scroll-nav-btn:hover {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
  transform: scale(1.08);
}

.scroll-nav-btn:active {
  transform: scale(0.95);
}

.scroll-nav-btn.disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* Horizontal overflow scrolling for narrow screens */
.dashboard-grid,
.recurring-stats-row,
.table-wrapper,
.reports-grid,
.reports-stats-box {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.dashboard-grid::-webkit-scrollbar,
.recurring-stats-row::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar,
.reports-grid::-webkit-scrollbar,
.reports-stats-box::-webkit-scrollbar {
  height: 4px;
}

.dashboard-grid::-webkit-scrollbar-track,
.recurring-stats-row::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track,
.reports-grid::-webkit-scrollbar-track,
.reports-stats-box::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-grid::-webkit-scrollbar-thumb,
.recurring-stats-row::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb,
.reports-grid::-webkit-scrollbar-thumb,
.reports-stats-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

/* Kanban Board View */
.kanban-board-wrapper {
  position: relative;
  width: 100%;
  height: calc(100vh - 170px);
}

/* Kanban uses the generic .scroll-nav-arrows but positioned differently */
.kanban-board-wrapper > .scroll-nav-arrows {
  top: 8px;
  right: 8px;
}

/* Edge fade gradients when content overflows */
.kanban-board-wrapper::before,
.kanban-board-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kanban-board-wrapper::before {
  left: 0;
  background: linear-gradient(to right, rgba(8, 11, 17, 0.95), transparent);
}

.kanban-board-wrapper::after {
  right: 0;
  background: linear-gradient(to left, rgba(8, 11, 17, 0.95), transparent);
}

.kanban-board-wrapper.can-scroll-left::before {
  opacity: 1;
}

.kanban-board-wrapper.can-scroll-right::after {
  opacity: 1;
}

.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  height: 100%;
  padding-bottom: 16px;
  align-items: flex-start;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.kanban-board::-webkit-scrollbar {
  height: 6px;
}

.kanban-board::-webkit-scrollbar-track {
  background: transparent;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

.kanban-column {
  width: 280px;
  flex-shrink: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--border-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.kanban-column-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: #f8f9fc;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
}

.column-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.column-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.column-count {
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

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

.kanban-column.drag-over {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.04);
}

/* Kanban Ticket Card */
.ticket-card {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: grab;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-sm);
}

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

/* Status-based card backgrounds */
.ticket-card[data-status="Quote"] {
  background: rgba(168, 85, 247, 0.22);
  border-left: 4px solid rgba(168, 85, 247, 0.85);
}
.ticket-card[data-status="Quote"]:hover {
  background: rgba(168, 85, 247, 0.32);
}

.ticket-card[data-status="To do"] {
  background: rgba(59, 130, 246, 0.22);
  border-left: 4px solid rgba(59, 130, 246, 0.85);
}
.ticket-card[data-status="To do"]:hover {
  background: rgba(59, 130, 246, 0.32);
}

.ticket-card[data-status="In-progress"] {
  background: rgba(6, 182, 212, 0.22);
  border-left: 4px solid rgba(6, 182, 212, 0.85);
}
.ticket-card[data-status="In-progress"]:hover {
  background: rgba(6, 182, 212, 0.32);
}

.ticket-card[data-status="On Hold"] {
  background: rgba(245, 158, 11, 0.22);
  border-left: 4px solid rgba(245, 158, 11, 0.85);
}
.ticket-card[data-status="On Hold"]:hover {
  background: rgba(245, 158, 11, 0.32);
}

.ticket-card[data-status="Review"] {
  background: rgba(236, 72, 153, 0.22);
  border-left: 4px solid rgba(236, 72, 153, 0.85);
}
.ticket-card[data-status="Review"]:hover {
  background: rgba(236, 72, 153, 0.32);
}

.ticket-card[data-status="Complete"] {
  background: rgba(16, 185, 129, 0.22);
  border-left: 4px solid rgba(16, 185, 129, 0.85);
}
.ticket-card[data-status="Complete"]:hover {
  background: rgba(16, 185, 129, 0.32);
}

.ticket-card[data-status="Invoice"] {
  background: rgba(20, 184, 166, 0.22);
  border-left: 4px solid rgba(20, 184, 166, 0.85);
}
.ticket-card[data-status="Invoice"]:hover {
  background: rgba(20, 184, 166, 0.32);
}

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

.ticket-id {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.priority-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.priority-low { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }
.priority-medium { background: rgba(234, 179, 8, 0.15); color: #facc15; }
.priority-high { background: rgba(249, 115, 22, 0.15); color: #fdba74; }
.priority-urgent { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.ticket-title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.4;
}

.ticket-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ticket-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
}

.assignee-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
}

.ticket-time-tracked {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.ticket-timer-active {
  color: var(--priority-urgent);
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════ */
/* Progress Bar – Time Estimate vs Actual                */
/* ═══════════════════════════════════════════════════════ */
.ticket-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}

.ticket-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.ticket-progress-pct {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.ticket-progress-track {
  position: relative;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.ticket-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.4s ease;
  min-width: 2px;
}

/* Safe — under 80 % */
.ticket-progress-fill[data-state="safe"] {
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
}

/* Warning — 80 %–99 % */
.ticket-progress-fill[data-state="warning"] {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
  animation: progress-pulse-amber 2s ease-in-out infinite;
}

/* Over Budget — 100 %+ */
.ticket-progress-fill[data-state="over"] {
  background: linear-gradient(90deg, #ef4444, #f87171);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  animation: progress-pulse-red 1.4s ease-in-out infinite;
}

.ticket-progress-pct[data-state="safe"]    { color: #34d399; }
.ticket-progress-pct[data-state="warning"] { color: #fbbf24; }
.ticket-progress-pct[data-state="over"]    { color: #f87171; font-weight: 800; }

/* Warning / Over-budget badge icon */
.progress-warn-icon {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1;
}
.progress-warn-icon[data-state="warning"] {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
.progress-warn-icon[data-state="over"] {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  animation: progress-pulse-red 1.4s ease-in-out infinite;
}

/* Tooltip on hover */
.ticket-progress-track[title] {
  cursor: help;
}

@keyframes progress-pulse-amber {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}
@keyframes progress-pulse-red {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
  50%      { opacity: 0.85; box-shadow: 0 0 18px rgba(239, 68, 68, 0.7); }
}

/* No estimate — muted placeholder */
.ticket-progress-none {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
  padding-top: 2px;
}

/* Table-row compact variant */
.progress-cell {
  min-width: 110px;
}
.progress-cell .ticket-progress-track {
  height: 5px;
}
.progress-cell .ticket-progress-header {
  font-size: 0.65rem;
}

/* Detail-page (sidebar) enlarged variant */
#modal-progress-bar-section .ticket-progress {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  gap: 6px;
}
#modal-progress-bar-section .ticket-progress-track {
  height: 8px;
}
#modal-progress-bar-section .ticket-progress-header {
  font-size: 0.75rem;
}
#modal-progress-bar-section .ticket-progress-none {
  font-size: 0.72rem;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════ */

/* Tickets Table / List View */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-card);
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.ticket-table th {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Sortable Table Headers */
.sortable-th {
  cursor: pointer;
  user-select: none;
  position: relative;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.sortable-th:hover {
  color: var(--text-primary);
}

.sort-indicator {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-left: 4px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.sortable-th:hover .sort-indicator {
  opacity: 0.35;
}

.sort-indicator::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  vertical-align: middle;
}

.sortable-th.sort-active {
  color: var(--accent-primary);
}

.sortable-th.sort-active .sort-indicator {
  opacity: 1;
  color: var(--accent-primary);
}

.sortable-th.sort-asc .sort-indicator {
  transform: rotate(180deg);
}

.sortable-th.sort-desc .sort-indicator {
  transform: rotate(0deg);
}

.ticket-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-primary);
  vertical-align: middle;
}

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

.ticket-table tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

/* Status Badge */
.status-badge {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-quote { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.status-todo { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.status-inprogress { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.status-onhold { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-review { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.status-complete { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-invoice { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.3); }

/* Filters Bar */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.filters-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--accent-primary);
}

/* Modal - Glassmorphic Overlay and Container */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 10, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-container {
  width: 900px;
  max-width: 95vw;
  height: 85vh;
  max-height: 750px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;

  /* Light theme for modal content */
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f1f5f9;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-hover: rgba(0, 0, 0, 0.15);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  color: #1e293b;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f131a;
  color: #f1f5f9;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header .block-title,
.modal-header .modal-title-wrapper {
  color: #f1f5f9;
}

.modal-header .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
}

.modal-header .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-body {
  flex-grow: 1;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
}

.modal-main {
  padding: 24px;
  overflow-y: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--border-color);
}

.modal-sidebar {
  padding: 24px;
  overflow-y: auto;
  height: 100%;
  background: #f8f9fc;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Full-Page Ticket Detail View */
#view-ticket {
  padding: 0;
  display: none;
  flex-direction: column;
  min-height: 0;
}
#view-ticket.active {
  display: flex;
}

.ticket-page-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 0;
  overflow: hidden;
}

.ticket-page-header {
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
  flex-shrink: 0;
}

.ticket-page-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-back:hover {
  background: rgba(0, 0, 0, 0.04);
  transform: translateX(-2px);
}

.ticket-page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breadcrumb-separator {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
}

.ticket-page-body {
  flex-grow: 1;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
}

/* Form Styles inside Modal */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent-primary);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Time Tracker Widget inside Detail Modal */
.time-tracker-widget {
  padding: 20px;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timer-display-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timer-numeric {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: monospace;
  letter-spacing: 1px;
}

.timer-controls {
  display: flex;
  gap: 10px;
}

.btn-timer {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
}

.btn-timer-start {
  background: var(--status-complete);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-timer-start:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.5);
}

.btn-timer-pause {
  background: var(--status-onhold);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-timer-pause:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.5);
}

.btn-timer-stop {
  background: var(--priority-urgent);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-timer-stop:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.5);
}

/* Time logs history */
.time-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  margin-top: 10px;
}

.time-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.8rem;
}

.history-user {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-duration {
  font-family: monospace;
  font-weight: 700;
  color: var(--accent-primary);
}

/* Comments Section */
.comments-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.comment-input-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 8px;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.comment-avatar {
  flex-shrink: 0;
}

.comment-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.comment-author-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comment-author {
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-badge {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.role-admin { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.role-projectmanager { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.role-client { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.role-developer { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.role-designer { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.role-server { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; }

.comment-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.comment-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-primary);
}

/* Comment Image Attachment */
.comment-image-preview {
  position: relative;
  display: inline-block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  max-width: 200px;
}

.comment-image-preview img {
  display: block;
  max-width: 200px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 7px;
}

.comment-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

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

.comment-image {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: opacity 0.2s ease;
  max-width: 320px;
}

.comment-image:hover {
  opacity: 0.85;
}

.comment-image img {
  display: block;
  max-width: 320px;
  max-height: 200px;
  object-fit: cover;
  border-radius: 7px;
}

/* Attachments Layout */
.attachments-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.8rem;
}

.attachment-icon {
  color: var(--accent-primary);
}

.attachment-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.attachment-delete:hover {
  color: var(--priority-urgent);
}

.file-upload-input {
  display: none;
}

/* Global Floating Active Timer */
.floating-timer-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color-glow);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-radius: 30px;
  padding: 8px 16px 8px 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 90;
  transform: translateY(150px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-timer-bar.active {
  transform: translateY(0);
}

.floating-timer-pulse {
  width: 36px;
  height: 36px;
  background: var(--priority-urgent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  animation: timer-glowing 2s infinite;
}

@keyframes timer-glowing {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.floating-timer-info {
  display: flex;
  flex-direction: column;
}

.floating-timer-title {
  font-weight: 700;
  font-size: 0.85rem;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-timer-time {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Reports View */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 24px;
}

.bar-chart-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chart-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.chart-bar-outer {
  height: 10px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 99px;
  overflow: hidden;
}

.chart-bar-inner {
  height: 100%;
  background: var(--accent-primary-gradient);
  border-radius: 99px;
}

/* Details Box style for Reports */
.reports-stats-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 16px;
}

.reports-stat-small {
  padding: 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Login Screen Styles */
#login-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  overflow-y: auto;
  padding: 24px;
}

.login-card {
  width: 420px;
  padding: 40px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-logo-img {
  width: 280px;
  height: auto;
  object-fit: contain;
  margin-bottom: 0;
  align-self: center;
}

.login-logo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: #B91C3C;
}

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

.demo-accounts-box {
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-account-btn {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.demo-account-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.login-error {
  color: var(--priority-urgent);
  font-size: 0.8rem;
  text-align: center;
  display: none;
  background: rgba(239, 68, 68, 0.1);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Invoicing & Billing Features Style Suite */
.billing-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 6px 0;
}

.billing-stat-val {
  font-weight: 700;
  color: var(--text-primary);
}

.invoice-paper {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.invoice-brand-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.invoice-brand-logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--accent-primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.invoice-brand-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 6px;
}

.invoice-meta-info {
  text-align: right;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.invoice-addresses-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
}

.invoice-address-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invoice-address-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.invoice-address-val {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.invoice-table th {
  text-align: left;
  padding: 10px;
  border-bottom: 2px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.invoice-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.invoice-total-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.invoice-total-box {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.15);
  padding: 16px;
  border-radius: 8px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invoice-total-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.invoice-total-grand {
  display: flex;
  justify-content: space-between;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--status-complete);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 8px;
}

/* Invoice Amendment — Editable Inputs */
.invoice-table .invoice-edit-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.invoice-table .invoice-edit-input:hover {
  border-color: rgba(20, 184, 166, 0.25);
  background: rgba(20, 184, 166, 0.04);
}
.invoice-table .invoice-edit-input:focus {
  outline: none;
  border-color: var(--status-invoice);
  background: rgba(20, 184, 166, 0.06);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.12);
}
.invoice-table .invoice-edit-input.invoice-input-rate,
.invoice-table .invoice-edit-input.invoice-input-duration {
  width: 80px;
  text-align: right;
}
.invoice-table .invoice-edit-input.invoice-input-desc {
  width: 100%;
  min-width: 120px;
}

/* Editable row highlight */
.invoice-table tr.invoice-row-editable:hover {
  background: rgba(20, 184, 166, 0.03);
}

/* Remove line item button */
.invoice-remove-row-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.8rem;
  line-height: 1;
  transition: color 0.2s ease, background 0.2s ease;
  opacity: 0;
}
.invoice-table tr:hover .invoice-remove-row-btn {
  opacity: 1;
}
.invoice-remove-row-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Add Line Item button */
.invoice-add-row-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px dashed rgba(20, 184, 166, 0.35);
  color: var(--status-invoice);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}
.invoice-add-row-btn:hover {
  background: rgba(20, 184, 166, 0.08);
  border-color: var(--status-invoice);
}

/* Notes / Terms textarea */
.invoice-notes-section {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.invoice-notes-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.invoice-notes-textarea {
  background: transparent;
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.invoice-notes-textarea:focus {
  outline: none;
  border-color: var(--status-invoice);
  background: rgba(20, 184, 166, 0.04);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.1);
}
.invoice-notes-display {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  padding: 8px 0;
}

/* Original total reference */
.invoice-original-total {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 2px;
  font-style: italic;
}
.invoice-original-total .invoice-orig-amount {
  text-decoration: line-through;
  margin-left: 4px;
}

/* Amended indicator badge */
.invoice-amended-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Spin animation for save button loading state */
.spin-icon {
  animation: spin-icon 1s linear infinite;
}
@keyframes spin-icon {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Row subtotal display */
.invoice-row-subtotal {
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  min-width: 70px;
}

/* Printing styles */
@media print {
  body * {
    visibility: hidden;
  }
  #invoice-modal, #invoice-modal *, #report-print-area, #report-print-area * {
    visibility: visible;
  }
  #invoice-modal {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    overflow: visible !important;
  }
  #invoice-modal .modal-container {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    border: none !important;
    background: white !important;
    box-shadow: none !important;
    transform: none !important;
    backdrop-filter: none !important;
    overflow: visible !important;
  }
  #invoice-modal .modal-body {
    padding: 0 !important;
    background: white !important;
    overflow: visible !important;
  }
  .invoice-paper {
    padding: 0 !important;
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    border: none !important;
  }
  .invoice-paper * {
    color: black !important;
    border-color: #e2e8f0 !important;
  }
  .invoice-brand-logo {
    background: none !important;
    color: #4f46e5 !important;
    -webkit-text-fill-color: initial !important;
  }
  .invoice-total-box {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
  }
  .invoice-total-grand {
    color: #059669 !important;
    border-top: 1px solid #cbd5e1 !important;
  }
  .no-print {
    display: none !important;
  }
  /* Hide amendment controls when printing */
  .invoice-add-row-btn,
  .invoice-remove-row-btn,
  .invoice-amended-badge {
    display: none !important;
  }
  /* Render inputs as flat text for print */
  .invoice-edit-input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .invoice-notes-textarea {
    display: none !important;
  }
}

/* Client Folders Sidebar Styles */
.client-folder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  user-select: none;
}

.client-folder-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

.client-folder-item.active {
  background: var(--accent-glow);
  color: var(--text-primary);
  border-color: var(--border-color-glow);
  box-shadow: 0 0 12px 0 rgba(99, 102, 241, 0.1);
  font-weight: 600;
}

.client-folder-name-container {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-folder-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-folder-count {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.client-folder-item.active .client-folder-count {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

/* Reports Sub-Tabs */
.reports-tab {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  user-select: none;
}

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

.reports-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* Print statement adjustments */
@media print {
  #report-print-area {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: white !important;
    color: black !important;
    padding: 32px !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
  }
  #report-print-area * {
    color: black !important;
    border-color: #e2e8f0 !important;
  }
  #report-print-area .text-accent {
    color: #4f46e5 !important;
  }
  #report-print-area .text-success {
    color: #059669 !important;
  }
}

/* Custom Client Multiselect Dropdown */
.multiselect-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: 8px;
}

.multiselect-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
  color: var(--text-primary);
  font-size: 0.9rem;
  user-select: none;
}

.multiselect-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.multiselect-item input[type="checkbox"] {
  accent-color: var(--accent-primary);
  cursor: pointer;
  width: 16px;
  height: 16px;
  border-radius: 4px;
}



/* ═══════════════════════════════════════════════════════════════════
   SCREEN CAPTURE — Toggle Switch, Recording Indicator, Gallery & Lightbox
   ═══════════════════════════════════════════════════════════════════ */

/* Toggle Switch — iOS-style pill */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, box-shadow 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(99, 102, 241, 0.35);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: var(--accent-primary, #818cf8);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid var(--accent-primary, #818cf8);
  outline-offset: 2px;
}

/* Screen Capture Toggle Row */
.screen-capture-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: 2px;
}

.screen-capture-toggle-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  letter-spacing: 0.02em;
}

.screen-capture-toggle-info svg {
  opacity: 0.7;
}

/* Recording indicator on floating timer bar */
.capture-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.capture-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: capture-pulse 1.5s ease-in-out infinite;
}

@keyframes capture-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  50% { opacity: 0.4; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.capture-label {
  line-height: 1;
}

/* Modal Tab Navigation */
.modal-tabs-header {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin: -24px -24px 0 -24px;
  padding: 0 24px;
  background: #f8f9fc;
  flex-shrink: 0;
}

.modal-tab {
  cursor: pointer;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.modal-tab:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.02);
}

.modal-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.modal-tab.active svg {
  color: var(--accent-primary);
}

.modal-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.modal-tab.active .modal-tab-badge {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.4);
}

/* Modal Tab Panels */
.modal-tab-panel {
  display: none;
  flex-direction: column;
  gap: 24px;
  flex-grow: 1;
  overflow-y: auto;
  padding-top: 24px;
}

.modal-tab-panel.active {
  display: flex;
}

/* Screen Grabs Panel */
.screengrabs-panel-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.screengrabs-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.screengrabs-filter-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.screengrabs-filter-bar .filter-select {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.screengrabs-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.screengrabs-total-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

/* Screen Grabs Gallery Grid */
.screengrabs-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  overflow-y: auto;
  flex-grow: 1;
  padding-bottom: 8px;
}

.screengrabs-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-color);
  aspect-ratio: 16 / 10;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: #e2e8f0;
}

.screengrabs-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px) scale(1.01);
}

.screengrabs-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.screengrabs-card:hover img {
  transform: scale(1.05);
}

.screengrabs-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.screengrabs-card:hover .screengrabs-card-overlay {
  opacity: 1;
}

.screengrabs-card-user {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  gap: 5px;
}

.screengrabs-card-user .user-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  flex-shrink: 0;
}

.screengrabs-card-time {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

/* Zoom icon on hover */
.screengrabs-card-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: white;
}

.screengrabs-card:hover .screengrabs-card-zoom {
  opacity: 1;
}

/* Empty state */
.screengrabs-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.screengrabs-empty-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.6;
  max-width: 320px;
  line-height: 1.4;
}

/* Screenshot thumbnail grid */
.screenshot-thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.screenshot-thumbnail {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-color);
  aspect-ratio: 16 / 10;
  transition: all 0.2s ease;
}

.screenshot-thumbnail:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
  transform: scale(1.03);
}

.screenshot-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.screenshot-thumb-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.screenshot-thumbnail:hover .screenshot-thumb-overlay {
  opacity: 1;
}

.screenshot-thumb-time {
  font-size: 0.55rem;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
}

/* ── Lightbox Overlay ────────────────────────────────────────────── */
.screenshot-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}

.screenshot-lightbox.active {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90vw;
  max-width: 1200px;
  max-height: 90vh;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 19, 26, 0.7);
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--border-color);
  border-bottom: none;
}

.lightbox-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lightbox-user {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.lightbox-timestamp {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lightbox-nav-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-family: monospace;
}

.lightbox-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.lightbox-image-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 18, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  width: 100%;
  max-height: calc(90vh - 60px);
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(90vh - 70px);
  object-fit: contain;
  display: block;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 19, 26, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s ease;
  z-index: 2;
}

.lightbox-arrow:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

/* ============================================
   RECURRING TASKS VIEW
   ============================================ */

/* Data Table (Recurring Schedules)
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.data-table thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-primary, #818cf8);
  background: var(--bg-secondary, #1a1f36);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table thead th:first-child {
  border-radius: 10px 0 0 0;
}

.data-table thead th:last-child {
  border-radius: 0 10px 0 0;
}

.data-table tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.2s ease;
}

.data-table tbody tr:hover td {
  background: rgba(99, 102, 241, 0.04);
}

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

.data-table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 10px;
}

.data-table tbody tr:last-child td:last-child {
  border-radius: 0 0 10px 0;
}

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

/* Stats Cards Row */
.recurring-stats-row {
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
}

.recurring-stat-card {
  flex: 1;
  min-width: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s, background 0.2s;
}

.recurring-stat-card:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
}

.recurring-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.recurring-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recurring-stat-active {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.04);
}

.recurring-stat-active .recurring-stat-value {
  color: #34d399;
}

.recurring-stat-cancelled {
  border-color: rgba(239, 68, 68, 0.15);
  background: rgba(239, 68, 68, 0.03);
}

.recurring-stat-cancelled .recurring-stat-value {
  color: #f87171;
}

/* Recurrence Badge */
.recurrence-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.recurrence-badge.custom {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.2);
}

/* Status badges for recurring */
.recurring-status-active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.recurring-status-active::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.recurring-status-cancelled {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Empty state */
.recurring-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Recurring config section in modal */
.recurring-config-section {
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 10px;
  padding: 14px 16px;
}

.recurring-config-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.recurring-custom-fields {
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Table action buttons for recurring */
.recurring-actions {
  display: flex;
  gap: 6px;
}

.recurring-actions .btn {
  padding: 4px 10px;
  font-size: 0.7rem;
  border-radius: 6px;
}

.btn-reactivate {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.btn-reactivate:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
}

.btn-cancel-schedule {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.btn-cancel-schedule:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
}

.btn-delete-schedule {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-delete-schedule:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-edit-schedule {
  background: rgba(99, 102, 241, 0.08);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.btn-edit-schedule:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
}

/* ============================================================
   Business Settings Card (Settings Panel)
   ============================================================ */

.business-settings-card {
  margin-top: 20px;
  border-color: rgba(99, 102, 241, 0.15);
}

.business-settings-body {
  padding: 20px 24px 24px;
}

.business-settings-row {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.business-settings-field {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.business-settings-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 4px 0 10px;
  line-height: 1.4;
}

.business-settings-input-group {
  display: flex;
  align-items: center;
  gap: 0;
}

.business-settings-input-group .form-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  width: 120px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

.business-settings-suffix {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  height: 42px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--border-color);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.business-settings-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 1px;
}

.settings-save-status {
  font-size: 0.8rem;
  font-weight: 600;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.settings-save-status.success {
  color: #34d399;
}

.settings-save-status.error {
  color: #f87171;
}

/* ── Multi-Select Dropdown ──────────────────────────────────────── */
.multi-select-dropdown {
  position: relative;
  width: 100%;
}

.multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 6px 12px;
  background: var(--bg-input, rgba(255,255,255,0.06));
  border: 1px solid var(--border-color, rgba(255,255,255,0.12));
  border-radius: var(--radius, 8px);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  gap: 8px;
}

.multi-select-trigger:hover {
  border-color: var(--primary, #6366f1);
}

.multi-select-trigger:focus,
.multi-select-dropdown.open .multi-select-trigger {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

.multi-select-arrow {
  flex-shrink: 0;
  opacity: 0.5;
  transition: transform 0.2s;
}

.multi-select-dropdown.open .multi-select-arrow {
  transform: rotate(180deg);
}

.multi-select-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.multi-select-placeholder {
  color: var(--text-muted, rgba(255,255,255,0.4));
  font-size: 0.9rem;
  user-select: none;
}

.multi-select-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--primary, #6366f1);
  color: #fff;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.6;
}

.multi-select-tag .tag-remove {
  cursor: pointer;
  opacity: 0.7;
  font-size: 0.85rem;
  line-height: 1;
  transition: opacity 0.15s;
  display: inline-flex;
  align-items: center;
}

.multi-select-tag .tag-remove:hover {
  opacity: 1;
}

.multi-select-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-card, #1a1d2e);
  border: 1px solid var(--border-color, rgba(255,255,255,0.12));
  border-radius: var(--radius, 8px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.4);
  max-height: 260px;
  overflow: hidden;
  flex-direction: column;
}

.multi-select-dropdown.open .multi-select-panel {
  display: flex;
}

.multi-select-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
}

.multi-select-search {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-input, rgba(255,255,255,0.06));
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: 6px;
  color: var(--text-primary, #fff);
  font-size: 0.85rem;
  outline: none;
}

.multi-select-search:focus {
  border-color: var(--primary, #6366f1);
}

.multi-select-options {
  overflow-y: auto;
  padding: 4px;
  flex: 1;
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.multi-select-option:hover {
  background: rgba(99, 102, 241, 0.1);
}

.multi-select-option.selected {
  background: rgba(99, 102, 241, 0.15);
}

.multi-select-option .option-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color, rgba(255,255,255,0.2));
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.multi-select-option.selected .option-checkbox {
  background: var(--primary, #6366f1);
  border-color: var(--primary, #6366f1);
}

.multi-select-option .option-checkbox svg {
  opacity: 0;
  transition: opacity 0.15s;
}

.multi-select-option.selected .option-checkbox svg {
  opacity: 1;
}

.multi-select-option .option-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary, #6366f1), #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.multi-select-option .option-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.multi-select-option .option-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multi-select-option .option-role {
  font-size: 0.72rem;
  color: var(--text-muted, rgba(255,255,255,0.4));
}

/* ── Stacked Avatar Group (ticket cards & list) ─────────────────── */
.assignee-avatar-group {
  display: flex;
  align-items: center;
}

.assignee-avatar-group .assignee-avatar {
  margin-left: -6px;
  border: 2px solid var(--bg-card, #1a1d2e);
  position: relative;
}

.assignee-avatar-group .assignee-avatar:first-child {
  margin-left: 0;
}

.assignee-avatar-group .avatar-overflow {
  margin-left: -6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary, rgba(255,255,255,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted, rgba(255,255,255,0.5));
  border: 2px solid var(--bg-card, #1a1d2e);
}

.ticket-assignee .assignee-names {
  font-size: 0.82rem;
  color: var(--text-secondary, rgba(255,255,255,0.7));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

