/* ═══════════════════════════════════════════
   PDCAL — Fiscal Calendar Scheduler
   Custom Styles (extends Tailwind)
   ═══════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
}

::selection {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes cardAdd {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
  50%      { box-shadow: 0 0 20px 4px rgba(99, 102, 241, 0.12); }
}

.animate-fadeIn {
  animation: fadeIn 0.45s ease-out both;
}
.animate-fadeInScale {
  animation: fadeInScale 0.35s ease-out both;
}
.animate-cardAdd {
  animation: cardAdd 0.25s ease-out both;
}

/* ── Header Buttons ── */
.header-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s ease;
  cursor: pointer;
}
.header-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
}

.view-switcher-wrap {
  display: inline-flex;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.view-switcher-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.view-switcher-select {
  min-width: 128px;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(23, 27, 45, 0.92);
  color: rgba(255, 255, 255, 0.9);
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.view-switcher-filter-wrap {
  position: relative;
  min-width: 260px;
}

.label-filter-toggle {
  width: 100%;
  text-align: left;
  position: relative;
  padding-right: 1.6rem;
}

.label-filter-toggle::after {
  content: '';
  position: absolute;
  right: 0.6rem;
  top: 50%;
  width: 0.42rem;
  height: 0.42rem;
  border-right: 2px solid rgba(255, 255, 255, 0.65);
  border-bottom: 2px solid rgba(255, 255, 255, 0.65);
  transform: translateY(-60%) rotate(45deg);
  transition: transform 0.18s ease;
}

.label-filter-toggle[aria-expanded="true"]::after {
  transform: translateY(-40%) rotate(-135deg);
}

.label-filter-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 260px;
  overflow: auto;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 18, 33, 0.98);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
  padding: 0.35rem;
}

.label-filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem;
  border-radius: 0.4rem;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  cursor: pointer;
}

.label-filter-option:hover {
  background: rgba(99, 102, 241, 0.18);
}

.label-filter-option input {
  accent-color: #6366f1;
}

.label-filter-option.category {
  font-weight: 700;
}

.label-filter-option.tag {
  padding-left: 1.2rem;
}

.label-filter-option.tag span::before {
  content: '- ';
  opacity: 0.65;
}

.view-switcher-select:focus {
  border-color: rgba(99, 102, 241, 0.85);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.28);
  color: #ffffff;
}

.google-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem 0.4rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 220px;
  z-index: 2;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
}

.google-auth-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
}

.google-auth-btn.is-signed-in {
  border-color: rgba(52, 211, 153, 0.4);
}

.google-auth-avatar-wrap {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.12);
}

.google-auth-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.google-auth-avatar-fallback {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.google-auth-label {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .google-auth-btn {
    right: 0.75rem;
    padding-right: 0.45rem;
  }

  .google-auth-label {
    display: none;
  }
}

body.sidebar-open {
  overflow: hidden;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 54;
  background: rgba(10, 13, 24, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.control-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 55;
  width: min(84vw, 300px);
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(15, 18, 33, 0.97), rgba(10, 13, 24, 0.98));
  box-shadow: 18px 0 42px -20px rgba(0, 0, 0, 0.75);
  transform: translateX(-105%);
  transition: transform 0.26s ease;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.control-sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.sidebar-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.92);
}

.sidebar-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(99, 102, 241, 0.34);
  background: rgba(99, 102, 241, 0.14);
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  margin-right: -1rem;
  padding-right: 1rem;
}

.sidebar-actions::-webkit-scrollbar {
  width: 5px;
}
.sidebar-actions::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-actions::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}
.sidebar-actions::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  padding: 0 0.25rem;
  margin-bottom: -0.15rem;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin: 0.25rem 0;
}

.sidebar-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-theme-row [data-icon] {
  color: rgba(255, 255, 255, 0.5);
}

.theme-toggle {
  position: relative;
  width: 2.5rem;
  height: 1.375rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.theme-toggle[aria-checked="true"] {
  background: #6366f1;
  border-color: #6366f1;
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

.theme-toggle[aria-checked="true"] .theme-toggle-thumb {
  transform: translateX(1.125rem);
}

.sidebar-fy-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-fy-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
}

.sidebar-action {
  width: 100%;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
}

/* ── Fiscal Year Dropdown ── */
#fiscal-year-select {
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
#fiscal-year-select:hover {
  border-color: rgba(99, 102, 241, 0.5) !important;
  background-color: rgba(30, 34, 53, 1);
}
#fiscal-year-select:focus {
  border-color: rgba(99, 102, 241, 1) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
#fiscal-year-select option {
  background: #171b2d;
  color: #fff;
  padding: 0.5rem;
}
#fiscal-year-select option:hover {
  background: #1e2235;
}

/* ── Month Tiles (Dashboard) ── */
.month-tile {
  position: relative;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(145deg, rgba(30, 34, 53, 0.6), rgba(15, 18, 33, 0.8));
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.month-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--tile-accent) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.month-tile:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.4);
}
.month-tile:hover::before {
  opacity: 1;
}
.month-tile .tile-month-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}
.month-tile .tile-year {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 1;
}
.month-tile .tile-task-count {
  margin-top: 0.75rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.25);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.month-tile .tile-task-count .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tile-accent);
  opacity: 0.6;
}
.month-tile .tile-sub-summary {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.42);
  position: relative;
  z-index: 1;
}
.month-tile .tile-sub-summary div {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.month-tile .tile-sub-summary .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tile-accent);
  opacity: 0.6;
  flex-shrink: 0;
}
.month-tile .tile-quarter {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tile-accent);
  opacity: 0.5;
  z-index: 1;
}

