:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --page: #f6f7fb;          /* Solid page background fixes the "column" */
  --card-bg: #ffffff;
  --radius: 16px;
  --transition: 0.25s ease;
}

/* Reset & base */
* { box-sizing: border-box; }
html {
  height: 100%;
  overflow-y: scroll;   /* always reserve vertical scrollbar space */
}


body {
  min-height: 100svh;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--page);
  display: grid;
  place-items: center;       /* centers the login card */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.app-mode {
  margin: 0;
  min-height: 100svh;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--page);
  display: block;
  padding: 32px 16px 48px;

  /* NEW: always reserve scrollbar space so width doesn't jump */
  overflow-y: scroll;
}



/* ---------- Card ---------- */
.card {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px 36px;
  background: var(--card-bg);       /* solid white, no frosted blur */
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
  text-align: center;
  animation: fade-in 0.45s ease both;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.subtitle {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 24px;
}

/* ---------- Form ---------- */
.field { position: relative; margin-bottom: 14px; }

.field input {
  width: 100%;
  padding: 14px 44px 14px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.field input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: #9ca3af;
  padding: 2px 6px;
  border-radius: 8px;
}

.toggle-password:hover { color: var(--primary); }

/* ---------- Button ---------- */
.btn {
  width: 100%;
  padding: 14px;
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition), transform 0.05s ease;
}

.btn:hover,
.btn:focus-visible { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }

/* ---------- Messages ---------- */
#message {
  margin-top: 14px;
  font-size: 0.93rem;
  font-weight: 500;
  min-height: 1.2em;
}

.error { color: #d52731; }
.success { color: #269f53; }

/* ---------- Logout button ---------- */
/* Tiny logout icon (top-left of the page) */
.logout-icon {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.12);
  transition: background var(--transition), transform 0.05s ease;
  z-index: 1000;
}
.logout-icon i {
  font-size: 14px;   /* slightly larger than before */
  line-height: 1;
}

.logout-icon:hover { background: var(--primary-dark); }
.logout-icon:active { transform: translateY(1px); }

/* ---------- Tasks main layout ---------- */
.tasks-shell {
  max-width: 1040px;   /* match filters/grid/empty */
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}


.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.tasks-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: #0f172a;
}

.tasks-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: #6b7280;
}

/* ---------- Tasks filters ---------- */
.tasks-filters {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eef2ff;              /* very light indigo */
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tasks-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-end;
}

.tasks-filters-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}

.tasks-filters-group--checkbox {
  flex: 1;
  min-width: 220px;
}

.tasks-filters-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: #4b5563;
}

.tasks-filters-select {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 6px 22px 6px 10px;
  font-size: 0.85rem;
  background: #ffffff;
  min-width: 180px;
}

.tasks-filters-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.tasks-filters-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #374151;
}

.tasks-filters-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* Stack filters nicely on small screens */
@media (max-width: 768px) {
  .tasks-filters {
    padding: 8px 10px;
  }

  .tasks-filters-row {
    align-items: stretch;
  }

  .tasks-filters-group,
  .tasks-filters-group--checkbox {
    min-width: 100%;
  }

  .tasks-filters-select {
    width: 100%;
  }
}

/* ---------- Task status chips (GV & số lượng task) ---------- */
.task-status {
  max-width: 1040px;
  width: 100%;
  margin: 4px auto 0;
  padding: 6px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-status-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}

.task-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px dashed #e5e7eb;
  background: #f9fafb;
  font-size: 0.8rem;
  color: #111827;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}


.task-status-chip-name {
  max-width: 140px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.task-status-chip-count {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #111827;
}

/* Màu sắc khác nhau cho từng chip (lặp lại theo 6 màu) */

/* 1 - xanh dương */
.task-status-chips .task-status-chip:nth-child(6n + 1) {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.task-status-chips .task-status-chip:nth-child(6n + 1) .task-status-chip-count {
  background: #dbeafe;
  color: #1d4ed8;
}

/* 2 - xanh lá */
.task-status-chips .task-status-chip:nth-child(6n + 2) {
  background: #ecfdf5;
  border-color: #bbf7d0;
}
.task-status-chips .task-status-chip:nth-child(6n + 2) .task-status-chip-count {
  background: #bbf7d0;
  color: #166534;
}

/* 3 - cam / vàng */
.task-status-chips .task-status-chip:nth-child(6n + 3) {
  background: #fffbeb;
  border-color: #fed7aa;
}
.task-status-chips .task-status-chip:nth-child(6n + 3) .task-status-chip-count {
  background: #fed7aa;
  color: #92400e;
}

/* 4 - tím */
.task-status-chips .task-status-chip:nth-child(6n + 4) {
  background: #f5f3ff;
  border-color: #ddd6fe;
}
.task-status-chips .task-status-chip:nth-child(6n + 4) .task-status-chip-count {
  background: #ddd6fe;
  color: #5b21b6;
}

/* 5 - hồng */
.task-status-chips .task-status-chip:nth-child(6n + 5) {
  background: #fff1f2;
  border-color: #fecdd3;
}
.task-status-chips .task-status-chip:nth-child(6n + 5) .task-status-chip-count {
  background: #fecdd3;
  color: #be123c;
}

/* 6 - xanh ngọc */
.task-status-chips .task-status-chip:nth-child(6n) {
  background: #ecfeff;
  border-color: #a5f3fc;
}
.task-status-chips .task-status-chip:nth-child(6n) .task-status-chip-count {
  background: #a5f3fc;
  color: #0f766e;
}

.task-status-chip--active {
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.task-status-chip--active .task-status-chip-count {
  font-weight: 700;
}

@media (max-width: 768px) {
  .task-status {
    padding-inline: 10px;
  }

  .task-status-chip-name {
    max-width: 110px;
  }
}

.tasks-header-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tasks-new-btn {
  border-radius: 999px;

  border: none;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: #111827;
  color: #f9fafb;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  transition: background var(--transition), transform 0.05s ease, box-shadow var(--transition);
}

.tasks-new-btn:hover {
  background: #020617;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.tasks-new-btn:active {
  transform: translateY(0);
}

/* Grid of note cards */
.tasks-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);

  /* wider column */
  max-width: 1040px;   /* was 800px */
  width: 100%;
  margin: 0 auto;

  gap: 12px;
}


.tasks-item {
  background: #ffffff;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: default;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.tasks-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  border-color: #e5e7eb;
}

.tasks-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.92rem;
  color: #111827;
}

