/* CSS Variable Design System */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --border-hover: rgba(255, 255, 255, 0.15);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-color: #10b981; /* Emerald Green */
  --accent-glow: rgba(16, 185, 129, 0.4);
  
  --success: #10b981; /* Emerald */
  --warning: #f59e0b; /* Amber */
  --danger: #f43f5e; /* Rose */
  --info: #0ea5e9; /* Sky */
  
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}

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

body {
  background: radial-gradient(circle at 50% 0%, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Main Header */
.main-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-area .icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.4));
}

.logo-area h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-area .subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Badges */
.badge {
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge.read-only {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.read-write {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* Stats Overview */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem; /* sits at the bottom of the page now */
}

/* Top search bar (sits at the top of the task column, beside the sidebar) */
.top-search {
  margin-bottom: 4px;
}
.top-search .search-wrapper #loader {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

/* Header row + tasks rendered as one flush table */
.task-table {
  display: flex;
  flex-direction: column;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.text-danger .stat-number { color: var(--danger); }
.text-warning .stat-number { color: var(--warning); }
.text-success .stat-number { color: var(--success); }

/* Main Content Layout */
.main-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
}

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

/* Sidebar Styling */
.sidebar {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

/* Search Wrapper */
.search-wrapper {
  position: relative;
  width: 100%;
}

.search-wrapper input,
#search-input {
  width: 100%;
  /* generous left padding so the text/placeholder starts to the right of the icon */
  padding: 0.75rem 1rem 0.75rem 3rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
  box-sizing: border-box;
}

.search-wrapper input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 10px var(--accent-glow);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sort Controls */
.sort-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sort-group {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: flex-end;
}

.sort-group label {
  grid-column: 1 / span 2;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* Select Wrapper */
.select-wrapper {
  position: relative;
  width: 100%;
}

.select-wrapper select {
  width: 100%;
  padding: 0.75rem 2rem 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  appearance: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.select-wrapper select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.select-wrapper::after {
  content: "▼";
  font-size: 0.65rem;
  color: var(--text-muted);
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Sort Dir Button */
.btn-sort-dir {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  width: 2.75rem;
  height: 2.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-sort-dir:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Filter Pills & Tags */
.filter-pills, .filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.pill:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.pill.active {
  background: var(--accent-color);
  color: var(--text-primary);
  border-color: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
}

.tag-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tag-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.tag-btn.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-color);
  border-color: var(--accent-color);
}

/* Task Content Section */
.task-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.task-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.task-header-row h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.view-toggles {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Spinner */
.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid transparent;
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Buttons */
.btn {
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: #f43f5e;
  color: #fff;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
}

/* Tasks Grid/List */
.tasks-grid {
  display: flex;
  flex-direction: column;
  overflow: hidden; /* crop rows to the rounded corners (priority bars stay round) */
  box-shadow: var(--shadow-sm);
  gap: 0;
}

/* Table Column Header Row */
.task-list-header-row {
  display: grid;
  /* 4 cols: status | taak | ruimte | duur */
  grid-template-columns: 32px minmax(0, 1fr) 120px 80px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.01);
}

.task-list-header-row > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-only {
  display: none !important;
}

/* Task Card (Row container) Style */
.task-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  box-shadow: none;
  position: relative;
  overflow: hidden; /* crop content so the left priority bar follows the rounded corners */
}

.task-card:last-child {
  border-bottom: none;
}

.task-card:hover {
  background: rgba(255, 255, 255, 0.02);
}

.task-card.expanded {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
}

.task-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  z-index: 2;
}

.task-card.priority-high::before { background: var(--danger); }
.task-card.priority-medium::before { background: var(--warning); }
.task-card.priority-low::before { background: var(--success); }
.task-card.status-done::before { background: var(--success); }

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

.task-card.expanded {
  border-color: var(--accent-color);
  border-left: 0px;
}

/* Main Row Grid Layout (Desktop) */
.task-card-main {
  display: grid;
  /* 4 cols: status/x-x | titel | ruimte | duur */
  grid-template-columns: 32px minmax(0, 1fr) 120px 80px;
  gap: 8px;
  align-items: center;
  padding: 6px 12px;
  cursor: pointer;
  width: 100%;
}

/* Title cell: progress chip + note dot sit before the title */
.task-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

/* Notities label row inside the accordion: label left, edit button right */
.expanded-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.expanded-notes-header .expanded-notes-label { margin-bottom: 0; }

/* Note badge slot collapses when empty */
.note-badge-slot:empty { display: none; }

/* Subtaken progress occupies the first column, same width as the old checkbox
   (so all rows stay aligned/symmetric even when a task has no subtaken). */
.subtaken-progress-slot {
  width: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.task-card-header .task-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-card-header .btn-edit-modal {
  flex-shrink: 0;
}

.task-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card.status-done .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-card-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}

/* Duur (last column) hugs the right edge so right padding matches the left */
.task-card-main > .task-card-cell:last-child {
  display: flex;
  justify-content: flex-end;
}
.task-list-header-row > div:last-child {
  text-align: right;
}

/* Meta badges */
.meta-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  display: inline-flex;
}

/* Dynamic Color Badges for Categories */
.meta-badge.category {
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.meta-badge.category.cat-afwerking {
  background: rgba(139, 92, 246, 0.12); /* Purple */
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.meta-badge.category.cat-montage {
  background: rgba(14, 165, 233, 0.12); /* Sky Blue */
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.meta-badge.category.cat-elektra {
  background: rgba(245, 158, 11, 0.12); /* Amber */
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.meta-badge.category.cat-schoonmaak {
  background: rgba(16, 185, 129, 0.12); /* Emerald */
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.meta-badge.category.cat-schilderwerk {
  background: rgba(244, 63, 94, 0.12); /* Rose */
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

/* Dynamic Color Badges for Rooms */
.meta-badge.room {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.meta-badge.room.room-keuken {
  background: rgba(236, 72, 153, 0.08); /* Pink */
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.18);
}

.meta-badge.room.room-hal {
  background: rgba(14, 165, 233, 0.08); /* Sky */
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.18);
}

.meta-badge.room.room-slaapkamer {
  background: rgba(99, 102, 241, 0.08); /* Indigo */
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.18);
}

.meta-badge.room.room-badkamer {
  background: rgba(20, 184, 166, 0.08); /* Teal */
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.18);
}

.meta-badge.room.room-huis {
  background: rgba(148, 163, 184, 0.08); /* Slate */
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.meta-badge.room.room-garage {
  background: rgba(245, 158, 11, 0.08); /* Amber */
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.meta-badge.room.room-woonkamer {
  background: rgba(168, 85, 247, 0.08); /* Purple */
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.18);
}

.meta-badge.room.room-lotte {
  background: rgba(239, 68, 68, 0.08); /* Red */
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.18);
}

.meta-badge.room.room-bijkeuken {
  background: rgba(34, 197, 94, 0.08); /* Green */
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.18);
}

.meta-badge.room.room-zolder {
  background: rgba(234, 179, 8, 0.08); /* Yellow */
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.18);
}

.meta-badge.duration {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.meta-badge.duration.dur-uren {
  background: rgba(16, 185, 129, 0.12); /* Green */
  color: #4ade80;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.meta-badge.duration.dur-dag {
  background: rgba(234, 179, 8, 0.12); /* Yellow */
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.2);
}

.meta-badge.duration.dur-dagen {
  background: rgba(249, 115, 22, 0.12) !important; /* Orange */
  color: #fb923c !important;
  border: 1px solid rgba(249, 115, 22, 0.22) !important;
}

.meta-badge.duration.dur-weken {
  background: rgba(239, 68, 68, 0.12); /* Red */
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.meta-badge.priority {
  font-weight: 500;
}
.priority-high .meta-badge.priority { background: rgba(244, 63, 94, 0.08); color: var(--danger); border: 1px solid rgba(244, 63, 94, 0.2); }
.priority-medium .meta-badge.priority { background: rgba(245, 158, 11, 0.08); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.priority-low .meta-badge.priority { background: rgba(16, 185, 129, 0.08); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }

.meta-badge.assignee {
  background: transparent;
  color: #34d399;
  border: none;
  padding: 0;
}

/* Floating Note Badge — hovers in the corner like an app notification */
.note-badge-slot { position: static; }
.task-card-note-badge {
  position: absolute;
  top: 5px;    /* tucked inside the corner, on the radius */
  right: 5px;
  width: 4px;
  height: 4px;
  background: #f59e0b; /* Amber yellow */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.svg-note-icon {
  width: 9px;
  height: 9px;
  stroke: transparent; /* plain amber dot, no visible icon */
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-card.expanded .expand-arrow {
  transform: rotate(180deg);
}

/* Inline Expanded Edit Section */
.task-card-expanded {
  display: none;
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.18);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  /* no open animation — avoids a flicker when the card re-renders on live sync */
}

/* Accordion top row: categorie + uitvoerder (where the Notities label used to be) + edit */
.expanded-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.expanded-meta-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

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

.task-card.expanded .task-card-expanded {
  display: block;
}

/* Edit button on task card */
.btn-edit-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.btn-edit-modal svg { width: 15px; height: 15px; pointer-events: none; }
.btn-edit-modal:hover {
  background: rgba(100, 220, 255, 0.12);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.task-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 4px;
}

/* Accordion notes */
.expanded-notes { margin-bottom: 6px; }
.expanded-notes-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.expanded-notes-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  border-left: 8px solid var(--accent-color);
}
.expanded-no-notes {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-style: italic;
}

/* Subtaken */
.subtaken-section { display: flex; flex-direction: column; gap: 6px; }
.subtaken-list { display: flex; flex-direction: column; gap: 4px; }
.subtaak-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255,255,255,0.03);
  transition: background 0.15s;
}
.subtaak-item:hover { background: rgba(255,255,255,0.07); }
.subtaak-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.subtaak-check.done { background: #22c55e; border-color: #22c55e; color: #fff; }
.subtaak-check:hover { border-color: #22c55e; }
.subtaak-label { flex: 1; font-size: 0.875rem; color: var(--text-secondary); }
.subtaak-label.done { text-decoration: line-through; opacity: 0.5; }
.subtaak-delete {
  background: transparent; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 1rem; line-height: 1;
  padding: 2px 4px; border-radius: 4px;
  opacity: 0; transition: opacity 0.15s;
}
.subtaak-item:hover .subtaak-delete { opacity: 1; }
.subtaak-delete:hover { color: #ef4444; }

.subtaak-add-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.subtaak-input {
  flex: 1;
  height: 36px;
  padding: 0 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}
.subtaak-input:focus { border-color: var(--accent-color); }
.subtaak-input::placeholder { color: var(--text-muted); }
.btn-subtaak-add {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--accent-color);
  color: #0f172a; border: none; cursor: pointer;
  font-size: 1.2rem; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s; flex-shrink: 0;
}
.btn-subtaak-add:hover { opacity: 0.85; }

/* Subtaken progress badge (replaces the status checkbox in column 1) */
.subtaken-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}
.subtaken-progress.all-done {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

/* Editable notes in accordion */
.expanded-notes-edit {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  border-left: 3px solid var(--warning); /* amber, matches the note badge */
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.875rem;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s;
}
.expanded-notes-edit:focus { border-color: var(--warning); }
.expanded-notes-edit::placeholder { color: var(--text-muted); }
.expanded-notes-actions {
  display: flex;
  justify-content: flex-end;
}
.btn-notes-save {
  padding: 5px 14px;
  margin-top: 6px;
  border-radius: 7px;
  border: none;
  background: var(--accent-color);
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: none; /* only takes space once there are changes to save */
}
.btn-notes-save.visible { display: inline-block; }
.btn-notes-save:hover { opacity: 0.85; }


/* Inline Edit Form Grid */
.inline-edit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inline-edit-form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.inline-edit-form .form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inline-edit-form label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.inline-edit-form input[type="text"],
.inline-edit-form select,
.inline-edit-form textarea {
  padding: 0.4rem 0.6rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-family);
  width: 100%;
}

.inline-edit-form input[type="text"]:focus,
.inline-edit-form select:focus,
.inline-edit-form textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

.inline-edit-form textarea {
  resize: vertical;
}

.inline-edit-form .form-actions {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.task-action-btn.btn-complete:hover {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border-color: var(--success);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: #1e293b;
  border: 1px solid var(--border-hover);
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  animation: modalSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

@keyframes modalSlide {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  right: 1.5rem;
  top: 1.25rem;
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

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

label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

input[type="text"], textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 10px var(--accent-glow);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  gap: 1rem;
}

.right-actions {
  display: flex;
  gap: 0.75rem;
  margin-left: auto;
}

/* Toast */
.toast {
  visibility: hidden;
  min-width: 250px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  text-align: center;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  position: fixed;
  z-index: 1100;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  transition: opacity 0.3s, bottom 0.3s;
}

.toast.show {
  visibility: visible;
  opacity: 1;
  bottom: 50px;
}

.toast.success {
  border-color: var(--success);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.toast.error {
  border-color: var(--danger);
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.2);
}

/* Empty State Card */
.no-tasks-card {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
  color: var(--text-secondary);
}

/* Mobile responsive styles & compact card design */
.mobile-only {
  display: none !important;
}

.sidebar-mobile-header {
  display: none;
}

/* Quick Status Circle Button */
.btn-quick-status {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  padding: 0;
}

.status-todo .btn-quick-status {
  border-color: rgba(244, 63, 94, 0.4);
}
.status-todo .btn-quick-status:hover {
  border-color: var(--danger);
  background: rgba(244, 63, 94, 0.1);
}

.status-progress .btn-quick-status {
  border-color: var(--warning);
  background: radial-gradient(circle, var(--warning) 30%, transparent 40%);
}
.status-progress .btn-quick-status:hover {
  background: radial-gradient(circle, var(--warning) 50%, transparent 60%);
}

.status-done .btn-quick-status {
  border-color: var(--success);
  background: var(--success);
}
.status-done .btn-quick-status::after {
  content: "✓";
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
}

.btn-mobile-edit {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.4rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-mobile-edit:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

@media (max-width: 640px) {
  .mobile-only {
    display: inline-flex !important;
  }
  
  .desktop-only {
    display: none !important;
  }
  
  .app-container {
    padding: 0.25rem 0.25rem 1rem 0.25rem;
  }
  
  .main-header {
    margin-bottom: 0.35rem;
    padding-bottom: 0.3rem;
  }
  
  .logo-area h1 {
    font-size: 1.1rem;
  }
  
  .logo-area .icon {
    font-size: 1.3rem;
  }

  .logo-area .subtitle {
    display: none;
  }

  .task-content {
    gap: 0rem;
  }
  
  /* Compact Dashboard Stats (now at the bottom) */
  .stats-overview {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .stat-card {
    padding: 0.3rem 0.15rem;
    border-radius: 8px;
    align-items: center;
    text-align: center;
  }
  
  .stat-label {
    font-size: 0.58rem;
    margin-bottom: 0.1rem;
    line-height: 1.1;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 100%;
  }
  
  .stat-number {
    font-size: 0.95rem;
    font-weight: 600;
  }
  
  .main-layout {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .task-header-row {
    gap: 0.3rem;
  }
  
  .task-header-row h2 {
    font-size: 1.05rem;
  }
  
  .task-header-row .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    height: 28px;
  }
  
  /* Sidebar Drawer Mode */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 2000;
    width: 290px;
    max-width: 85%;
    height: 100vh;
    overflow-y: auto;
    background: #0f172a;
    border-right: 1px solid var(--border-color);
    box-shadow: none;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem;
    border-radius: 0;
  }
  
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8);
  }
  
  .sidebar-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .sidebar-mobile-header h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
  }
  
  .btn-close-sidebar {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.4rem;
  }
  
  /* Backdrop for open drawer */
  body.sidebar-open::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 17, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1999;
    pointer-events: auto;
  }
  
  /* Flexbox-based compact row for mobile */
  .task-card {
    border-radius: 0px 8px 8px 0px;
    margin-bottom: 0px;
    border: 1px solid var(--border-color);
  }

  .task-card::before {
    width: 3px;
  }

  /* Focus effect: while one card is expanded, dim the other tasks */
  .tasks-grid:has(.task-card.expanded) .task-card:not(.expanded) {
    opacity: 0.35;
  }
  
  .task-list-header-row {
    display: none !important;
  }
  
  /* Single-row task on mobile: status/x-x | titel | ruimte | duur */
  .task-card-main {
    grid-template-columns: 32px minmax(0, 1fr) auto auto;
    gap: 6px;
    padding: 8px 10px;
  }

  .task-card-main .btn-quick-status {
    width: 18px;
    height: 18px;
    border-width: 1.5px;
  }

  /* Title may wrap on mobile so it stays readable */
  .task-card-header {
    overflow: visible;
  }
  .task-title {
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
    font-size: 0.85rem;
  }

  .task-cell-ruimte .meta-badge,
  .task-cell-duur .meta-badge {
    font-size: 0.62rem;
    padding: 2px 7px;
  }

  .meta-badge {
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 4px;
    line-height: 1.2;
    white-space: nowrap;
  }
  
  .note-indicator {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .expand-arrow {
    font-size: 0.6rem;
  }
  
  /* Expanded editor mobile optimization */
  .task-card-expanded {
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
  }
  
  .inline-edit-form {
    gap: 8px;
  }
  
  .inline-edit-form .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .inline-edit-form .form-group {
    gap: 2px;
  }
  
  .inline-edit-form label {
    font-size: 0.68rem;
  }
  
  /* 16px font-size to prevent iOS Safari auto-zoom */
  .inline-edit-form input[type="text"],
  .inline-edit-form select,
  .inline-edit-form textarea {
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    font-size: 16px !important;
    height: 38px;
  }
  
  .inline-edit-form textarea {
    height: auto;
    font-size: 16px !important;
  }
  
  .inline-edit-form .form-actions {
    margin-top: 0.5rem;
    padding-top: 0.4rem;
  }
  
  .btn {
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    height: 36px;
  }
  
  /* Modals padding on mobile */
  .modal-content {
    padding: 0.65rem 0.85rem !important;
    border-radius: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  
  .modal h2 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
  }

  .modal-content .form-group {
    margin-bottom: 0.4rem !important;
    gap: 2px !important;
  }

  .modal-content .form-row {
    gap: 6px !important;
  }

  .modal-content label {
    font-size: 0.75rem !important;
    margin-bottom: 0px !important;
  }

  .modal-content .pill-container {
    gap: 4px !important;
    margin-top: 1px !important;
    margin-bottom: 2px !important;
  }

  .modal-content input[type="text"],
  .modal-content textarea {
    padding: 0.35rem 0.5rem !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    height: 32px !important;
  }

  .modal-content textarea {
    height: 50px !important;
  }

  .modal-content .quick-pill-selector {
    gap: 2px !important;
  }

  .modal-content .pill-item {
    font-size: 0.7rem !important;
    padding: 2px 6px !important;
  }

  .modal-content .segmented-control {
    height: 28px !important;
  }

  .modal-content .btn-segment {
    font-size: 0.75rem !important;
    padding: 2px 4px !important;
  }
  
  .modal-content .form-actions {
    margin-top: 0.6rem !important;
  }

  #fab-filters {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    padding: 0;
    margin: 0;
  }
  #fab-filters:active {
    transform: scale(0.92);
  }
  #fab-filters svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
  }
}

