/* -------------------------------------------------------------
 * iFlyCalendar - Premium Trello Clone Style System (Vanilla CSS)
 * ------------------------------------------------------------- */

/* Custom CSS Variables & Themes */
:root[data-theme="dark"] {
  --font-family-sans: 'Inter', sans-serif;
  --font-family-title: 'Outfit', sans-serif;

  /* Color Palette */
  --bg-primary: #12131a;
  --bg-secondary: #1a1c24;
  --bg-tertiary: #232630;
  --border-color: #2e3240;
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-color: #5865f2;
  --accent-hover: #4752c4;
  --accent-light: rgba(88, 101, 242, 0.15);

  /* Status Colors */
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.15);
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.15);
  --color-info: #3b82f6;
  --color-info-bg: rgba(59, 130, 246, 0.15);

  /* Card Colors & Overlays */
  --card-bg: #1e202b;
  --card-hover: #262936;
  --list-bg: #15161e;
  --list-header-hover: #222430;
  --header-bg: rgba(26, 28, 36, 0.75);
  --sidebar-bg: #0f1016;

  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-round: 9999px;

  /* Board Background Fallbacks */
  --board-bg-default: #1e293b;
}

:root[data-theme="light"] {
  --font-family-sans: 'Inter', sans-serif;
  --font-family-title: 'Outfit', sans-serif;

  /* Color Palette */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --border-color: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --accent-color: #4f46e5;
  --accent-hover: #4338ca;
  --accent-light: rgba(79, 70, 229, 0.1);

  /* Status Colors */
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-warning: #d97706;
  --color-warning-bg: rgba(217, 119, 6, 0.15);
  --color-danger: #dc2626;
  --color-danger-bg: rgba(220, 38, 38, 0.15);
  --color-info: #2563eb;
  --color-info-bg: rgba(37, 99, 235, 0.15);

  /* Card Colors & Overlays */
  --card-bg: #ffffff;
  --card-hover: #f8fafc;
  --list-bg: #f1f5f9;
  --list-header-hover: #e2e8f0;
  --header-bg: rgba(255, 255, 255, 0.75);
  --sidebar-bg: #f8fafc;

  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-round: 9999px;

  /* Board Background Fallbacks */
  --board-bg-default: #e2e8f0;
}

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

html, body {
  width: 100%;
  height: 100vh;
  font-family: var(--font-family-sans);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* App Containers */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.app-sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

.app-sidebar.collapsed {
  width: 70px;
}

.sidebar-header {
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

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

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #5865f2 0%, #8a2be2 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.brand-name {
  font-family: var(--font-family-title);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sidebar-toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background-color 0.2s;
}

.sidebar-toggle-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.app-sidebar.collapsed .sidebar-toggle-btn i {
  transform: rotate(180deg);
}

.app-sidebar.collapsed .brand-name,
.app-sidebar.collapsed .sidebar-nav span,
.app-sidebar.collapsed .sidebar-section .section-title span,
.app-sidebar.collapsed .sidebar-section .add-board-btn-mini,
.app-sidebar.collapsed .sidebar-boards-list span,
.app-sidebar.collapsed .user-info {
  display: none;
}

.app-sidebar.collapsed .sidebar-boards-list li button {
  justify-content: center;
  padding: 10px 0;
}

.app-sidebar.collapsed .sidebar-boards-list .board-dot {
  margin: 0;
}

.sidebar-nav {
  padding: 16px 8px;
}

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

.nav-item {
  width: 100%;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

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

.nav-item.active {
  background-color: var(--accent-light);
  color: var(--accent-color);
}

.sidebar-section {
  flex-grow: 1;
  padding: 16px 8px;
  overflow-y: auto;
  border-top: 1px solid var(--border-color);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 8px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.add-board-btn-mini {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  width: 20px;
  height: 20px;
  transition: background-color 0.2s;
}

.add-board-btn-mini:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.sidebar-boards-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-boards-list li button {
  width: 100%;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: left;
  transition: all 0.2s;
}

.sidebar-boards-list li button:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.sidebar-boards-list li.active button {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 500;
}

.board-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.05);
}

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

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-round);
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* App Main Canvas Layout */
.app-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Top App Header Styling (Glassmorphic) */
.app-header {
  height: 64px;
  background-color: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 90;
}

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