/* Quarter accent colors */
.month-tile[data-quarter="Q1"] { --tile-accent: #f472b6; }
.month-tile[data-quarter="Q2"] { --tile-accent: #fb923c; }
.month-tile[data-quarter="Q3"] { --tile-accent: #34d399; }
.month-tile[data-quarter="Q4"] { --tile-accent: #60a5fa; }

/* ── Month Navigation Buttons ── */
.month-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}
.month-nav-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

/* ── Day of Week Header ── */
.day-header {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 0;
}

.week-header {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.42);
}

.week-header.out-of-month {
  color: rgba(255, 255, 255, 0.22);
}

/* Weekly view: stretch columns toward the viewport bottom for higher event density. */
#view-week {
  min-height: calc(100vh - 7.5rem);
  min-height: calc(100dvh - 7.5rem);
  overflow: hidden;
}

#view-week:not(.hidden) {
  display: flex;
  flex-direction: column;
}

#week-grid {
  width: 100%;
  flex: 1;
  overflow: auto;
  display: flex;
}

#week-headers-row {
  display: none;
}

/* ── Hourly Time Grid Layout (Weekly View) ── */
.week-time-grid {
  display: flex;
  gap: 1px;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: auto;
}

.week-time-labels {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 70px;
  flex-shrink: 0;
  background: rgba(15, 18, 33, 0.4);
  border-radius: 0 0 0 0.625rem;
  overflow: hidden;
  align-items: stretch;
}

.week-time-label {
  width: 100%;
  min-height: 60px;
  padding: 2px 4px;
  text-align: center;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.week-days-grid {
  display: flex;
  gap: 1px;
  flex: 1;
  overflow-x: auto;
  overflow-y: visible;
  min-width: 0;
}

.week-day-column {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-radius: 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(30, 34, 53, 0.2);
  overflow: visible;
  position: relative;
  flex: 1;
  min-width: 100px;
}

.week-day-header {
  padding: 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(20, 24, 43, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.week-day-header.today {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
}

.week-day-header.out-of-month {
  opacity: 0.5;
}

.week-day-column.exempt {
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.1);
}

.week-day-header.exempt {
  background: rgba(248, 113, 113, 0.2);
  color: rgba(255, 237, 237, 0.95);
  border-bottom-color: rgba(248, 113, 113, 0.4);
}

.week-time-slot {
  min-height: 15px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  background: rgba(30, 34, 53, 0.1);
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.week-time-slot.week-time-slot-hour {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: rgba(30, 34, 53, 0.14);
}

.week-time-slot:hover {
  background: rgba(30, 34, 53, 0.25);
}

.week-time-slot.drag-over {
  background: rgba(99, 102, 241, 0.12) !important;
  border-color: rgba(99, 102, 241, 0.3);
}

.week-card.task-card {
  position: absolute;
  left: 4px;
  right: 4px;
  cursor: grab;
  z-index: 10;
  width: auto;
  border-radius: 0.375rem;
}

.week-resize-handle {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: -2px;
  height: 10px;
  cursor: ns-resize;
  touch-action: none;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.week-resize-handle::after {
  content: '';
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: background 0.15s ease, width 0.15s ease;
}

.week-resize-handle:hover::after,
.week-resize-handle.resizing::after {
  width: 54px;
  background: rgba(129, 140, 248, 0.78);
}

.week-card:active {
  cursor: grabbing;
  z-index: 20;
}

.week-card.dragging {
  z-index: 30;
  opacity: 0.5;
}

/* ── Day Cells ── */
.day-cell {
  min-height: 110px;
  border-radius: 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(30, 34, 53, 0.35);
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
}
.day-cell.empty {
  background: rgba(15, 18, 33, 0.3);
  border-color: transparent;
  min-height: 110px;
}
.day-cell:not(.empty):hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(30, 34, 53, 0.55);
}
.day-cell.today {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 0 24px -4px rgba(99, 102, 241, 0.1);
}

.day-cell.day-exempt {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(248, 113, 113, 0.12);
}

.day-cell.day-exempt:hover {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(248, 113, 113, 0.17);
}

.day-cell.out-of-month {
  opacity: 0.48;
  border-color: rgba(255, 255, 255, 0.03);
  background: rgba(15, 18, 33, 0.25);
}

.day-cell.out-of-month:hover {
  border-color: rgba(255, 255, 255, 0.03);
  background: rgba(15, 18, 33, 0.25);
}

.day-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.day-cell .day-number {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  padding-left: 0.125rem;
}
.day-cell.today .day-number {
  color: #818cf8;
}

.day-weekday {
  display: none;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 0.2rem;
}

.day-allotment {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.45);
  text-align: right;
  white-space: nowrap;
}

.day-cell.today .day-allotment {
  color: rgba(129, 140, 248, 0.95);
}

/* ── Drag Over State ── */
.day-cell.drag-over {
  border-color: rgba(99, 102, 241, 0.5) !important;
  background: rgba(99, 102, 241, 0.08) !important;
  box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.06);
}

/* ── Cards Container ── */
.cards-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  max-height: 180px;
  padding-right: 2px;
}

.cards-container.has-overflow {
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.1);
}

.cards-container.has-overflow::-webkit-scrollbar {
  width: 8px;
}

.cards-container.has-overflow::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

.cards-container.has-overflow::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 999px;
}

.cards-container.has-overflow::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.55);
}

/* ── Task Cards ── */
.task-card {
  display: flex;
  flex-direction: column;
  border-radius: 0.375rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.task-card.has-color-label {
  background: linear-gradient(135deg, var(--card-label-soft, rgba(255, 255, 255, 0.06)), rgba(255, 255, 255, 0.05));
  border-color: var(--card-label-border, rgba(255, 255, 255, 0.12));
}

.task-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}
.task-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
  transform: scale(0.96);
}
.task-card .drag-handle {
  display: flex;
  align-items: center;
  padding: 2px 6px 0 6px;
  cursor: grab;
}
.task-card .drag-handle .grip {
  display: flex;
  gap: 1px;
  opacity: 0.15;
  transition: opacity 0.2s;
}
.task-card:hover .drag-handle .grip {
  opacity: 0.35;
}
.task-card .drag-handle .grip span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: white;
  display: block;
}