/* Floating Action Buttons (FABs) */
#fab-filters {
  display: none;
}

#mobile-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-color);
  border: none;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  cursor: pointer;
  z-index: 100;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0 !important;
  margin: 0 !important;
}

#mobile-fab:active {
  transform: scale(0.92);
}

#mobile-fab svg {
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 !important;
  padding: 0 !important;
}

/* Segmented Control */
.segmented-control {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.btn-segment {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  text-align: center;
}

.btn-segment:not(:last-child) {
  border-right: 1px solid var(--border-color);
}

.btn-segment:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

/* Selected priority styles */
.btn-segment.active.segment-high {
  background: rgba(244, 63, 94, 0.15);
  color: var(--danger);
  font-weight: 600;
}
.btn-segment.active.segment-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  font-weight: 600;
}
.btn-segment.active.segment-low {
  background: rgba(14, 165, 233, 0.15);
  color: var(--info);
  font-weight: 600;
}

/* Selected duration styles */
.btn-segment.active.segment-uren {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  font-weight: 600;
}
.btn-segment.active.segment-dag {
  background: rgba(253, 224, 71, 0.15);
  color: #fde047;
  font-weight: 600;
}
.btn-segment.active.segment-dagen {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  font-weight: 600;
}
.btn-segment.active.segment-weken {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  font-weight: 600;
}