/* Topic (topic_html) – main title line */
.tasks-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1d4ed8;      /* nice blue title */
  margin: 0;
}

/* Remove extra margins inside the topic_html */
.tasks-item-title > * {
  margin: 0;
}

.tasks-item-detail {
  font-size: 0.92rem;
  color: #374151;
  line-height: 1.5;
  margin-top: 2px;

  /* Let the card grow with the content */
  overflow-wrap: anywhere;   /* long words won’t break layout */
}


/* Tighter paragraphs inside details */
.tasks-item-detail p {
  margin: 0 0 4px;
}

.tasks-item-empty {
  font-size: 0.85rem;
  color: #9ca3af;
  font-style: italic;
}

/* NEW: schedule area under each card */
.tasks-schedule {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  font-size: 0.78rem;
  color: #4b5563;
}

.tasks-schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.tasks-schedule-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tasks-schedule-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #111827;
}

.tasks-schedule-title-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #eff6ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  font-size: 0.8rem;
}


/* Date picker inline on the right side of the header */
.tasks-schedule-header-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #6b7280;
}

.tasks-schedule-header-label {
  white-space: nowrap;
}

/* Pill-style date inputs */
.tasks-schedule-date-input {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 3px 8px;
  font-size: 0.78rem;
  background: #ffffff;
}

.tasks-schedule-date-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

/* Compact size for header date inputs */
.tasks-schedule-date-input--compact {
  max-width: 130px;
}

/* On small screens, stack the date picker under the title nicely */
@media (max-width: 640px) {
  .tasks-schedule-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .tasks-schedule-header-dates {
    width: 100%;
    flex-wrap: wrap;
  }
}



.tasks-schedule-tag {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: #e5f3ff;
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Base row */
.tasks-schedule-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* Row for days of week */
.tasks-schedule-row--days {
  align-items: flex-start;
}

.tasks-schedule-label {
  font-size: 0.78rem;
  color: #6b7280;
  white-space: nowrap;
  min-width: 56px;
}

/* Days + Ca: compact chips on same row */
.tasks-schedule-days {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
}

/* Ca group (Morning / Afternoon / Evening) */
.tasks-schedule-shifts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

/* Common pill style for both groups */
.tasks-schedule-days label,
.tasks-schedule-shifts label {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 42px;
  justify-content: center;
}


/* Row with two columns: Ca + GV phụ trách */
.tasks-schedule-row--two {
  margin-top: 8px;
  display: grid;
  /* Ca column ~35%, teacher ~65% */
  grid-template-columns: minmax(0, 0.35fr) minmax(0, 0.65fr);
  gap: 10px;
  align-items: flex-start;
}

/* Inside each column: label above select */
.tasks-schedule-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

/* Tune label specifically for Ca + GV section */
.tasks-schedule-row--two .tasks-schedule-label {
  min-width: 0;               /* don’t force width here */
  font-size: 0.78rem;
  font-weight: 500;
  color: #4b5563;
}

/* Slightly more “input-like” feel */
.tasks-schedule-row--two .tasks-schedule-select {
  width: 100%;
  min-height: 30px;
}


.tasks-schedule-select {
  width: auto;              /* shrink to content */
  min-width: 120px;         /* still big enough to click */
  max-width: 180px;         /* don’t grow too wide */
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 4px 12px;
  font-size: 0.78rem;
  background: #ffffff;
}

.tasks-schedule-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.tasks-schedule-teacher {
  max-width: 260px;         /* a bit wider for email/text */
}


.tasks-schedule input[type="checkbox"] {
  width: 12px;
  height: 12px;
}

@media (max-width: 640px) {
  .tasks-schedule-row--two {
    grid-template-columns: minmax(0, 1fr);
  }

  .tasks-schedule-row--two .tasks-schedule-select {
    width: 100%;
    max-width: 100%;
  }
}

/* Ca dropdown – nhỏ gọn hơn một chút */
.tasks-schedule-select--shift {
  min-width: 110px;
  max-width: 140px;
}

/* GV dropdown – rộng hơn để chứa email / tên GV */
.tasks-schedule-teacher {
  max-width: 260px;
  flex: 1;
}

/* NEW: "thiếu GV" coverage notice under Lịch thực hiện */
.tasks-coverage {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffbeb;        /* very light amber */
  border: 1px dashed #facc15; /* amber dashed border */
  font-size: 0.78rem;
  color: #92400e;             /* dark amber text */
}

.tasks-coverage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.tasks-coverage-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #92400e;
}

.tasks-coverage-title-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fef3c7;        /* light amber circle */
}

.tasks-coverage-body {
  line-height: 1.4;
}

.tasks-coverage-list {
  margin: 4px 0 0;
  padding-left: 18px;
}

.tasks-coverage-list li {
  margin: 2px 0;
}

.tasks-coverage-dates {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #b45309;
}