.task-card .card-body {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 3px 6px 6px 6px;
  touch-action: manipulation;
}

.task-card .card-label-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.task-card.touch-drag-source {
  opacity: 0.25;
}

.touch-drag-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  width: min(240px, calc(100vw - 24px));
  opacity: 0.92;
  transform: scale(1.02);
  box-shadow: 0 16px 36px -18px rgba(0, 0, 0, 0.65);
}

.task-card .card-title {
  flex: 1 1 auto;
  min-width: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.68rem;
  line-height: 1.35;
  font-family: 'Inter', sans-serif;
  transition: color 0.2s;
  word-break: break-word;
}

.task-card .card-subs-count {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 1.25rem;
  text-align: right;
  align-self: center;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  color: rgba(255, 255, 255, 0.38);
}

.task-card .card-body:hover .card-title {
  color: rgba(0, 0, 0, 0.92);
}

/* ── Add Card Button ── */
.add-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2px 0;
  border-radius: 0.3rem;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 2px;
  flex-shrink: 0;
}
.add-card-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
  color: rgba(99, 102, 241, 0.7);
}

.day-cell.out-of-month .add-card-btn {
  cursor: not-allowed;
  opacity: 0.6;
}

.day-cell.out-of-month .cards-container,
.day-cell.out-of-month .task-card,
.day-cell.out-of-month .add-card-btn {
  pointer-events: none;
}

/* ── Substitute Allotment Modal ── */
#substitute-modal {
  display: none;
}

#substitute-modal.show {
  display: flex;
}

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

.substitute-row label {
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.76);
}

.substitute-row input {
  width: 110px;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(23, 27, 45, 0.9);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.4rem 0.6rem;
  outline: none;
  font-size: 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.substitute-row input:focus {
  border-color: rgba(99, 102, 241, 0.9);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.substitute-exemptions {
  margin-top: 0.4rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.substitute-exemptions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.substitute-exemptions-header h4 {
  margin: 0;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.substitute-exemptions-help {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.58);
}

.substitute-exemption-add-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.5rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.substitute-exemption-add-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
}

.substitute-exemptions-list {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 14rem;
  overflow-y: auto;
  padding-right: 0.2rem;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.42) rgba(255, 255, 255, 0.1);
}

.substitute-exemptions-list::-webkit-scrollbar {
  width: 8px;
}

.substitute-exemptions-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

.substitute-exemptions-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.42);
  border-radius: 999px;
}

.substitute-exemptions-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.56);
}

.substitute-exemption-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.45rem;
  align-items: center;
}

.substitute-exemption-row input[type="date"] {
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(23, 27, 45, 0.9);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.38rem 0.5rem;
  outline: none;
  font-size: 0.8rem;
}

.substitute-exemption-row input[type="date"]:focus {
  border-color: rgba(99, 102, 241, 0.9);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.substitute-exemption-remove-btn {
  border: 1px solid rgba(239, 68, 68, 0.42);
  border-radius: 0.45rem;
  background: rgba(239, 68, 68, 0.13);
  color: rgba(254, 202, 202, 0.95);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.36rem 0.58rem;
}

.substitute-exemption-empty {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.52);
  padding: 0.25rem 0;
}

/* ── Event Modal ── */
#event-modal {
  display: none;
}

#event-modal.show {
  display: flex;
}

#event-modal > div:last-child {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
  overflow: hidden;
}

#event-form {
  overflow-y: auto;
  min-height: 0;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

#event-form::-webkit-scrollbar {
  width: 10px;
}

#event-form::-webkit-scrollbar-track {
  background: transparent;
}

#event-form::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid transparent;
  background-clip: content-box;
}

#event-form::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
  background-clip: content-box;
}

#color-labels-modal {
  display: none;
}

#color-labels-modal.show {
  display: flex;
}

#import-preview-modal {
  display: none;
}

#import-preview-modal.show {
  display: flex;
}

#import-report-modal {
  display: none;
}

#import-report-modal.show {
  display: flex;
}

.import-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.86);
}

.import-detail-head {
  text-align: left;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
  padding: 0.36rem 0.42rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  position: sticky;
  top: 0;
  background: rgba(17, 21, 36, 0.96);
  backdrop-filter: blur(2px);
}

.import-detail-head-right,
.import-detail-cell-right {
  text-align: right;
}

.import-detail-cell {
  padding: 0.42rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

.import-detail-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}

.import-detail-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.08);
}

.event-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.event-form-field label {
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.76);
}

.event-form-field input {
  width: 100%;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(23, 27, 45, 0.9);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.7rem 0.85rem;
  outline: none;
  font-size: 0.92rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.event-form-field select {
  width: 100%;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(23, 27, 45, 0.9);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.7rem 0.85rem;
  outline: none;
  font-size: 0.92rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.event-tag-listbox {
  width: 100%;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(23, 27, 45, 0.9);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.45rem 0.55rem;
  outline: none;
  font-size: 0.88rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.event-tag-listbox:focus {
  border-color: rgba(99, 102, 241, 0.9);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.event-tag-listbox option {
  padding: 0.25rem 0.4rem;
}

#event-tags-container > div {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

#event-tags-container > div > label {
  color: rgba(255, 255, 255, 0.7);
}

#event-tags-container > div > p {
  color: rgba(255, 255, 255, 0.55);
}

.event-form-field input:focus,
.event-form-field select:focus {
  border-color: rgba(99, 102, 241, 0.9);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.event-color-quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.event-color-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.event-color-pick:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.14);
}

.event-color-pick.active {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(99, 102, 241, 0.2);
  color: rgba(255, 255, 255, 0.98);
}

.event-color-pick-dot {
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.event-color-pick-dot.is-none {
  border: 1px dashed rgba(255, 255, 255, 0.5);
  box-shadow: none;
}

.color-labels-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: min(62vh, 680px);
  overflow-y: auto;
  padding-right: 0.2rem;
}

.color-label-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 0.6rem;
}