/* Selected status styles */
.btn-segment.active.segment-todo {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  font-weight: 600;
}
.btn-segment.active.segment-progress {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  font-weight: 600;
}
.btn-segment.active.segment-done {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  font-weight: 600;
}

/* Quick Pill Selector */
.quick-pill-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.pill-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.pill-item {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.pill-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  opacity: 0.85;
}

.pill-item.active {
  color: var(--text-primary);
  border-color: currentColor;
  opacity: 1;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.05);
}

/* Specific quick selector colors to match the tags */
.pill-item.cat-montage { border-color: rgba(16, 185, 129, 0.4); color: #34d399; }
.pill-item.cat-elektra { border-color: rgba(245, 158, 11, 0.4); color: var(--warning); }
.pill-item.cat-schilderwerk { border-color: rgba(14, 165, 233, 0.4); color: var(--info); }
.pill-item.cat-afwerking { border-color: rgba(139, 92, 246, 0.4); color: #a78bfa; }
.pill-item.cat-schoonmaak { border-color: rgba(244, 63, 94, 0.4); color: var(--danger); }

.pill-item.cat-montage.active { background: rgba(16, 185, 129, 0.25); color: #34d399; border-color: #10b981; }
.pill-item.cat-elektra.active { background: rgba(245, 158, 11, 0.25); color: var(--warning); border-color: #f59e0b; }
.pill-item.cat-schilderwerk.active { background: rgba(14, 165, 233, 0.25); color: var(--info); border-color: #0ea5e9; }
.pill-item.cat-afwerking.active { background: rgba(139, 92, 246, 0.25); color: #a78bfa; border-color: #8b5cf6; }
.pill-item.cat-schoonmaak.active { background: rgba(244, 63, 94, 0.25); color: var(--danger); border-color: #f43f5e; }

.pill-item.room-keuken { border-color: rgba(244, 63, 94, 0.3); color: var(--danger); }
.pill-item.room-hal { border-color: rgba(16, 185, 129, 0.3); color: var(--success); }
.pill-item.room-slaapkamer { border-color: rgba(139, 92, 246, 0.3); color: #a78bfa; }
.pill-item.room-badkamer { border-color: rgba(14, 165, 233, 0.3); color: var(--info); }
.pill-item.room-huis { border-color: rgba(245, 158, 11, 0.3); color: var(--warning); }
.pill-item.room-garage { border-color: rgba(236, 72, 153, 0.3); color: #f472b6; }
.pill-item.room-woonkamer { border-color: rgba(20, 184, 166, 0.3); color: #2dd4bf; }
.pill-item.room-lotte-kamer, .pill-item.room-lotte { border-color: rgba(168, 85, 247, 0.3); color: #c084fc; }
.pill-item.room-bijkeuken { border-color: rgba(101, 163, 13, 0.3); color: #a3e635; }
.pill-item.room-zolder { border-color: rgba(220, 38, 38, 0.3); color: #f87171; }

.pill-item.room-keuken.active { background: rgba(244, 63, 94, 0.2); color: var(--danger); border-color: #f43f5e; }
.pill-item.room-hal.active { background: rgba(16, 185, 129, 0.2); color: var(--success); border-color: #10b981; }
.pill-item.room-slaapkamer.active { background: rgba(139, 92, 246, 0.2); color: #a78bfa; border-color: #8b5cf6; }
.pill-item.room-badkamer.active { background: rgba(14, 165, 233, 0.2); color: var(--info); border-color: #0ea5e9; }
.pill-item.room-huis.active { background: rgba(245, 158, 11, 0.2); color: var(--warning); border-color: #f59e0b; }
.pill-item.room-garage.active { background: rgba(236, 72, 153, 0.2); color: #f472b6; border-color: #ec4899; }
.pill-item.room-woonkamer.active { background: rgba(20, 184, 166, 0.2); color: #2dd4bf; border-color: #14b8a6; }
.pill-item.room-lotte-kamer.active, .pill-item.room-lotte.active { background: rgba(168, 85, 247, 0.2); color: #c084fc; border-color: #a855f7; }
.pill-item.room-bijkeuken.active { background: rgba(101, 163, 13, 0.2); color: #a3e635; border-color: #65a30d; }
.pill-item.room-zolder.active { background: rgba(220, 38, 38, 0.2); color: #f87171; border-color: #dc2626; }

/* Color coded input fields */
input.cat-montage { background: rgba(16, 185, 129, 0.15) !important; color: #34d399 !important; border-color: rgba(16, 185, 129, 0.3) !important; }
input.cat-elektra { background: rgba(245, 158, 11, 0.15) !important; color: var(--warning) !important; border-color: rgba(245, 158, 11, 0.3) !important; }
input.cat-schilderwerk { background: rgba(14, 165, 233, 0.15) !important; color: var(--info) !important; border-color: rgba(14, 165, 233, 0.3) !important; }
input.cat-afwerking { background: rgba(139, 92, 246, 0.15) !important; color: #a78bfa !important; border-color: rgba(139, 92, 246, 0.3) !important; }
input.cat-schoonmaak { background: rgba(244, 63, 94, 0.15) !important; color: var(--danger) !important; border-color: rgba(244, 63, 94, 0.3) !important; }

input.room-keuken { background: rgba(244, 63, 94, 0.1) !important; color: var(--danger) !important; border-color: rgba(244, 63, 94, 0.25) !important; }
input.room-hal { background: rgba(16, 185, 129, 0.1) !important; color: var(--success) !important; border-color: rgba(16, 185, 129, 0.25) !important; }
input.room-slaapkamer { background: rgba(139, 92, 246, 0.1) !important; color: #a78bfa !important; border-color: rgba(139, 92, 246, 0.25) !important; }
input.room-badkamer { background: rgba(14, 165, 233, 0.1) !important; color: var(--info) !important; border-color: rgba(14, 165, 233, 0.25) !important; }
input.room-huis { background: rgba(245, 158, 11, 0.1) !important; color: var(--warning) !important; border-color: rgba(245, 158, 11, 0.25) !important; }
input.room-garage { background: rgba(236, 72, 153, 0.1) !important; color: #f472b6 !important; border-color: rgba(236, 72, 153, 0.25) !important; }
input.room-woonkamer { background: rgba(20, 184, 166, 0.1) !important; color: #2dd4bf !important; border-color: rgba(20, 184, 166, 0.25) !important; }
input.room-lotte { background: rgba(168, 85, 247, 0.1) !important; color: #c084fc !important; border-color: rgba(168, 85, 247, 0.25) !important; }
input.room-bijkeuken { background: rgba(101, 163, 13, 0.1) !important; color: #a3e635 !important; border-color: rgba(101, 163, 13, 0.25) !important; }
input.room-zolder { background: rgba(220, 38, 38, 0.1) !important; color: #f87171 !important; border-color: rgba(220, 38, 38, 0.25) !important; }

/* Assignee Pill Colors */
.pill-item.assignee-moreno { border-color: rgba(14, 165, 233, 0.4); color: var(--info); }
.pill-item.assignee-opa { border-color: rgba(139, 92, 246, 0.4); color: #a78bfa; }
.pill-item.assignee-an { border-color: rgba(236, 72, 153, 0.4); color: #f472b6; }

.pill-item.assignee-moreno.active { background: rgba(14, 165, 233, 0.25); color: var(--info); border-color: #0ea5e9; }
.pill-item.assignee-opa.active { background: rgba(139, 92, 246, 0.25); color: #a78bfa; border-color: #8b5cf6; }
.pill-item.assignee-an.active { background: rgba(236, 72, 153, 0.25); color: #f472b6; border-color: #ec4899; }

/* Color coded assignee input fields */
input.assignee-moreno { background: rgba(14, 165, 233, 0.15) !important; color: #38bdf8 !important; border-color: rgba(14, 165, 233, 0.3) !important; }
input.assignee-opa { background: rgba(139, 92, 246, 0.15) !important; color: #c084fc !important; border-color: rgba(139, 92, 246, 0.3) !important; }
input.assignee-an { background: rgba(236, 72, 153, 0.15) !important; color: #f472b6 !important; border-color: rgba(236, 72, 153, 0.3) !important; }

/* Color coded assignee badges in task list */
.meta-badge.assignee.assignee-moreno { background: transparent !important; color: #38bdf8 !important; border: none !important; padding: 0 !important; }
.meta-badge.assignee.assignee-opa { background: transparent !important; color: #c084fc !important; border: none !important; padding: 0 !important; }
.meta-badge.assignee.assignee-an { background: transparent !important; color: #f472b6 !important; border: none !important; padding: 0 !important; }

/* Limit Ruimte (Room) and Categorie selection to maximum 2 rows without cropping */
.inline-ruimte-selector .pill-container,
#modal-ruimte-selector .pill-container,
.inline-categorie-selector .pill-container,
#modal-categorie-selector .pill-container {
  max-height: 62px !important;
  overflow: hidden !important;
}

/* Segment button styling - default states (subtle colored border and text) */
.btn-segment.segment-high { border-color: rgba(244, 63, 94, 0.3) !important; color: #ff6b8b; }
.btn-segment.segment-medium { border-color: rgba(245, 158, 11, 0.3) !important; color: var(--warning); }
.btn-segment.segment-low { border-color: rgba(16, 185, 129, 0.3) !important; color: #34d399; }

.btn-segment.segment-high.active { background: rgba(244, 63, 94, 0.25) !important; color: #ff6b8b !important; border-color: #f43f5e !important; }
.btn-segment.segment-medium.active { background: rgba(245, 158, 11, 0.25) !important; color: var(--warning) !important; border-color: #f59e0b !important; }
.btn-segment.segment-low.active { background: rgba(16, 185, 129, 0.25) !important; color: #34d399 !important; border-color: #10b981 !important; }

.btn-segment.segment-uren { border-color: rgba(16, 185, 129, 0.3) !important; color: #34d399; }
.btn-segment.segment-dag { border-color: rgba(253, 224, 71, 0.3) !important; color: #fde047; }
.btn-segment.segment-dagen { border-color: rgba(249, 115, 22, 0.3) !important; color: #fb923c; }
.btn-segment.segment-weken { border-color: rgba(239, 68, 68, 0.3) !important; color: #f87171; }

.btn-segment.segment-uren.active { background: rgba(16, 185, 129, 0.25) !important; color: #34d399 !important; border-color: #10b981 !important; }
.btn-segment.segment-dag.active { background: rgba(253, 224, 71, 0.25) !important; color: #fde047 !important; border-color: #fde047 !important; }
.btn-segment.segment-dagen.active { background: rgba(249, 115, 22, 0.25) !important; color: #fb923c !important; border-color: #fb923c !important; }
.btn-segment.segment-weken.active { background: rgba(239, 68, 68, 0.25) !important; color: #f87171 !important; border-color: #ef4444 !important; }

.btn-segment.segment-todo { border-color: rgba(148, 163, 184, 0.2) !important; color: #cbd5e1; }
.btn-segment.segment-progress { border-color: rgba(245, 158, 11, 0.3) !important; color: var(--warning); }
.btn-segment.segment-done { border-color: rgba(16, 185, 129, 0.3) !important; color: var(--success); }

.btn-segment.segment-todo.active { background: rgba(148, 163, 184, 0.2) !important; color: #cbd5e1 !important; border-color: #94a3b8 !important; }
.btn-segment.segment-progress.active { background: rgba(245, 158, 11, 0.25) !important; color: var(--warning) !important; border-color: #f59e0b !important; }
.btn-segment.segment-done.active { background: rgba(16, 185, 129, 0.25) !important; color: var(--success) !important; border-color: #10b981 !important; }

/* Assignee Segment Button Colors */
.btn-segment.segment-moreno { border-color: rgba(14, 165, 233, 0.3) !important; color: #38bdf8; }
.btn-segment.segment-opa { border-color: rgba(139, 92, 246, 0.3) !important; color: #c084fc; }
.btn-segment.segment-an { border-color: rgba(236, 72, 153, 0.3) !important; color: #f472b6; }

.btn-segment.segment-moreno.active { background: rgba(14, 165, 233, 0.25) !important; color: #38bdf8 !important; border-color: #0ea5e9 !important; }
.btn-segment.segment-opa.active { background: rgba(139, 92, 246, 0.25) !important; color: #c084fc !important; border-color: #8b5cf6 !important; }
.btn-segment.segment-an.active { background: rgba(236, 72, 153, 0.25) !important; color: #f472b6 !important; border-color: #ec4899 !important; }

/* ============================================================
   Login Screen
   ============================================================ */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at 50% 0%, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}
/* Hidden once authenticated */
body.authenticated .login-screen { display: none; }
/* Hide app until authenticated to avoid flash of content */
body:not(.authenticated) .app-container,
body:not(.authenticated) #mobile-fab { display: none !important; }

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 2.5rem 2rem;
  border-radius: 18px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  text-align: center;
  backdrop-filter: blur(16px);
}
.login-logo { font-size: 2.6rem; line-height: 1; margin-bottom: 0.75rem; }
.login-card h1 { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.login-subtitle { font-size: 0.85rem; color: var(--text-muted); margin: 0.4rem 0 1.6rem; }

.login-input-wrapper { margin-bottom: 1rem; }
#login-password {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
#login-password:focus { border-color: var(--accent-color); }

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 0.5rem;
  user-select: none;
}
.login-remember input { width: 16px; height: 16px; accent-color: var(--accent-color); cursor: pointer; }

.login-error {
  min-height: 1.1rem;
  font-size: 0.8rem;
  color: var(--danger);
  margin-bottom: 0.6rem;
  text-align: left;
}
.login-submit { width: 100%; padding: 0.8rem; font-size: 0.95rem; }
.login-card.shake { animation: loginShake 0.4s; }
@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* ============================================================
   Remote-change notification (slides in top-right, non-blocking)
   ============================================================ */
.remote-toast-stack {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 6000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none; /* never sits in front of an input */
}
.remote-toast {
  pointer-events: none;
  max-width: 220px;
  padding: 8px 13px;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-color);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
.remote-toast.show {
  transform: translateX(0);
  opacity: 1;
}