/* NEW: teacher assignment section under each card */
.tasks-teachers {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f3ff;        /* soft violet background */
  border: 1px dashed #ddd6fe; /* violet dashed border */
  font-size: 0.78rem;
  color: #4c1d95;             /* dark violet text */
}



.tasks-teachers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.tasks-teachers-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #4c1d95;        /* violet title */
}

.tasks-teachers-title-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ede9fe;   /* light violet circle */
  color: #7c3aed;        /* violet icon */
  font-size: 0.8rem;
}



.tasks-teachers-add-btn {
  border-radius: 999px;
  border: none;
  padding: 3px 10px;
  font-size: 0.74rem;
  cursor: pointer;
  background: #7c3aed;   /* violet button */
  color: #f9fafb;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.25);
}

.tasks-teachers-add-btn:hover {
  background: #5b21b6;   /* darker violet on hover */
}

.tasks-teachers-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 6px;
}

.tasks-teacher-row--hidden {
  display: none !important;
}

.tasks-teachers-show-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  margin-top: 8px;
  border-radius: 10px;
  border: 1px dashed #ddd6fe;
  background: #faf5ff;
  color: #7c3aed;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.tasks-teachers-show-more-btn:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
  transform: translateY(-1px);
}

.tasks-teachers-show-more-btn i {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.tasks-teachers-list {
  display: flex;
  flex-direction: column;
  gap: 8px; /* a bit more space between teachers */
}

/* Teacher row – small card so each GV stands out */
.tasks-teacher-row {
  position: relative;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fdfbff;           /* almost white with slight violet */
  border: 1px dashed #e5e7eb;    /* dashed border instead of solid */
  box-shadow: 0 4px 10px rgba(148, 163, 184, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}


/* Give each teacher a slightly different border color */
.tasks-teachers-list .tasks-teacher-row:nth-child(1) {
  border-color: #a855f7;   /* purple */
}

.tasks-teachers-list .tasks-teacher-row:nth-child(2) {
  border-color: #22c55e;   /* green */
}

.tasks-teachers-list .tasks-teacher-row:nth-child(3) {
  border-color: #f97316;   /* orange */
}

.tasks-teachers-list .tasks-teacher-row:nth-child(4) {
  border-color: #06b6d4;   /* cyan */
}

.tasks-teachers-list .tasks-teacher-row:nth-child(5) {
  border-color: #e11d48;   /* pink / red */
/* từ giáo viên thứ 6 trở đi sẽ dùng viền xám mặc định */
}


.tasks-teacher-select {
  min-width: 140px;
  max-width: 180px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 0.8rem;
  background: #ffffff;
}

.tasks-teacher-dates-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.tasks-teacher-dates {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #6b7280;
}


.tasks-teacher-label {
  white-space: nowrap;
}

.tasks-teacher-date {
  border-radius: 999px;
  border: 1px solid #ddd6fe;       /* light violet border */
  padding: 3px 8px;
  font-size: 0.78rem;
  background: #faf5ff;             /* very light violet */
  color: #4c1d95;
}

.tasks-teacher-date:focus {
  outline: none;
  border-color: #7c3aed;           /* violet focus */
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.18);
  background: #ffffff;
}



.tasks-teacher-row-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

/* The inner row that uses schedule style */
.tasks-teacher-schedule-row {
  flex: 1;
}


.tasks-teacher-days label span,
.tasks-teacher-shifts label span {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.78rem;
  color: #4c1d95;            /* violet text */
}



/* Checkbox nhỏ & tối giản */
.tasks-teacher-days input[type='checkbox'],
.tasks-teacher-shifts input[type='checkbox'] {
  width: 12px;
  height: 12px;
}

.tasks-teacher-days label:hover span,
.tasks-teacher-shifts label:hover span {
  border-color: #bbf7d0;
  background: #dcfce7;       /* light green on hover */
}


.tasks-teacher-days input[type='checkbox']:checked + span,
.tasks-teacher-shifts input[type='checkbox']:checked + span {
  background: #dcfce7;           /* green chip when checked */
  border-color: #bbf7d0;
  color: #166534;
}




.tasks-teacher-remove-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 3px;
  font-size: 0.9rem;
  color: #9ca3af;
}

.tasks-teacher-remove-btn:hover {
  color: #ef4444;
}


/* Top line of each GV row: teacher select + date range, similar to header + dates above */
.tasks-teacher-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e5e7eb;  /* matches feel of schedule rows */
  margin-bottom: 4px;
}


.tasks-teacher-days,
.tasks-teacher-shifts {
  position: relative;
  padding: 8px 8px 4px;
  border-radius: 10px;
  background: #ecfdf5;        /* light green to match GV card */
  border: 1px solid #bbf7d0;  /* soft green border */
}


.tasks-teacher-days::before,
.tasks-teacher-shifts::before {
  position: absolute;
  top: -10px;
  left: 10px;
  padding: 0 6px;
  font-size: 0.7rem;
  color: #166534;            /* green text */
  background: #f0fdf4;       /* same feel as GV background */
  border-radius: 999px;
  border: 1px solid #bbf7d0; /* green outline */
}


.tasks-teacher-days::before {
  content: "Thứ";
}

.tasks-teacher-shifts::before {
  content: "Ca";
}

/* Override Thứ / Ca colors inside the GV phụ trách section
   for the groups that use .tasks-schedule-days / .tasks-schedule-shifts */
.tasks-teachers .tasks-schedule-days,
.tasks-teachers .tasks-schedule-shifts {
  background: #f5f3ff;       /* soft violet background */
  border-color: #ddd6fe;     /* violet border */
}