.color-label-main {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
}

.color-label-primary-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}

.color-label-primary-checkbox {
  width: 0.85rem;
  height: 0.85rem;
  margin: 0;
  accent-color: #6366f1;
  cursor: pointer;
}

.color-label-category-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.color-label-category-delete:hover {
  border-color: rgba(244, 114, 182, 0.48);
  background: rgba(244, 114, 182, 0.18);
  color: rgba(255, 255, 255, 0.95);
}

.color-label-category-delete:focus-visible {
  outline: 2px solid rgba(244, 114, 182, 0.65);
  outline-offset: 1px;
}

.color-label-category-delete svg {
  width: 1rem;
  height: 1rem;
  pointer-events: none;
}

.color-label-tree {
  border-radius: 0.58rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 14, 26, 0.45);
}

.color-label-tree-summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  padding: 0.45rem 0.55rem;
}

.color-label-tree-summary::-webkit-details-marker {
  display: none;
}

.color-label-tree-summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.4rem;
  transition: transform 0.15s ease;
}

.color-label-tree[open] .color-label-tree-summary::before {
  transform: rotate(90deg);
}

.color-label-tree-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0.55rem 0.55rem;
}

.color-label-tags-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.color-label-tag-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: fit-content;
}

.color-label-quick-palette {
  position: absolute;
  top: calc(100% + 0.32rem);
  left: 0;
  z-index: 30;
  display: none;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.28rem;
  padding: 0.45rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 18, 33, 0.98);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
  min-width: 11rem;
}

.color-label-quick-palette.is-open {
  display: grid;
}

.color-label-quick-color {
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  cursor: pointer;
  padding: 0;
}

.color-label-quick-color.is-selected {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
}

.color-label-quick-color-more {
  grid-column: 1 / -1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.36rem;
  cursor: pointer;
}

.color-label-quick-color-more:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.18);
}

.color-label-tags-empty {
  margin: 0;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.52);
}

.color-label-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(2, 6, 23, 0.28);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  width: fit-content;
}

.color-label-tag-chip-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  border: 0;
  padding: 0;
  appearance: none;
  cursor: pointer;
}

.color-label-tag-chip-text {
  line-height: 1;
}

.color-label-tag-color {
  width: 2rem;
  height: 1.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  padding: 0.12rem;
}

.color-label-tag-color-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.color-label-tag-row > .color-label-tag-color {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.color-label-tag-remove {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  width: 1.15rem;
  height: 1.15rem;
}

.color-label-tag-remove:hover {
  background: rgba(244, 114, 182, 0.16);
  color: rgba(255, 255, 255, 0.95);
}

.color-label-tag-remove svg {
  width: 0.72rem;
  height: 0.72rem;
  pointer-events: none;
}

.color-label-tag-add-wrap {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
}

.color-label-tag-add-color-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.color-label-tag-add-color-btn {
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.color-label-quick-palette-add {
  left: auto;
  right: 0;
}

.color-label-tag-input {
  width: 100%;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(23, 27, 45, 0.9);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.45rem 0.6rem;
  outline: none;
  font-size: 0.8rem;
}

.color-label-tag-input:focus {
  border-color: rgba(99, 102, 241, 0.9);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.color-label-tag-add {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  border-radius: 0.5rem;
  font-size: 0.74rem;
  padding: 0.4rem 0.58rem;
  cursor: pointer;
}

.color-label-tag-add:hover {
  border-color: rgba(99, 102, 241, 0.46);
  background: rgba(99, 102, 241, 0.18);
}

.color-label-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.color-label-name {
  width: 100%;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(23, 27, 45, 0.9);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.5rem 0.65rem;
  outline: none;
  font-size: 0.82rem;
}

.color-label-name:focus {
  border-color: rgba(99, 102, 241, 0.9);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.color-label-picker {
  width: 2.15rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  padding: 0.12rem;
}

.color-label-remove {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  padding: 0.42rem 0.58rem;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.color-label-remove:hover {
  border-color: rgba(244, 114, 182, 0.5);
  background: rgba(244, 114, 182, 0.18);
}

.event-move-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-top: 0.25rem;
}

.event-move-btn {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  padding: 0.75rem 1rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.event-move-btn:hover {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.45);
  color: rgba(255, 255, 255, 0.98);
}

/* ── Toast ── */
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Event Context Menu ── */
.event-context-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  min-width: 150px;
  padding: 0.35rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 16, 30, 0.96);
  box-shadow: 0 14px 32px -18px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(0.98);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.event-context-menu.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.event-context-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: left;
  border-radius: 0.45rem;
  padding: 0.42rem 0.58rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.event-context-menu-item:hover {
  background: rgba(99, 102, 241, 0.16);
  color: rgba(255, 255, 255, 0.98);
}

.event-context-menu-item:disabled {
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.36);
}

.event-context-menu-item:disabled:hover {
  background: transparent;
}

/* ── Spreadsheet View ── */
.spreadsheet-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.spreadsheet-view-shell {
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 18, 33, 0.58);
  padding: 0.75rem;
  box-shadow: 0 18px 38px -26px rgba(0, 0, 0, 0.72);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) rgba(255, 255, 255, 0.08);
}

.spreadsheet-help-text {
  margin: 0 0 0.65rem;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.calendar-spreadsheet {
  width: max-content;
  min-width: 100%;
  min-height: 360px;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  overflow: visible;
}

.calendar-spreadsheet > * {
  margin-left: 0;
  margin-right: 0;
}

.calendar-spreadsheet .jexcel {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 13, 24, 0.8);
  color: rgba(255, 255, 255, 0.9);
}