.mobile-menu-btn {
  display: none;
  color: var(--text-secondary);
}

.breadcrumb {
  font-family: var(--font-family-title);
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.breadcrumb span.separator {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.95rem;
}

.breadcrumb span.board-title-text {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* Search bar styling */
.search-bar {
  display: flex;
  align-items: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  width: 240px;
  transition: all 0.2s ease;
  position: relative;
}

.search-bar:focus-within {
  width: 280px;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.search-icon {
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  margin-right: 8px;
}

.search-bar input {
  width: 100%;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.clear-search-btn {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 4px;
}

.clear-search-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Filter Dropdown Styling */
.filter-dropdown-container {
  position: relative;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.header-btn:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.filter-badge {
  background-color: var(--accent-color);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-round);
}

.filter-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
}

.filter-dropdown.show {
  display: flex;
}

.filter-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.clear-filters-link {
  font-size: 0.75rem;
  color: var(--accent-color);
  font-weight: 500;
}

.clear-filters-link:hover {
  text-decoration: underline;
}

.filter-labels-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.filter-label-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s;
}

.filter-label-item:hover {
  background-color: var(--bg-tertiary);
}

.filter-label-item input {
  cursor: pointer;
}

.filter-label-pill {
  flex-grow: 1;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  color: white;
  text-align: left;
}

/* View toggle buttons */
.view-toggles {
  display: flex;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.view-toggle-btn.active {
  background-color: var(--card-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Theme Toggle Button icon states */
#theme-toggle .sun-icon {
  display: none;
}
#theme-toggle .moon-icon {
  display: block;
}
:root[data-theme="light"] #theme-toggle .sun-icon {
  display: block;
}
:root[data-theme="light"] #theme-toggle .moon-icon {
  display: none;
}

/* App Viewport viewport container */
.app-viewport {
  flex-grow: 1;
  width: 100%;
  height: calc(100% - 64px);
  position: relative;
  overflow: hidden;
}

/* -------------------------------------------------------------
 * VIEW: Dashboard Component
 * ------------------------------------------------------------- */
.dashboard-view {
  width: 100%;
  height: 100%;
  padding: 40px;
  overflow-y: auto;
}

.dashboard-title-section {
  margin-bottom: 32px;
}

.dashboard-title-section h1 {
  font-family: var(--font-family-title);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.dashboard-title-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.dashboard-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-family-title);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.dashboard-section-title i {
  color: var(--accent-color);
}

.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.board-card {
  height: 120px;
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s;
  overflow: hidden;
  background-color: var(--board-bg-default);
}

.board-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.board-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s;
  z-index: 1;
}

.board-card:hover .board-card-overlay {
  background: rgba(0, 0, 0, 0.25);
}

.board-card-title {
  font-family: var(--font-family-title);
  font-size: 1.1rem;
  font-weight: 700;
  z-index: 2;
  position: relative;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.board-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  position: relative;
}

.board-card-star {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-round);
}

.board-card-star:hover {
  color: #fbbf24;
  background-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.board-card-star.starred {
  color: #fbbf24;
}

.board-card-delete {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s, background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-round);
}

.board-card-delete:hover {
  color: var(--color-danger);
  background-color: rgba(255, 255, 255, 0.15);
}

.create-board-card {
  height: 120px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.create-board-card:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background-color: var(--accent-light);
}

/* -------------------------------------------------------------
 * VIEW: Board Canvas Layout
 * ------------------------------------------------------------- */
.board-canvas-view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: background-image 0.4s ease, background-color 0.4s ease;
}

.board-menu-bar {
  height: 52px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  z-index: 10;
}

.board-menu-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.board-title-input {
  background: transparent;
  color: white;
  font-family: var(--font-family-title);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color 0.2s, border-color 0.2s;
  cursor: pointer;
}

.board-title-input:focus {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--accent-color);
  cursor: text;
}

.board-star-toggle {
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.board-star-toggle:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fbbf24;
}

.board-star-toggle.starred {
  color: #fbbf24;
}