/* Floating labels "Thứ" and "Ca" inside teacher area */
.tasks-teachers .tasks-schedule-days::before,
.tasks-teachers .tasks-schedule-shifts::before {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #4c1d95;
}

/* Make the inner chips violet too */
.tasks-teachers .tasks-schedule-days label,
.tasks-teachers .tasks-schedule-shifts label {
  padding: 0;
  border: none;
  background: transparent;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tasks-teachers .tasks-schedule-days label span,
.tasks-teachers .tasks-schedule-shifts label span {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.78rem;
  color: #4c1d95;
}

.tasks-teachers .tasks-schedule-days label:hover span,
.tasks-teachers .tasks-schedule-shifts label:hover span {
  border-color: #ddd6fe;
  background: #ede9fe;       /* light violet on hover */
}

.tasks-teachers .tasks-schedule-days input[type="checkbox"]:checked + span,
.tasks-teachers .tasks-schedule-shifts input[type="checkbox"]:checked + span {
  background: #ede9fe;       /* violet chip when checked */
  border-color: #c4b5fd;
  color: #4c1d95;
}


/* Meta row (department + date) – separated footer */
.tasks-meta {

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #e5e7eb;   /* separates content vs footer */
}



.tasks-meta-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Actions (edit + delete) on each card */
.tasks-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

/* Show icons only when hovering the card */
.tasks-item:hover .tasks-actions {
  opacity: 1;
  pointer-events: auto;
}

/* Elegant round icon buttons */
.tasks-action-btn {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform 0.12s ease,
    color var(--transition);
}

.tasks-action-btn i {
  pointer-events: none;
}

/* Hover colours: blue for link, green for edit, red for delete */
.tasks-action-link:hover {
  background: #eff6ff;
  border-color: #60a5fa;
  color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.2);
}

.tasks-action-edit:hover {
  background: #ecfdf3;
  border-color: #22c55e;
  color: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(22, 163, 74, 0.2);
}

.tasks-action-delete:hover {
  background: #fef2f2;
  border-color: #f97373;
  color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(220, 38, 38, 0.2);
}


.tasks-dept-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(13, 110, 253, 0.08); /* soft blue using primary color */
  color: #1d4ed8;
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 0.72rem;
  font-weight: 500;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tasks-tag-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.08);   /* soft violet */
  color: #6d28d9;
  border: 1px solid rgba(167, 139, 250, 0.6);
  font-size: 0.72rem;
  font-weight: 500;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 6px;                          /* little space from department pill */
}


.tasks-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
}

.tasks-date {
  white-space: nowrap;
}

.tasks-empty {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #9ca3af;
  border-radius: 12px;
  border: 1px dashed #d1d5db;
  background: #f9fafb;
  padding: 10px 14px;

  /* NEW: same width as the tasks grid so it doesn't "shrink" */
  max-width: 1040px;      /* same as .tasks-grid */
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}



/* ---------- Editor popup ---------- */
.editor-overlay {
  position: fixed;
  inset: 0;
  display: none; /* show via JS */
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1100; /* above logout icon */
}

.editor-popup {
  width: min(720px, 100% - 32px);
  max-height: 90vh;          /* allow a bit more height */
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;        /* no horizontal scroll */
  overflow-y: auto;          /* popup can scroll to show buttons */
  animation: popup-in 0.25s var(--transition) both;
}


@keyframes popup-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 8px;
  border-bottom: 1px solid #e5e7eb;
}

.editor-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.editor-close {
  border: none;
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  color: #6b7280;
}

.editor-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;              /* row + column gaps */
  padding: 10px 18px 10px;    /* a bit more breathing room */
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}


.editor-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 0;
  padding: 4px 6px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(148, 163, 184, 0.25);
}

/* Right-aligned group for alignment buttons */
.editor-toolbar-group--align {
  margin-left: auto;          /* push to the far right */
  padding: 0;
  background: transparent;
  box-shadow: none;
  gap: 4px;
}


.editor-btn {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform 0.08s ease;
}

.editor-btn i {
  pointer-events: none;
}

.editor-btn:hover {
  background: #eff6ff;
  border-color: #dbeafe;
  box-shadow: 0 3px 8px rgba(148, 163, 184, 0.4);
  transform: translateY(-1px);
}

.editor-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(148, 163, 184, 0.35);
}


.editor-select {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 6px 22px 6px 10px;
  font-size: 0.8rem;
  background: #ffffff;
}

.editor-select-full {
  width: 163px;          /* fixed, shorter width */
  max-width: 100%;       /* still responsive on very small screens */
  display: inline-block; /* so it doesn’t stretch full row */
  margin: 0;             /* spacing handled by editor-dept-tag-box */
  font-size: 0.9rem;
}


/* Department + Tag section in editor popup */
.editor-field-department {
  margin: 4px 0 10px;
}

.editor-dept-tag-box {
  margin: 0 18px 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-field-department .editor-dept-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.editor-tag-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.editor-select-tag {
  min-width: 120px;
  max-width: 160px;
}

.editor-tag-add-btn {
  border: none;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #f9fafb;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.25);
  transition:
    background var(--transition),
    transform 0.08s ease,
    box-shadow var(--transition);
}

.editor-tag-add-btn i {
  font-size: 0.85rem;
}

.editor-tag-add-btn:hover {
  background: #020617;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.3);
}

.editor-tag-add-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}

/* === NEW: shared dropdown styles for Tag + Department === */

/* used by tagMenu and deptMenu */
.hidden {
  display: none !important;
}

/* popup dropdown menu container */
.tag-menu {
  position: absolute;
  margin-top: 6px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
  padding: 4px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1200;
  min-width: 180px;
  border: 1px solid #e5e7eb;
}