.calendar-spreadsheet .jexcel > thead > tr > td {
  background: rgba(99, 102, 241, 0.22);
  color: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

.calendar-spreadsheet .jexcel > tbody > tr > td {
  background: rgba(15, 18, 33, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
}

.calendar-spreadsheet .jexcel > tbody > tr:nth-child(even) > td {
  background: rgba(20, 24, 43, 0.88);
}

.calendar-spreadsheet .jexcel > tbody > tr > td.highlight {
  background: rgba(99, 102, 241, 0.32) !important;
}

.calendar-spreadsheet .jexcel tbody tr td.selected {
  box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.7);
}

html:not(.dark) .spreadsheet-view-shell {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(241, 245, 249, 0.82);
  box-shadow: 0 12px 30px -22px rgba(15, 23, 42, 0.35);
  scrollbar-color: rgba(15, 23, 42, 0.24) rgba(15, 23, 42, 0.08);
}

html:not(.dark) .spreadsheet-help-text {
  color: rgba(15, 23, 42, 0.62);
}

html:not(.dark) .calendar-spreadsheet .jexcel {
  border-color: rgba(15, 23, 42, 0.18);
  background: #ffffff;
  color: rgba(15, 23, 42, 0.86);
}

html:not(.dark) .calendar-spreadsheet .jexcel > thead > tr > td {
  background: rgba(79, 70, 229, 0.12);
  color: rgba(15, 23, 42, 0.9);
  border-color: rgba(15, 23, 42, 0.12);
}

html:not(.dark) .calendar-spreadsheet .jexcel > tbody > tr > td {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
}

html:not(.dark) .calendar-spreadsheet .jexcel > tbody > tr:nth-child(even) > td {
  background: rgba(248, 250, 252, 1);
}

html:not(.dark) .spreadsheet-view-shell::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.22);
}

html:not(.dark) .spreadsheet-view-shell::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.34);
}

/* ── Responsive tweaks ── */
@media (max-width: 640px) {
  .control-sidebar {
    width: min(92vw, 320px);
  }

  #calendar-grid.mobile-linear-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }

  #calendar-grid.mobile-linear-list .day-cell {
    min-height: 92px;
  }

  #calendar-grid.mobile-linear-list .day-weekday {
    display: inline;
  }

  .day-cell {
    min-height: 80px;
    padding: 0.25rem;
  }
  .cards-container {
    max-height: 120px;
  }
  .day-header {
    font-size: 0.55rem;
  }

  #view-week {
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  #week-headers-row,
  #week-grid {
    min-width: 760px;
  }

  #week-grid .day-cell {
    height: calc(100vh - 17.5rem);
    height: calc(100dvh - 17.5rem);
    min-height: 180px;
  }
}

/* ── Light Theme Overrides ── */
html:not(.dark) body {
  background: #ffffff !important;
  color: #0f172a !important;
}

html:not(.dark) #app-header {
  background: rgba(255, 255, 255, 0.86) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

html:not(.dark) #header-logo h1 {
  background-image: linear-gradient(90deg, #0f172a, #334155) !important;
}

html:not(.dark) #header-logo p {
  color: rgba(15, 23, 42, 0.45) !important;
}

html:not(.dark) .header-btn {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(148, 163, 184, 0.08);
}

html:not(.dark) .header-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.28);
}

html:not(.dark) .sidebar-toggle-btn {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(148, 163, 184, 0.08);
  color: rgba(15, 23, 42, 0.72);
}

html:not(.dark) .sidebar-toggle-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  color: rgba(15, 23, 42, 0.92);
}

html:not(.dark) .google-auth-btn {
  border-color: rgba(15, 23, 42, 0.2);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(15, 23, 42, 0.92);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.15);
}

html:not(.dark) .google-auth-btn:hover {
  background: rgba(79, 70, 229, 0.1);
  border-color: rgba(79, 70, 229, 0.3);
  color: rgba(15, 23, 42, 0.98);
}

html:not(.dark) .google-auth-avatar-wrap {
  background: rgba(15, 23, 42, 0.1);
}

html:not(.dark) .google-auth-avatar-fallback {
  color: rgba(15, 23, 42, 0.9);
}

html:not(.dark) .view-switcher-wrap {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(148, 163, 184, 0.1);
}

html:not(.dark) .view-switcher-select {
  border-color: rgba(15, 23, 42, 0.18);
  background: #ffffff;
  color: rgba(15, 23, 42, 0.84);
}

html:not(.dark) .label-filter-toggle::after {
  border-right-color: rgba(15, 23, 42, 0.55);
  border-bottom-color: rgba(15, 23, 42, 0.55);
}

html:not(.dark) .label-filter-menu {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

html:not(.dark) .label-filter-option {
  color: rgba(15, 23, 42, 0.82);
}

html:not(.dark) .label-filter-option:hover {
  background: rgba(79, 70, 229, 0.12);
}

html:not(.dark) .week-header {
  color: rgba(15, 23, 42, 0.55);
}

html:not(.dark) .week-header.out-of-month {
  color: rgba(15, 23, 42, 0.32);
}

html:not(.dark) .sidebar-backdrop {
  background: rgba(15, 23, 42, 0.22);
}

html:not(.dark) .control-sidebar {
  border-right-color: rgba(15, 23, 42, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow: 18px 0 40px -20px rgba(15, 23, 42, 0.38);
}

html:not(.dark) .sidebar-title {
  color: #0f172a;
}

html:not(.dark) .sidebar-close-btn {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(148, 163, 184, 0.08);
  color: rgba(15, 23, 42, 0.7);
}

html:not(.dark) .sidebar-close-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.28);
  color: rgba(15, 23, 42, 0.92);
}

html:not(.dark) .sidebar-section-label {
  color: rgba(15, 23, 42, 0.38);
}

html:not(.dark) .sidebar-divider {
  border-top-color: rgba(15, 23, 42, 0.09);
}

html:not(.dark) .sidebar-theme-row {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(148, 163, 184, 0.08);
}

html:not(.dark) .sidebar-theme-row [data-icon] {
  color: rgba(15, 23, 42, 0.5);
}