.board-menu-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.board-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
}

.board-menu-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

/* Horizontal Lists Scroll Container */
.lists-container {
  flex-grow: 1;
  display: flex;
  gap: 16px;
  padding: 16px 24px;
  overflow-x: auto;
  align-items: flex-start;
  user-select: none;
  scrollbar-width: auto;
}

/* List Column styling */
.list-column {
  width: 272px;
  background-color: var(--list-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: 100%;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s, opacity 0.15s;
}

.list-column.dragging {
  opacity: 0.4;
  transform: scale(0.96);
}

.list-column.drag-over {
  border-color: var(--accent-color);
}

.list-header {
  padding: 12px 14px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
}

.list-header:active {
  cursor: grabbing;
}

.list-title-input {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 80%;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.list-title-input:focus {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}

.list-actions-btn {
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.list-actions-btn:hover {
  background-color: var(--list-header-hover);
  color: var(--text-primary);
}

/* Scrollable cards container inside list */
.list-cards {
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex-grow: 1;
  min-height: 20px; /* Crucial for empty lists drag target */
}

/* Custom list-cards scrollbar styling */
.list-cards::-webkit-scrollbar {
  width: 6px;
}
.list-cards::-webkit-scrollbar-track {
  background: transparent;
}
.list-cards::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

/* Individual Card component */
.card-item {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
  overflow: hidden;
}

.card-item.dragging {
  opacity: 0.3;
  transform: rotate(2deg) scale(0.96);
  box-shadow: var(--shadow-lg);
}

.card-item.drag-over {
  border-top: 2px solid var(--accent-color);
}

.card-item:hover {
  border-color: var(--text-muted);
  box-shadow: var(--shadow-md);
}

.card-cover-bar {
  height: 32px;
  margin: -12px -12px 4px -12px;
}

.card-labels-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-label-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  color: white;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-item-title {
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--text-primary);
  line-height: 1.4;
  word-wrap: break-word;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  align-items: center;
  margin-top: 4px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge i {
  width: 13px;
  height: 13px;
}

.badge-due-date {
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
}

.badge-due-date.overdue {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
}

.badge-due-date.soon {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-due-date.completed {
  background-color: var(--color-success-bg);
  color: var(--color-success);
}

/* Card add control styles */
.add-card-container {
  padding: 8px 10px;
}

.add-card-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  transition: background-color 0.2s;
}

.add-card-btn:hover {
  background-color: var(--list-header-hover);
  color: var(--text-primary);
}

.card-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-sm);
}

.card-composer textarea {
  width: 100%;
  min-height: 54px;
  resize: none;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-btn {
  background-color: var(--accent-color);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s;
}

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

.secondary-btn {
  background-color: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.secondary-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* List add control styles */
.add-list-column {
  width: 272px;
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  padding: 8px;
  transition: all 0.2s;
}

.add-list-column:hover {
  background-color: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.add-list-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 14px;
}

.list-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--list-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px;
}

.list-composer input {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* -------------------------------------------------------------
 * MODALS OVERLAY & ANIMATIONS
 * ------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
}

/* Board Creator Modal Specific */
.board-creator-modal {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 580px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .board-creator-modal {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-family: var(--font-family-title);
  font-weight: 700;
  font-size: 1.15rem;
}

.close-modal-btn {
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.close-modal-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.board-creator-content {
  padding: 20px;
  display: flex;
  gap: 20px;
}

.board-preview {
  width: 200px;
  height: 140px;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  background-color: var(--board-bg-default);
  color: white;
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

.board-preview-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 2;
}

.preview-title {
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.preview-icon {
  align-self: flex-end;
  opacity: 0.3;
}

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

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

.form-group input {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.9rem;
  color: var(--text-primary);
  width: 100%;
}

.form-group input:focus {
  border-color: var(--accent-color);
}

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

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

.bg-option-box {
  height: 36px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}

.bg-option-box:hover {
  transform: scale(1.05);
}

.bg-option-box.selected {
  border-color: var(--accent-color);
}

.submit-board-btn {
  width: 100%;
  padding: 10px;
  font-size: 0.9rem;
  margin-top: 8px;
}

/* -------------------------------------------------------------
 * VIEW: Card Detail Inspector Modal
 * ------------------------------------------------------------- */
.card-detail-modal {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 760px;
  max-width: 95vw;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.2);
  display: flex;
  flex-direction: column;
}

.modal-overlay.show .card-detail-modal {
  transform: scale(1);
}

.card-modal-cover {
  height: 120px;
  background-color: var(--bg-tertiary);
  position: relative;
}

.card-modal-cover-actions {
  position: absolute;
  bottom: 12px;
  right: 12px;
}

.cover-color-btn {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cover-color-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.card-modal-body {
  padding: 24px;
  display: flex;
  gap: 24px;
}

.card-modal-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 70%;
}

.card-modal-sidebar {
  width: 30%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex-shrink: 0;
}

/* Modal sections layouts */
.modal-section {
  display: flex;
  gap: 16px;
}

.section-icon {
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-top: 4px;
}

.section-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Header Section */
.card-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 0 24px;
}

.modal-title-input {
  font-family: var(--font-family-title);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  width: 90%;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.modal-title-input:focus {
  background-color: var(--bg-tertiary);
  border-color: var(--border-color);
}

.card-modal-list-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 6px;
  margin-top: 4px;
}

.card-modal-list-desc span {
  text-decoration: underline;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Card details sub-badges info */
.card-modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-left: 40px;
  margin-top: -12px;
  padding-bottom: 8px;
}

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

.modal-badge-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.modal-labels-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.modal-label-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  color: white;
}

.modal-due-date-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
}

.due-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.due-text {
  font-weight: 600;
}

.due-status-tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  color: white;
}