/* so the menus can anchor to this row */
.editor-dept-tag-row {
  position: relative;
}

/* one item inside the dropdown (used for both Tag + Department) */
.tag-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  transition:
    background var(--transition),
    transform 0.08s ease,
    box-shadow var(--transition);
}

.tag-item:hover {
  background: #eff6ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(148, 163, 184, 0.35);
}

/* text inside item (ellipsis if long) */
.tag-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ONLY used for Tag dropdown (trash icon) – Department will not have this button */
.tag-trash-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.tag-trash-btn:hover {
  color: #ef4444;
}

@media (max-width: 480px) {
  .editor-dept-tag-box {
    margin: 0 12px 8px;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .editor-field-department .editor-dept-tag-row {
    flex-direction: column;
    align-items: stretch;
  }

  .editor-tag-wrapper {
    justify-content: flex-start;
  }
}



.editor-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-right: 2px;
}

.editor-color {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  padding: 0;
}

.editor-color-magenta {
  background: #d946ef;
}
.editor-color-blue {
  background: #2563eb;
}
.editor-color-red {
  background: #ef4444;
}

.editor-color:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.3);
}

.editor-content {
  /* pull the editor in from the card edges */
  margin: 10px 18px 12px;

  /* inner padding */
  padding: 10px 12px;

  min-height: 180px;
  max-height: 40vh;
  overflow-y: auto;
  font-size: 0.95rem;
  text-align: left;

  /* nicer border + shape */
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

/* Layout for two editor sections (topic + details) */
.editor-fields {
  margin-top: 4px;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-field {
  display: flex;
  flex-direction: column;
}

.editor-field-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b7280;
  margin: 0 20px 2px;
}

/* Smaller box for the topic, bigger for the details */
.editor-content-title {
  min-height: 60px;
  max-height: 18vh;
}

.editor-content-body {
  min-height: 140px;
}


/* remove ugly native focus outline and add a soft one */
.editor-content:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.25);
}


/* Fake placeholder for contenteditable */
.editor-content[contenteditable="true"]:empty:before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

.editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 18px 14px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.editor-primary,
.editor-secondary {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
}

.editor-primary {
  background: var(--primary);
  color: #ffffff;
}

.editor-primary:hover {
  background: var(--primary-dark);
}

.editor-secondary {
  background: #e5e7eb;
  color: #111827;
}

.editor-secondary:hover {
  background: #d1d5db;
}

@media (max-width: 480px) {
  .editor-popup {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}


/* ---------- Confirm popup ---------- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1150; /* above editor */
}