html:not(.dark) [data-theme-label] {
  color: rgba(15, 23, 42, 0.6);
}

html:not(.dark) .theme-toggle {
  border-color: rgba(15, 23, 42, 0.2);
  background: rgba(15, 23, 42, 0.08);
}

html:not(.dark) .theme-toggle[aria-checked="true"] {
  background: #6366f1;
  border-color: #6366f1;
}

html:not(.dark) .theme-toggle-thumb {
  background: #fff;
}

html:not(.dark) .sidebar-fy-wrap {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(148, 163, 184, 0.08);
}

html:not(.dark) .sidebar-fy-label {
  color: rgba(15, 23, 42, 0.58);
}

html:not(.dark) #substitute-modal > div:last-child {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(15, 23, 42, 0.1);
}

html:not(.dark) #event-modal > div:last-child {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(15, 23, 42, 0.1);
}

html:not(.dark) #event-form {
  scrollbar-color: rgba(15, 23, 42, 0.24) transparent;
}

html:not(.dark) #event-form::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.22);
}

html:not(.dark) #event-form::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.34);
}

html:not(.dark) #color-labels-modal > div:last-child {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(15, 23, 42, 0.1);
}

html:not(.dark) #import-report-modal > div:last-child {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(15, 23, 42, 0.1);
}

html:not(.dark) #import-preview-modal > div:last-child {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(15, 23, 42, 0.1);
}

html:not(.dark) #substitute-modal h3 {
  color: #0f172a;
}

html:not(.dark) #event-modal h3 {
  color: #0f172a;
}

html:not(.dark) #color-labels-modal h3 {
  color: #0f172a;
}

html:not(.dark) #import-report-modal h3 {
  color: #0f172a;
}

html:not(.dark) #import-preview-modal h3 {
  color: #0f172a;
}

html:not(.dark) #import-report-summary {
  color: rgba(15, 23, 42, 0.7) !important;
}

html:not(.dark) #import-report-counts > div {
  border-color: rgba(15, 23, 42, 0.12) !important;
  background: rgba(241, 245, 249, 0.75) !important;
  color: rgba(15, 23, 42, 0.85) !important;
}

html:not(.dark) #import-report-counts > div > div:first-child {
  color: rgba(15, 23, 42, 0.5) !important;
}

html:not(.dark) #import-report-errors-wrap {
  border-color: rgba(15, 23, 42, 0.12) !important;
  background: rgba(241, 245, 249, 0.7) !important;
}

html:not(.dark) #import-report-log-wrap {
  border-color: rgba(15, 23, 42, 0.12) !important;
  background: rgba(241, 245, 249, 0.7) !important;
}

html:not(.dark) #import-report-errors-wrap h4 {
  color: rgba(15, 23, 42, 0.55) !important;
}

html:not(.dark) #import-report-log-wrap h4 {
  color: rgba(15, 23, 42, 0.55) !important;
}

html:not(.dark) #import-report-errors {
  color: rgba(159, 18, 57, 0.9) !important;
}

html:not(.dark) #import-preview-summary {
  color: rgba(15, 23, 42, 0.7) !important;
}

html:not(.dark) #import-preview-counts > div {
  border-color: rgba(15, 23, 42, 0.12) !important;
  background: rgba(241, 245, 249, 0.75) !important;
  color: rgba(15, 23, 42, 0.85) !important;
}

html:not(.dark) #import-preview-counts > div > div:first-child {
  color: rgba(15, 23, 42, 0.5) !important;
}

html:not(.dark) #import-preview-ignored-wrap,
html:not(.dark) #import-preview-errors-wrap {
  border-color: rgba(15, 23, 42, 0.12) !important;
  background: rgba(241, 245, 249, 0.7) !important;
}

html:not(.dark) #import-preview-ignored-wrap h4,
html:not(.dark) #import-preview-errors-wrap h4 {
  color: rgba(15, 23, 42, 0.55) !important;
}

html:not(.dark) #import-preview-ignored {
  color: rgba(146, 64, 14, 0.9) !important;
}

html:not(.dark) #import-preview-errors {
  color: rgba(159, 18, 57, 0.9) !important;
}

html:not(.dark) .import-details-table {
  color: rgba(15, 23, 42, 0.88);
}

html:not(.dark) .import-detail-head {
  color: rgba(15, 23, 42, 0.58);
  border-bottom-color: rgba(15, 23, 42, 0.14);
  background: rgba(241, 245, 249, 0.98);
}

html:not(.dark) .import-detail-cell {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

html:not(.dark) .import-detail-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.96);
}

html:not(.dark) .import-detail-row:nth-child(even) {
  background: rgba(241, 245, 249, 0.92);
}

html:not(.dark) #btn-import-preview-cancel {
  border-color: rgba(15, 23, 42, 0.16) !important;
  background: rgba(148, 163, 184, 0.12) !important;
  color: rgba(15, 23, 42, 0.85) !important;
}

html:not(.dark) #btn-import-preview-cancel:hover {
  background: rgba(148, 163, 184, 0.2) !important;
}

html:not(.dark) .substitute-row label {
  color: rgba(15, 23, 42, 0.8);
}

html:not(.dark) .event-form-field label {
  color: rgba(15, 23, 42, 0.8);
}

html:not(.dark) .substitute-row input {
  border-color: rgba(15, 23, 42, 0.16);
  background: #ffffff;
  color: #0f172a;
}

html:not(.dark) .event-form-field input {
  border-color: rgba(15, 23, 42, 0.16);
  background: #ffffff;
  color: #0f172a;
}

html:not(.dark) .event-form-field select,
html:not(.dark) .color-label-name {
  border-color: rgba(15, 23, 42, 0.16);
  background: #ffffff;
  color: #0f172a;
}

html:not(.dark) .event-tag-listbox,
html:not(.dark) .color-label-tag-input {
  border-color: rgba(15, 23, 42, 0.16);
  background: #ffffff;
  color: #0f172a;
}