.due-status-tag.overdue { background-color: var(--color-danger); }
.due-status-tag.completed { background-color: var(--color-success); }
.due-status-tag.soon { background-color: var(--color-warning); }

/* Description editor */
.description-text {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
  cursor: pointer;
  padding: 8px 12px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  min-height: 54px;
}

.description-text:hover {
  background-color: var(--border-color);
}

.description-text.empty {
  color: var(--text-muted);
  font-style: italic;
}

.description-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.description-editor textarea {
  width: 100%;
  min-height: 100px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.5;
  resize: vertical;
}

/* Checklists styling */
.checklist-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.checklist-title {
  font-family: var(--font-family-title);
  font-size: 1rem;
  font-weight: 600;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.progress-pct {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 32px;
  text-align: right;
}

.progress-bar-bg {
  flex-grow: 1;
  height: 8px;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--color-success);
  width: 0;
  transition: width 0.3s ease;
}

.checklist-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s;
  group: true;
}

.checklist-item:hover {
  background-color: var(--bg-tertiary);
}

.checklist-item-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checklist-item-text {
  flex-grow: 1;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid transparent;
}

.checklist-item.checked .checklist-item-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.checklist-item-text:focus {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  text-decoration: none !important;
}

.delete-checklist-item {
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  padding: 2px;
  border-radius: 4px;
}

.checklist-item:hover .delete-checklist-item {
  opacity: 1;
}

.delete-checklist-item:hover {
  color: var(--color-danger);
  background-color: rgba(239, 68, 68, 0.1);
}

.add-checklist-item-container {
  margin-left: 26px;
}

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

.item-composer input {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* Comments section */
.comments-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-input-box {
  display: flex;
  gap: 12px;
}

.comment-editor-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  transition: border-color 0.2s;
}

.comment-editor-wrapper:focus-within {
  border-color: var(--accent-color);
}