.confirm-popup {
  width: min(360px, 100% - 48px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popup-in 0.2s var(--transition) both;
}

.confirm-header {
  padding: 14px 18px 4px;
  border-bottom: 1px solid #e5e7eb;
}

.confirm-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.confirm-body {
  padding: 12px 18px 8px;
  font-size: 0.9rem;
  color: #374151;
}

.confirm-footer {
  padding: 10px 18px 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.confirm-primary,
.confirm-secondary {
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
}

.confirm-primary {
  background: var(--primary);
  color: #ffffff;
}

.confirm-primary:hover {
  background: var(--primary-dark);
}

.confirm-secondary {
  background: #e5e7eb;
  color: #111827;
}

.confirm-secondary:hover {
  background: #d1d5db;
}


/* ---------- Tag popup (add new tag) ---------- */
.tag-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1200; /* above editor + confirm, below toast */
}

.tag-popup {
  width: min(360px, 100% - 48px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popup-in 0.2s var(--transition) both;
}

.tag-header {
  padding: 14px 18px 4px;
  border-bottom: 1px solid #e5e7eb;
}

.tag-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.tag-body {
  padding: 12px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tag-label {
  font-size: 0.8rem;
  color: #6b7280;
}

.tag-input {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.tag-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.18);
}

.tag-footer {
  padding: 10px 18px 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.tag-primary,
.tag-secondary {
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
}

.tag-primary {
  background: var(--primary);
  color: #ffffff;
}

.tag-primary:hover {
  background: var(--primary-dark);
}

.tag-secondary {
  background: #e5e7eb;
  color: #111827;
}

.tag-secondary:hover {
  background: #d1d5db;
}


/* ---------- Toast notification ---------- */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #111827;
  color: #f9fafb;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  z-index: 2000;
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}


/* --- Clear separation for Thứ / Ca in "Lịch thực hiện" --- */

.tasks-schedule-row--days {
  align-items: stretch;
  gap: 10px;
  margin-top: 10px;
}

/* Group box for Thứ + Ca
   Make Thứ a bit wider and Ca a bit narrower */
.tasks-schedule-days {
  position: relative;
  flex: 1.4;                /* Thứ wider */
  padding: 8px 8px 4px;
  border-radius: 10px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tasks-schedule-shifts {
  position: relative;
  flex: 0.8;                /* Ca narrower */
  padding: 8px 8px 4px;
  border-radius: 10px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
}


/* Small floating labels on top of each group */
.tasks-schedule-days::before,
.tasks-schedule-shifts::before {
  position: absolute;
  top: -10px;
  left: 10px;
  padding: 0 6px;
  font-size: 0.7rem;
  color: #6b7280;
  background: #f9fafb;      /* same as tasks-schedule background */
  border-radius: 999px;
  border: 1px solid #e5e7eb;
}

.tasks-schedule-days::before {
  content: "Thứ";
}

.tasks-schedule-shifts::before {
  content: "Ca";
}

/* Make individual chips a bit lighter inside the group */
.tasks-schedule-days label,
.tasks-schedule-shifts label {
  background: #ffffff;
  border-color: #e5e7eb;
  font-size: 0.78rem;
}


/* --- Make Ca chips in main schedule smaller, like teacher section --- */

.tasks-schedule-shifts {
  gap: 6px;                      /* a bit more breathing room */
}

/* label itself: no big pill */
.tasks-schedule-shifts label {
  padding: 0;
  border: none;
  background: transparent;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-start;
}

/* the "chip" is the span */
.tasks-schedule-shifts label span {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.78rem;
  color: #6b7280;
}

/* small, clean checkbox */
.tasks-schedule-shifts input[type="checkbox"] {
  width: 12px;
  height: 12px;
}

/* hover + selected states, same feeling as GV section */
.tasks-schedule-shifts label:hover span {
  border-color: #e5e7eb;
  background: #f9fafb;
}

.tasks-schedule-shifts input[type="checkbox"]:checked + span {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}


.editor-tag-wrapper { position: relative; }

.tag-menu {
  position: absolute;
  top: calc(100% + 4px);  /* always drop right under the select */
  left: 0;                /* align with the left edge of the select/wrapper */
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
  padding: 4px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1200;
  min-width: 180px;
  border: 1px solid #e5e7eb;
}

/* NEW: make Department dropdown menu narrower than Tag */
#deptMenu.tag-menu {
  width: auto;        /* don’t stretch full width */
  min-width: 140px;   /* smaller base width for short names */
  max-width: 220px;   /* prevent it from becoming too wide */
}

.tag-menu.hidden { display: none; }


.tag-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.tag-item:hover { background: #f3f4f6; }

.tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-trash-btn {
  background: transparent;
  border: 0;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
}

.tag-trash-btn:hover { background: #fee2e2; } /* subtle red hover */
.tag-trash-btn i { pointer-events: none; }    /* click lands on the button */


/* ---------- Editor Duration Input ---------- */
.editor-duration-box {
  margin: 0;
  margin-left: auto; /* Pushes it to the right side of the row */
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px; 
  border-left: 1px solid #e5e7eb; /* Adds a small divider line */
}

.editor-duration-box .editor-label {
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  margin: 0; /* Reset default label margin */
}

.editor-duration-input {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 6px 14px;
  font-size: 0.9rem;
  width: 100px; /* Short and compact */
  outline: none;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.editor-duration-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* Remove default arrows on number input for a cleaner look */
.editor-duration-input {
  -moz-appearance: textfield; /* Required for Firefox */
  appearance: textfield;      /* Standard property */
}

.editor-duration-input::-webkit-outer-spin-button,
.editor-duration-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Resizing to fit the Image checkbox */

/* 1. Make Department dropdown smaller */
.editor-select-full {
  width: 130px !important; /* Force smaller width */
}

/* 2. Make Tag dropdown smaller */
.editor-select-tag {
  min-width: 90px !important;
  max-width: 130px !important;
}

/* 3. Adjust Duration Box */
.editor-duration-box {
  margin: 0;
  margin-left: auto;     
  display: flex;
  align-items: center;
  gap: 6px;              
  padding-left: 10px;    
  border-left: 1px solid #e5e7eb;
}

/* 4. Make Duration input smaller */
.editor-duration-input {
  width: 60px !important; /* Smaller input */
  padding: 6px 4px !important;
  text-align: center;
}

/* 5. NEW: Style for the Image Checkbox Box */
.editor-image-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  margin-left: 10px;
  border-left: 1px solid #e5e7eb; 
}

.editor-image-box .editor-label {
  margin: 0;
  font-weight: 500;
  color: #6b7280;
  font-size: 0.85rem;
  cursor: pointer;
}

.editor-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #0d6efd; /* Primary blue */
}

/* Responsive fix */
@media (max-width: 600px) {
  .editor-image-box {
    margin-left: 0;
    border-left: none;
    padding-left: 0;
  }
}

/* Max Input Styling */
.editor-max-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  margin-left: 10px;
  border-left: 1px solid #e5e7eb; /* Divider line */
}

.editor-max-box .editor-label {
  margin: 0;
  font-weight: 500;
  color: #6b7280;
  font-size: 0.85rem;
}

.editor-max-input {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 4px;
  font-size: 0.9rem;
  width: 40px !important; /* Very small width */
  text-align: center;
  outline: none;
  background: #ffffff;
  transition: border-color 0.2s ease;
  
  /* Remove spinner arrows */
  -moz-appearance: textfield;
  appearance: textfield;
}

.editor-max-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

.editor-max-input::-webkit-outer-spin-button,
.editor-max-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Responsive Fix: Stack on very small screens */
@media (max-width: 600px) {
  .editor-max-box {
    margin-left: 0;
    border-left: none;
    padding-left: 0;
  }
}


/* ---------- Add Form Button ---------- */
.editor-form-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  margin-left: 10px;
  border-radius: 999px;
  border: 1px dashed #10b981;
  background: #ecfdf5;
  color: #059669;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.editor-form-add-btn:hover {
  background: #d1fae5;
  border-color: #059669;
  transform: translateY(-1px);
}

.editor-form-add-btn:active {
  transform: translateY(0);
}

.editor-form-add-btn i {
  font-size: 0.85rem;
}

.editor-form-add-btn--active {
  background: #d1fae5;
  border-style: solid;
  border-color: #10b981;
}

.editor-form-add-btn--active i {
  color: #059669;
}

/* ---------- Form URL popup ---------- */
.form-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1200;
}