html:not(.dark) #event-tags-container > div {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.92);
}

html:not(.dark) #event-tags-container > div > label {
  color: rgba(15, 23, 42, 0.82);
}

html:not(.dark) #event-tags-container > div > p {
  color: rgba(15, 23, 42, 0.58);
}

html:not(.dark) .event-color-pick {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(241, 245, 249, 0.9);
  color: rgba(15, 23, 42, 0.76);
}

html:not(.dark) .event-color-pick.active {
  border-color: rgba(79, 70, 229, 0.55);
  background: rgba(79, 70, 229, 0.14);
  color: rgba(15, 23, 42, 0.9);
}

html:not(.dark) .event-color-pick-dot.is-none {
  border-color: rgba(15, 23, 42, 0.42);
}

html:not(.dark) .color-label-row {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.75);
}

html:not(.dark) .color-label-tree {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(241, 245, 249, 0.75);
}

html:not(.dark) .color-label-tree-summary {
  color: rgba(15, 23, 42, 0.72);
}

html:not(.dark) .color-label-category-delete {
  border-color: rgba(15, 23, 42, 0.18);
  background: rgba(148, 163, 184, 0.14);
  color: rgba(15, 23, 42, 0.78);
}

html:not(.dark) .color-label-category-delete:hover {
  border-color: rgba(225, 29, 72, 0.42);
  background: rgba(244, 114, 182, 0.2);
  color: rgba(15, 23, 42, 0.95);
}

html:not(.dark) .color-label-tags-empty {
  color: rgba(15, 23, 42, 0.56);
}

html:not(.dark) .color-label-tag-chip {
  border-color: rgba(15, 23, 42, 0.22);
  background: rgba(241, 245, 249, 0.85);
  color: rgba(15, 23, 42, 0.86);
}

html:not(.dark) .color-label-quick-palette {
  border-color: rgba(15, 23, 42, 0.2);
  background: rgba(255, 255, 255, 0.98);
}

html:not(.dark) .color-label-quick-color {
  border-color: rgba(15, 23, 42, 0.22);
}

html:not(.dark) .color-label-quick-color.is-selected {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.8);
}

html:not(.dark) .color-label-quick-color-more {
  border-color: rgba(15, 23, 42, 0.18);
  background: rgba(148, 163, 184, 0.14);
  color: rgba(15, 23, 42, 0.82);
}

html:not(.dark) .color-label-tag-remove {
  color: rgba(15, 23, 42, 0.62);
}

html:not(.dark) .color-label-tag-remove:hover {
  background: rgba(244, 114, 182, 0.18);
  color: rgba(15, 23, 42, 0.9);
}

html:not(.dark) .color-label-tag-add {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(148, 163, 184, 0.14);
  color: rgba(15, 23, 42, 0.75);
}

html:not(.dark) .color-label-dot {
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2);
}

html:not(.dark) .color-label-picker {
  border-color: rgba(15, 23, 42, 0.2);
}

html:not(.dark) .color-label-tag-color {
  border-color: rgba(15, 23, 42, 0.2);
}

html:not(.dark) .color-label-tag-add-color-btn {
  border-color: rgba(15, 23, 42, 0.2);
}

html:not(.dark) .color-label-remove {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(148, 163, 184, 0.14);
  color: rgba(15, 23, 42, 0.75);
}

html:not(.dark) .day-cell .day-number {
  color: rgba(15, 23, 42, 0.58);
}

html:not(.dark) .day-allotment {
  color: rgba(15, 23, 42, 0.55);
}

html:not(.dark) .day-weekday {
  color: rgba(15, 23, 42, 0.55);
}

html:not(.dark) .task-card {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(241, 245, 249, 0.85);
}

html:not(.dark) .task-card.has-color-label {
  background: linear-gradient(135deg, var(--card-label-soft, rgba(79, 70, 229, 0.14)), rgba(255, 255, 255, 0.9));
}

html:not(.dark) .cards-container.has-overflow {
  scrollbar-color: rgba(15, 23, 42, 0.42) rgba(15, 23, 42, 0.12);
}

html:not(.dark) .cards-container.has-overflow::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.12);
}

html:not(.dark) .cards-container.has-overflow::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.42);
}

html:not(.dark) .cards-container.has-overflow::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.55);
}

html:not(.dark) .sidebar-actions {
  scrollbar-color: rgba(15, 23, 42, 0.28) transparent;
}

html:not(.dark) .sidebar-actions::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.28);
}

html:not(.dark) .sidebar-actions::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.45);
}

html:not(.dark) .task-card .card-title {
  color: rgba(15, 23, 42, 0.82);
}

html:not(.dark) .task-card .card-subs-count {
  color: rgba(15, 23, 42, 0.48);
}

html:not(.dark) .task-card .card-label-dot {
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.22);
}

html:not(.dark) .event-context-menu {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 34px -20px rgba(15, 23, 42, 0.28);
}

html:not(.dark) .event-context-menu-item {
  color: rgba(15, 23, 42, 0.84);
}

html:not(.dark) .event-context-menu-item:hover {
  background: rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.98);
}

html:not(.dark) .event-context-menu-item:disabled {
  color: rgba(15, 23, 42, 0.34);
}

html:not(.dark) .header-btn svg,
html:not(.dark) .header-btn span {
  color: rgba(15, 23, 42, 0.65) !important;
}

html:not(.dark) #fiscal-year-label {
  color: rgba(15, 23, 42, 0.55) !important;
}

html:not(.dark) #fiscal-year-select {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.16) !important;
  color: rgba(15, 23, 42, 0.8) !important;
}

html:not(.dark) #view-dashboard h2 span {
  background-image: none !important;
  color: #0f172a !important;
}

html:not(.dark) #view-dashboard p {
  color: rgba(15, 23, 42, 0.58) !important;
}

html:not(.dark) .month-tile {
  border-color: rgba(15, 23, 42, 0.1);
  background: linear-gradient(145deg, rgba(248, 250, 252, 1), rgba(241, 245, 249, 1));
}