.comment-editor-wrapper textarea {
  width: 100%;
  min-height: 40px;
  font-size: 0.85rem;
  color: var(--text-primary);
  resize: none;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-item {
  display: flex;
  gap: 12px;
}

.comment-bubble {
  flex-grow: 1;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.comment-author {
  font-size: 0.8rem;
  font-weight: 600;
}

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

.comment-text {
  font-size: 0.85rem;
  line-height: 1.4;
  word-break: break-word;
}

.comment-bubble-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.delete-comment-btn {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.delete-comment-btn:hover {
  color: var(--color-danger);
  text-decoration: underline;
}

/* Activity Log section */
.activities-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 6px;
}

.activity-item {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.activity-dot {
  width: 8px;
  height: 8px;
  background-color: var(--border-color);
  border-radius: var(--radius-round);
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-item-content {
  display: flex;
  flex-direction: column;
}

.activity-text {
  color: var(--text-primary);
}

.activity-text span.user-ref {
  font-weight: 600;
}

.activity-text span.action-ref {
  font-weight: 500;
  color: var(--text-secondary);
}

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

/* Sidebar Actions Panel */
.sidebar-action-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-action-group-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.sidebar-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  transition: all 0.15s;
}

.sidebar-action-btn:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

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

/* Label Editor and Date Picker Popovers */
.popover-card {
  position: absolute;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 240px;
  padding: 16px;
  z-index: 1010;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.popover-title {
  color: var(--text-primary);
}

.popover-close-btn {
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popover-close-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.labels-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.label-selector-pill {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  position: relative;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.label-selector-pill i {
  width: 14px;
  height: 14px;
}

.label-edit-btn {
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
}

.label-edit-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Date picker popover */
.date-picker-popover {
  width: 260px;
}

.date-picker-popover input[type="date"] {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  width: 100%;
}

/* Cover selector popover */
.cover-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.cover-picker-box {
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s;
}

.cover-picker-box:hover {
  transform: scale(1.1);
}

.cover-picker-box.selected {
  border-color: var(--accent-color);
}

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

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

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

/* Responsiveness adjustments */
@media (max-width: 768px) {
  .app-sidebar {
    position: absolute;
    left: -260px;
    height: 100%;
    z-index: 200;
  }
  
  .app-sidebar.show-mobile {
    left: 0;
    width: 260px;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .search-bar {
    display: none; /* Hide search bar on smaller devices for header space */
  }

  .card-detail-modal {
    width: 95vw;
  }

  .card-modal-body {
    flex-direction: column;
    gap: 16px;
  }

  .card-modal-main {
    width: 100%;
  }

  .card-modal-sidebar {
    width: 100%;
  }
}

/* -------------------------------------------------------------
 * Auth & Login Screen Styling
 * ------------------------------------------------------------- */
.auth-viewport-wrapper {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 10% 20%, rgba(88, 101, 242, 0.2) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(138, 43, 226, 0.2) 0%, transparent 40%),
              var(--bg-primary);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2000;
}

.auth-card {
  width: 400px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.auth-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

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

.auth-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #5865f2 0%, #8a2be2 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.auth-brand-name {
  font-family: var(--font-family-title);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

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

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

.auth-select {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.88rem;
  color: var(--text-primary);
  width: 100%;
  cursor: pointer;
  outline: none;
}

.auth-submit-btn {
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  color: white;
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px 0 rgba(88, 101, 242, 0.4);
  transition: all 0.2s;
  margin-top: 8px;
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(88, 101, 242, 0.5);
}

.auth-toggle-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.auth-toggle-link button {
  color: var(--accent-color);
  font-weight: 600;
}

.auth-toggle-link button:hover {
  text-decoration: underline;
}

.auth-error-banner {
  background-color: var(--color-danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-danger);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-help-panel {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.75rem;
}

.help-title {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.help-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-muted);
}

.help-list strong {
  color: var(--text-secondary);
}

/* Observer Banner Warning Header */
.observer-warning-header {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  padding: 6px 0;
  letter-spacing: 0.5px;
  z-index: 10;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Sidebar Logout Button footer adjustments */
.sidebar-logout-btn {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-logout-btn:hover {
  color: var(--color-danger);
}

/* --- Description Editor Markdown Toolbar --- */
.markdown-toolbar {
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  background-color: var(--bg-tertiary);
  padding: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.toolbar-btn {
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toolbar-btn:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

/* --- Members List & Avatars --- */
.modal-members-list {
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-avatar-badge {
  border: 2px solid var(--bg-secondary);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.member-avatar-badge:hover {
  transform: scale(1.1);
  z-index: 10;
}

/* --- Custom Fields --- */
.modal-custom-fields-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.custom-field-badge {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.delete-custom-field-badge-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: all 0.15s;
}

.delete-custom-field-badge-btn:hover {
  opacity: 1;
  color: var(--color-danger);
}

/* --- Attachments --- */
.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachment-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.2s;
}

.attachment-item-row:hover {
  background-color: var(--bg-tertiary);
}

.attachment-thumbnail {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  transition: background-color 0.2s;
}

.attachment-item-row:hover .attachment-thumbnail {
  background-color: var(--border-color) !important;
}

.attachment-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.delete-attachment-btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s;
}

.delete-attachment-btn-link:hover {
  color: var(--color-danger);
}

/* --- Popover Dropdown Menu List --- */
.popover-menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}

.popover-menu-item {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background-color 0.15s;
}

.popover-menu-item:hover {
  background-color: var(--bg-tertiary) !important;
}

.member-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.member-picker-row:hover {
  background-color: var(--bg-tertiary) !important;
}

.quick-action-link {
  transition: background-color 0.2s, color 0.2s;
}

.quick-action-link:hover {
  background-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

/* -------------------------------------------------------------
 * Premium Visual Dates Picker Popover & Badge styling
 * ------------------------------------------------------------- */

/* Due Date Inspector Button */
.modal-due-date-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 32px;
}

.modal-due-date-btn:hover {
  background-color: var(--border-color);
  border-color: var(--text-muted);
}

.modal-due-date-btn .due-status-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  color: #ffffff;
  margin-left: 4px;
}

.modal-due-date-btn .due-status-tag.completed { background-color: var(--color-success); }
.modal-due-date-btn .due-status-tag.overdue { background-color: var(--color-danger); }
.modal-due-date-btn .due-status-tag.soon { background-color: var(--color-warning); }

/* Fallback/Neutral Card Badges */
.badge-due-date.fallback-date {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border-left: none;
}

.badge-due-date.fallback-date:hover {
  background-color: var(--border-color);
}

/* Card Initials Badge */
.card-members-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  padding-left: 8px;
}

.card-member-initials {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff !important;
  border: 1.5px solid var(--card-bg);
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  user-select: none;
}

/* Dates Popover Layout Styles */
.date-picker-popover {
  width: 300px !important;
  padding: 12px;
}

.picker-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.picker-nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.picker-nav-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.picker-month-year-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: center;
}

.picker-weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 6px;
}

.picker-weekday-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.picker-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 12px;
}

.picker-day-cell {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.picker-day-cell:hover {
  background-color: var(--bg-tertiary);
}

.picker-day-cell.muted {
  color: var(--text-muted);
  opacity: 0.5;
}

.picker-day-cell.selected {
  background-color: #e0f2fe !important;
  color: #0284c7 !important;
  font-weight: 700;
}

/* Fields Grid inside Popover */
.picker-fields-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.picker-field-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.picker-field-input {
  flex-grow: 1;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 6px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
}

.picker-field-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.picker-dropdown-select {
  width: 100%;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 6px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.picker-dropdown-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.picker-info-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 8px 0;
}

/* -------------------------------------------------------------
 * Premium Admin Settings Layout & Control Panel Styling
 * ------------------------------------------------------------- */
.admin-settings-view {
  width: 100%;
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  overflow-y: auto;
}

.admin-title-section {
  margin-bottom: 24px;
  flex-shrink: 0;
}

.admin-title-section h1 {
  font-family: var(--font-family-title);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.admin-title-section p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-split-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .admin-split-layout {
    grid-template-columns: 1fr;
  }
}

.admin-card-pane {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pane-title {
  font-family: var(--font-family-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin: 0;
}

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

.admin-error-banner,
.admin-success-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.4;
}

.admin-error-banner {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.admin-success-banner {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

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

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

.users-table th {
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

.users-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

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

.table-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.self-tag {
  font-size: 0.72rem;
  color: var(--accent-color);
  font-weight: 600;
  margin-left: 4px;
}

.user-role-select {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.user-role-select:focus {
  border-color: var(--accent-color);
}

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

.delete-user-btn:hover {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  transform: scale(1.05);
}

.text-muted-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.role-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.role-badge.role-admin {
  background-color: var(--accent-light);
  color: var(--accent-color);
}