.form-popup {
  width: min(420px, 100% - 48px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popup-in 0.2s var(--transition) both;
}

.form-header {
  padding: 14px 18px 4px;
  border-bottom: 1px solid #e5e7eb;
}

.form-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.form-body {
  padding: 14px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #374151;
}

.form-input {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 10px 14px;
  font-size: 0.9rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-hint {
  margin: 0;
  font-size: 0.72rem;
  color: #9ca3af;
}

.form-footer {
  padding: 10px 18px 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.form-primary,
.form-secondary {
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.form-primary {
  background: #10b981;
  color: #ffffff;
}

.form-primary:hover {
  background: #059669;
}

.form-secondary {
  background: #e5e7eb;
  color: #111827;
}

.form-secondary:hover {
  background: #d1d5db;
}


.tasks-header-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compact-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.compact-mode-toggle:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.compact-mode-toggle--active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.compact-mode-toggle--active:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.compact-mode-list {
  max-width: 1040px;
  width: 100%;
  margin: 12px auto 0;
  padding: 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compact-mode-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid transparent;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.compact-mode-item:last-child {
  margin-bottom: 0;
}

.compact-mode-item:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  transform: translateX(4px);
}

.compact-mode-item-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 65%;
}

.compact-mode-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1d4ed8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-mode-item-preview {
  font-size: 0.78rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.compact-mode-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  max-width: 35%;
}

/* Removed - badges now use .compact-mode-badge classes */

.compact-mode-teacher-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f5f3ff;
  color: #5b21b6;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid #ddd6fe;
}

.compact-mode-teacher-count i {
  font-size: 0.65rem;
}

.compact-mode-teacher-count--warning {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.compact-mode-teacher-count--warning i {
  color: #d97706;
}

/* Department section in compact mode */
.compact-mode-section {
  margin-bottom: 16px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.compact-mode-section:last-child {
  margin-bottom: 0;
}

.compact-mode-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  cursor: default;
}

.compact-mode-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
}

.compact-mode-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.08);
  color: #374151;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Color 1 - Blue */
.compact-mode-section:nth-child(8n + 1) .compact-mode-section-header {
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  border-bottom-color: #bfdbfe;
}
.compact-mode-section:nth-child(8n + 1) .compact-mode-section-title {
  color: #1e40af;
}
.compact-mode-section:nth-child(8n + 1) .compact-mode-section-count {
  background: #bfdbfe;
  color: #1e40af;
}

/* Color 2 - Green */
.compact-mode-section:nth-child(8n + 2) .compact-mode-section-header {
  background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
  border-bottom-color: #bbf7d0;
}
.compact-mode-section:nth-child(8n + 2) .compact-mode-section-title {
  color: #166534;
}
.compact-mode-section:nth-child(8n + 2) .compact-mode-section-count {
  background: #bbf7d0;
  color: #166534;
}

/* Color 3 - Orange */
.compact-mode-section:nth-child(8n + 3) .compact-mode-section-header {
  background: linear-gradient(135deg, #fed7aa 0%, #fff7ed 100%);
  border-bottom-color: #fdba74;
}
.compact-mode-section:nth-child(8n + 3) .compact-mode-section-title {
  color: #9a3412;
}
.compact-mode-section:nth-child(8n + 3) .compact-mode-section-count {
  background: #fdba74;
  color: #9a3412;
}

/* Color 4 - Purple */
.compact-mode-section:nth-child(8n + 4) .compact-mode-section-header {
  background: linear-gradient(135deg, #e9d5ff 0%, #faf5ff 100%);
  border-bottom-color: #d8b4fe;
}
.compact-mode-section:nth-child(8n + 4) .compact-mode-section-title {
  color: #6b21a8;
}
.compact-mode-section:nth-child(8n + 4) .compact-mode-section-count {
  background: #d8b4fe;
  color: #6b21a8;
}

/* Color 5 - Pink */
.compact-mode-section:nth-child(8n + 5) .compact-mode-section-header {
  background: linear-gradient(135deg, #fce7f3 0%, #fdf2f8 100%);
  border-bottom-color: #fbcfe8;
}
.compact-mode-section:nth-child(8n + 5) .compact-mode-section-title {
  color: #9d174d;
}
.compact-mode-section:nth-child(8n + 5) .compact-mode-section-count {
  background: #fbcfe8;
  color: #9d174d;
}

/* Color 6 - Cyan */
.compact-mode-section:nth-child(8n + 6) .compact-mode-section-header {
  background: linear-gradient(135deg, #cffafe 0%, #ecfeff 100%);
  border-bottom-color: #a5f3fc;
}
.compact-mode-section:nth-child(8n + 6) .compact-mode-section-title {
  color: #0e7490;
}
.compact-mode-section:nth-child(8n + 6) .compact-mode-section-count {
  background: #a5f3fc;
  color: #0e7490;
}

/* Color 7 - Yellow */
.compact-mode-section:nth-child(8n + 7) .compact-mode-section-header {
  background: linear-gradient(135deg, #fef08a 0%, #fefce8 100%);
  border-bottom-color: #fde047;
}
.compact-mode-section:nth-child(8n + 7) .compact-mode-section-title {
  color: #a16207;
}
.compact-mode-section:nth-child(8n + 7) .compact-mode-section-count {
  background: #fde047;
  color: #a16207;
}

/* Color 8 - Red */
.compact-mode-section:nth-child(8n) .compact-mode-section-header {
  background: linear-gradient(135deg, #fecaca 0%, #fef2f2 100%);
  border-bottom-color: #fca5a5;
}
.compact-mode-section:nth-child(8n) .compact-mode-section-title {
  color: #b91c1c;
}
.compact-mode-section:nth-child(8n) .compact-mode-section-count {
  background: #fca5a5;
  color: #b91c1c;
}

.compact-mode-section-tasks {
  display: flex;
  flex-direction: column;
}

.compact-mode-section-tasks .compact-mode-item {
  margin-bottom: 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  background: #ffffff;
}

.compact-mode-section-tasks .compact-mode-item:last-child {
  border-bottom: none;
}

.compact-mode-section-tasks .compact-mode-item:hover {
  background: #eff6ff;
  border-color: #f3f4f6;
  transform: none;
}

@media (max-width: 768px) {
  .compact-mode-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .compact-mode-item-left {
    max-width: 100%;
    width: 100%;
  }

  .compact-mode-item-right {
    max-width: 100%;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .compact-mode-badge--tag {
    max-width: 120px;
  }
}

/* ========== FOCUSED MODE STYLES ========== */

/* ========== FOCUSED MODE STYLES ========== */

/* Back buttons in header (hidden by default) */
.focused-back-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.focused-back-btn:hover {
  transform: translateY(-1px);
}

.focused-back-btn:active {
  transform: translateY(0);
}

.focused-back-btn i {
  font-size: 0.85rem;
}

/* Button 1: Back to Compact (purple) */
.focused-back-btn--compact {
  background: #7c3aed;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.25);
}

.focused-back-btn--compact:hover {
  background: #6d28d9;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.35);
}

/* Button 2: Back to List (blue) */
.focused-back-btn--list {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.focused-back-btn--list:hover {
  background: #1d4ed8;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

/* Focused task card - make it stand out */
.tasks-item--focused {
  max-width: 900px;
  margin: 0 auto;
  border: 2px solid #2563eb;
  box-shadow: 0 12px 35px rgba(37, 99, 235, 0.15);
}

/* On mobile, make buttons smaller */
@media (max-width: 640px) {
  .focused-back-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  .focused-back-btn span {
    display: none;
  }
}

/* ========== INDEFINITE TOGGLE STYLES ========== */

.indefinite-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  color: #6b7280;
  user-select: none;
}

.indefinite-toggle input[type="checkbox"] {
  display: none;
}

.indefinite-toggle-slider {
  position: relative;
  width: 36px;
  height: 20px;
  background: #e5e7eb;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.indefinite-toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}

.indefinite-toggle input[type="checkbox"]:checked + .indefinite-toggle-slider {
  background: #10b981;
}

.indefinite-toggle input[type="checkbox"]:checked + .indefinite-toggle-slider::before {
  transform: translateX(16px);
}

.indefinite-toggle-label {
  font-weight: 500;
  white-space: nowrap;
}

.indefinite-toggle input[type="checkbox"]:checked ~ .indefinite-toggle-label {
  display: none;
}

/* Hide date inputs when indefinite is active */
.tasks-schedule-header-dates--hidden,
.tasks-teacher-dates--hidden {
  display: none !important;
}

/* Indefinite badge */
.indefinite-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #a7f3d0;
}

.indefinite-badge i {
  font-size: 0.7rem;
}

/* ---------- Task Info Section (Form URL, Duration, Max) ---------- */
.tasks-info {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px dashed #a7f3d0;
  font-size: 0.78rem;
  color: #065f46;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.tasks-info-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d1fae5;
  font-size: 0.78rem;
  color: #065f46;
}

.tasks-info-item i {
  font-size: 0.85rem;
  color: #10b981;
}

.tasks-info-item--form {
  background: #d1fae5;
  border-color: #6ee7b7;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.tasks-info-item--form:hover {
  background: #a7f3d0;
  transform: translateY(-1px);
}

.tasks-info-item--form a {
  color: #065f46;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tasks-info-item--form a:hover {
  text-decoration: underline;
}

.tasks-info-label {
  font-weight: 600;
  color: #047857;
}

.tasks-info-value {
  font-weight: 500;
}

/* Compact mode: all badges in right section */
.compact-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
}

.compact-mode-badge i {
  font-size: 0.65rem;
}

.compact-mode-badge--duration {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.compact-mode-badge--max {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.compact-mode-badge--form {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  cursor: pointer;
  transition: background 0.15s ease;
}

.compact-mode-badge--form:hover {
  background: #a7f3d0;
}

.compact-mode-badge--tag {
  background: rgba(139, 92, 246, 0.08);
  color: #6d28d9;
  border: 1px solid rgba(167, 139, 250, 0.6);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ========== PAUSE TOGGLE IN COMPACT MODE ========== */

.compact-mode-pause-toggle {
  display: flex;
  align-items: center;
  margin-left: 8px;
}

.compact-pause-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.compact-pause-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.compact-pause-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #10b981;
  border-radius: 20px;
  transition: 0.3s;
}

.compact-pause-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.compact-pause-switch input:checked + .compact-pause-slider {
  background-color: #f59e0b;
}

.compact-pause-switch input:checked + .compact-pause-slider:before {
  transform: translateX(16px);
}

/* Paused item styling */
.compact-mode-item--paused {
  opacity: 0.6;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(245, 158, 11, 0.05) 10px,
    rgba(245, 158, 11, 0.05) 20px
  );
}

.compact-mode-item--paused .compact-mode-item-title {
  text-decoration: line-through;
  color: #9ca3af;
}


/* ========== COMPACT MODE TRASH BUTTON ========== */

/* ========== COMPACT MODE TRASH BUTTON (Remove Teacher Assignment) ========== */

.compact-mode-trash-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: linear-gradient(135deg, #fef2f2 0%, #fff5f5 100%);
  color: #dc2626;
  cursor: pointer;
  font-size: 0.8rem;
  margin-right: 8px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.compact-mode-item:hover .compact-mode-trash-btn {
  display: inline-flex;
}

.compact-mode-trash-btn:hover {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #f87171;
  color: #b91c1c;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.compact-mode-trash-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.compact-mode-trash-btn i {
  pointer-events: none;
}