html:not(.dark) .month-tile:hover {
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 12px 36px -12px rgba(15, 23, 42, 0.22);
}

html:not(.dark) .month-tile .tile-sub-summary {
  color: rgba(15, 23, 42, 0.55);
}

html:not(.dark) .month-tile .tile-month-name {
  color: #0f172a;
}

html:not(.dark) .month-tile .tile-year {
  color: rgba(15, 23, 42, 0.5);
}

html:not(.dark) .month-tile .tile-task-count {
  color: rgba(15, 23, 42, 0.55);
}

html:not(.dark) #btn-back {
  color: rgba(15, 23, 42, 0.62) !important;
}

html:not(.dark) #btn-back:hover {
  color: #0f172a !important;
}

html:not(.dark) #btn-back-week {
  color: rgba(15, 23, 42, 0.62) !important;
}

html:not(.dark) #btn-back-week:hover {
  color: #0f172a !important;
}

html:not(.dark) #month-title {
  color: #0f172a;
}

html:not(.dark) #week-title {
  color: #0f172a;
}

html:not(.dark) .month-nav-btn {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(148, 163, 184, 0.1);
  color: rgba(15, 23, 42, 0.56);
}

html:not(.dark) .day-header {
  color: rgba(15, 23, 42, 0.5);
}

html:not(.dark) .day-cell {
  border-color: rgba(15, 23, 42, 0.1);
  background: #f8fafc;
}

html:not(.dark) .day-cell:not(.empty):hover {
  border-color: rgba(15, 23, 42, 0.14);
  background: #f1f5f9;
}

html:not(.dark) .day-cell.empty {
  background: rgba(241, 245, 249, 0.65);
}

html:not(.dark) .day-cell.today {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.09);
  box-shadow: 0 0 20px -8px rgba(99, 102, 241, 0.3);
}

html:not(.dark) .day-cell.day-exempt {
  border-color: rgba(239, 68, 68, 0.36);
  background: rgba(254, 226, 226, 0.8);
}

html:not(.dark) .day-cell.day-exempt:hover {
  border-color: rgba(239, 68, 68, 0.44);
  background: rgba(254, 202, 202, 0.85);
}

html:not(.dark) .day-cell.out-of-month {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(226, 232, 240, 0.65);
}

html:not(.dark) .day-cell.out-of-month:hover {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(226, 232, 240, 0.65);
}

html:not(.dark) .day-cell .day-number {
  color: rgba(15, 23, 42, 0.62);
}

html:not(.dark) .week-time-labels {
  background: rgba(241, 245, 249, 0.5);
}

html:not(.dark) .week-time-label {
  color: rgba(15, 23, 42, 0.5);
  border-right-color: rgba(15, 23, 42, 0.08);
}

html:not(.dark) .week-day-column {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(241, 245, 249, 0.4);
}

html:not(.dark) .week-day-header {
  background: rgba(226, 232, 240, 0.6);
  color: rgba(15, 23, 42, 0.8);
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

html:not(.dark) .week-day-header.today {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.3);
}

html:not(.dark) .week-day-column.exempt {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(254, 242, 242, 0.8);
}

html:not(.dark) .week-day-header.exempt {
  background: rgba(254, 226, 226, 0.92);
  color: rgba(127, 29, 29, 0.9);
  border-bottom-color: rgba(239, 68, 68, 0.32);
}

html:not(.dark) .substitute-exemptions-header h4 {
  color: rgba(15, 23, 42, 0.8);
}

html:not(.dark) .substitute-exemptions-help,
html:not(.dark) .substitute-exemption-empty {
  color: rgba(15, 23, 42, 0.58);
}

html:not(.dark) .substitute-exemption-add-btn {
  border-color: rgba(15, 23, 42, 0.2);
  color: rgba(15, 23, 42, 0.82);
  background: rgba(226, 232, 240, 0.65);
}

html:not(.dark) .substitute-exemption-add-btn:hover {
  border-color: rgba(15, 23, 42, 0.32);
  background: rgba(203, 213, 225, 0.75);
}

html:not(.dark) .substitute-exemption-row input[type="date"] {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(248, 250, 252, 0.95);
  color: rgba(15, 23, 42, 0.92);
}

html:not(.dark) .substitute-exemptions-list {
  scrollbar-color: rgba(15, 23, 42, 0.36) rgba(15, 23, 42, 0.08);
}

html:not(.dark) .substitute-exemptions-list::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.08);
}

html:not(.dark) .substitute-exemptions-list::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.36);
}

html:not(.dark) .substitute-exemptions-list::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.5);
}

html:not(.dark) .substitute-exemption-remove-btn {
  border-color: rgba(239, 68, 68, 0.48);
  background: rgba(254, 226, 226, 0.9);
  color: rgba(153, 27, 27, 0.92);
}

html:not(.dark) .week-time-slot {
  background: rgba(248, 250, 252, 0.6);
  border-bottom-color: rgba(15, 23, 42, 0.06);
}

html:not(.dark) .week-time-slot:hover {
  background: rgba(226, 232, 240, 0.5);
}

html:not(.dark) .week-time-slot.drag-over {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: rgba(99, 102, 241, 0.4);
}

html:not(.dark) .task-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.12);
}

html:not(.dark) .task-card .drag-handle .grip span {
  background: rgba(15, 23, 42, 0.65);
}

html:not(.dark) .task-card .card-input {
  color: rgba(15, 23, 42, 0.82);
}

html:not(.dark) .task-card .card-input::placeholder {
  color: rgba(15, 23, 42, 0.3);
}

html:not(.dark) .add-card-btn {
  border-color: rgba(15, 23, 42, 0.16);
  color: rgba(15, 23, 42, 0.44);
}

html:not(.dark) #toast > div {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.1);
  color: rgba(15, 23, 42, 0.78);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.16);
}
