:root {
  --bg-primary: #141414;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #222222;
  --bg-hover: #2a2a2a;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.05);
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.4);
  --accent: #6b7280;
  --accent-hover: #9ca3af;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
}

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

body {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Mobile header controls button */
.mobile-header-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

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

.mobile-header-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

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

.header-center {
  flex: 2;
  display: flex;
  justify-content: center;
  max-width: 400px;
}

.web-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  width: 100%;
  transition: all 0.15s;
}

.web-search-form:focus-within {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.web-search-form svg { color: var(--text-muted); flex-shrink: 0; }

.web-search-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
  outline: none;
}

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

@media (max-width: 640px) {
  .header-center { display: none; }
}

.back-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.back-btn svg { width: 20px; height: 20px; }

.header-title {
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-primary);
}

.header-actions { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; }

.sign-in-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.sign-in-btn:hover { background: var(--bg-hover); }
.sign-in-btn.signed-in { 
  color: #f87171; 
  border-color: rgba(248, 113, 113, 0.3); 
}
.sign-in-btn.signed-in:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.5);
}
.sign-in-btn svg { width: 14px; height: 14px; }

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

/* Day Picker (mobile only) */
.day-picker {
  background: var(--bg-secondary);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  width: 100%;
  max-width: 100%;
}

.day-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 6px;
}

.day-picker-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.day-picker-nav button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.day-picker-nav button:hover { background: var(--bg-hover); }

.week-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}

.week-nav-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
.week-nav-btn svg { width: 14px; height: 14px; }

.day-picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 0 8px;
}

.day-picker-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.1s;
}

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

.day-picker-day.active {
  background: var(--text-primary);
}

.day-picker-day.active .day-letter,
.day-picker-day.active .day-date {
  color: var(--bg-primary);
}

.day-picker-day.today .day-date {
  color: var(--accent);
  font-weight: 600;
}

.day-letter {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.day-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Tabs for desktop - merged with header */
.tab-bar {
  display: none;
  align-items: center;
  gap: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 0 16px;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

/* Inverted corners - filled background with curved border */
.tab-bar::before,
.tab-bar::after {
  content: '';
  position: absolute;
  top: 0;
  width: 12px;
  height: 12px;
}

.tab-bar::before {
  left: -12px;
  background: radial-gradient(circle at 0% 100%, transparent 11px, var(--border) 11px, var(--border) 12px, var(--bg-secondary) 12px);
}

.tab-bar::after {
  right: -12px;
  background: radial-gradient(circle at 100% 100%, transparent 11px, var(--border) 11px, var(--border) 12px, var(--bg-secondary) 12px);
}

/* Header bottom edge styling for seamless connection */
@media (min-width: 769px) {
  .header {
    border-bottom: none;
    padding-bottom: 8px;
    position: relative;
  }
  
  /* Left border segment */
  .header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: calc(50% - 550px - 10.5px);
    min-width: 0;
    height: 1px;
    background: var(--border);
  }
  
  /* Right border segment */
  .header::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: calc(50% - 550px - 10.5px);
    min-width: 0;
    height: 1px;
    background: var(--border);
  }
}

.tab-btn {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}

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

.tab-spacer { flex: 1; }

.tab-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.search-bar-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 8px;
}

.search-bar-inline svg { color: var(--text-muted); flex-shrink: 0; }

.search-input-inline {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  width: 120px;
  outline: none;
}

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

/* Filter dropdown */
.filter-dropdown-wrapper {
  position: relative;
}

.filter-dropdown-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  transition: all 0.1s;
}

.filter-dropdown-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.filter-dropdown-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.filter-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  min-width: 150px;
  z-index: 1000;
  padding: 4px;
}

.filter-dropdown-menu.open { display: block; }

/* Mobile filter dropdown opens upward */
.mobile-controls-dropdown .filter-dropdown-menu {
  top: auto;
  bottom: calc(100% + 4px);
}

.filter-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background 0.1s;
}

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

.filter-dropdown-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

.filter-dropdown-item svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Legacy filter pills (keeping for compatibility) */
.filter-pills {
  display: flex;
  gap: 4px;
}

.filter-pill {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

.filter-pill:hover { border-color: var(--text-muted); }
.filter-pill.active { background: var(--accent); border-color: var(--accent); color: white; }

.clear-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.clear-btn:hover { background: var(--bg-hover); color: #dc2626; border-color: #dc2626; }

/* Mobile controls dropdown (triggered from header) */
.mobile-controls-dropdown {
  position: fixed;
  top: 52px;
  right: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  padding: 8px;
  min-width: 240px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 150;
}

.mobile-controls-dropdown.open {
  display: flex;
}

/* Mobile filter dropdown opens downward now */
.mobile-controls-dropdown .filter-dropdown-menu {
  top: calc(100% + 4px);
  bottom: auto;
}

.mobile-dropdown-row {
  display: flex;
  gap: 6px;
}

.mobile-dropdown-actions {
  align-items: center;
}

/* Mobile controls - legacy class for compatibility */
.mobile-controls {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-bar-mobile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  flex: 1;
}

.search-bar-mobile svg { color: var(--text-muted); flex-shrink: 0; }

.search-input-mobile {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  flex: 1;
  outline: none;
  min-width: 0;
}

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

.mobile-filter-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.clear-btn-mobile {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.clear-btn-mobile:hover { background: var(--bg-hover); color: #dc2626; border-color: #dc2626; }

@media (min-width: 769px) {
  .tab-bar { display: flex; }
  .day-picker { display: none !important; }
  .mobile-schedule { display: none !important; }
  .desktop-views { display: block !important; }
  .mobile-controls-fab { display: none !important; }
}

@media (max-width: 768px) {
  .tab-bar { display: none !important; }
  .day-picker { display: block !important; }
  .mobile-schedule { display: block !important; }
  .desktop-views { display: none !important; }
}

/* Schedule View */
.schedule-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px 12px 80px;
}

.schedule-view {
  background: transparent;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.time-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 6px;
}

.time-divider-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.time-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* Task cards in schedule */
.schedule-task {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin: 2px 0;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.schedule-task:hover { background: var(--bg-hover); }

.schedule-task.dragging { opacity: 0.5; }

.schedule-task-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
}

.schedule-task-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.schedule-task-checkbox.checked::after {
  content: "✓";
  color: white;
  font-size: 11px;
  font-weight: bold;
}

.schedule-task-content {
  flex: 1;
  min-width: 0;
}

.schedule-task-text {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  word-wrap: break-word;
}

.schedule-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.schedule-task-time {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.schedule-task-time svg {
  width: 12px;
  height: 12px;
}

.task-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.task-tag.priority-none { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.task-tag.priority-high { background: rgba(244, 63, 94, 0.2); color: #fda4af; }
.task-tag.priority-medium { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.task-tag.priority-low { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }

.task-tag.status { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }
.task-tag.status-started { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.task-tag.status-notstarted { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.task-tag.status-progress { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.task-tag.status-completed { background: rgba(34, 197, 94, 0.2); color: #86efac; }

/* Status tag with icon */
.task-tag.status-icon {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
}

.task-tag.status-icon svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.task-tag svg { width: 10px; height: 10px; flex-shrink: 0; }
.task-tag.priority-tag { display: flex; align-items: center; gap: 2px; padding: 2px 5px; }

.schedule-task.completed .schedule-task-text {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Task color variations (dark mode) */
.schedule-task.color-grey { border-left-color: #6b7280; }
.schedule-task.color-rose { border-left-color: #f43f5e; }
.schedule-task.color-purple { border-left-color: #8b5cf6; }
.schedule-task.color-amber { border-left-color: #f59e0b; }
.schedule-task.color-sky { border-left-color: #0ea5e9; }
.schedule-task.color-emerald { border-left-color: #10b981; }


/* Tool icons */
.tool-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.tool-icon svg {
  width: 20px;
  height: 20px;
}

.tool-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-modal-title svg {
  color: var(--accent);
}


/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
}

.modal.active { display: flex; }

@media (min-width: 640px) {
  .modal { align-items: center; }
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-field { margin-bottom: 8px; }
.modal-textarea { min-height: 50px; }

/* Compact modal on small screens */
@media (max-height: 700px) {
  .modal-content {
    max-height: 90vh;
    padding: 12px;
  }
  .modal-field { margin-bottom: 6px; }
  .modal-label { margin-bottom: 4px; font-size: 11px; }
  .modal-input, .modal-textarea { padding: 8px 10px; font-size: 13px; }
  .modal-tags { gap: 4px; }
  .modal-tag { padding: 5px 10px; font-size: 12px; }
  .modal-header { margin-bottom: 12px; font-size: 15px; }
  .color-option { width: 24px; height: 24px; }
}

@media (min-width: 640px) {
  .modal-content { border-radius: var(--radius-lg); }
}

.modal-header {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}


.modal-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modal-input, .modal-textarea, .modal-select {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

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

.modal-textarea { min-height: 80px; resize: vertical; }

/* Time inputs row */
.time-inputs-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.time-inputs-row .modal-input { flex: 1; }

.time-separator {
  color: var(--text-muted);
  font-size: 13px;
}

/* Improved time input group */
.time-input-group {
  position: relative;
  flex: 1;
}

.time-text-input {
  width: 100%;
  padding-right: 36px !important;
}

.time-native-input {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.time-input-group::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  pointer-events: none;
}

.modal-tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* Custom tags in modal */
.custom-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 28px;
}

.custom-tag-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.custom-tag-chip .remove-tag {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  margin-left: 2px;
}

.custom-tag-chip .remove-tag:hover {
  color: #dc2626;
}

.custom-tag-input-row {
  display: flex;
  gap: 6px;
}

.custom-tag-input {
  flex: 1;
}

.custom-tag-add-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

.custom-tag-add-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.modal-tag {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.1s;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.modal-tag:hover { background: var(--bg-hover); }
.modal-tag.selected { border-color: var(--accent); color: var(--accent); background: rgba(37, 99, 235, 0.1); }

.modal-tag svg { width: 14px; height: 14px; }

/* Color picker */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-option {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s;
}

.color-option:hover { transform: scale(1.1); }
.color-option.selected { border-color: var(--text-primary); }

.color-option.grey { background: #6b7280; }
.color-option.rose { background: #f43f5e; }
.color-option.purple { background: #8b5cf6; }
.color-option.amber { background: #f59e0b; }
.color-option.sky { background: #0ea5e9; }
.color-option.emerald { background: #10b981; }

.modal-buttons { display: flex; gap: 8px; margin-top: 20px; }

.modal-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.1s;
}

.modal-btn-save { background: var(--text-primary); color: var(--bg-secondary); }
.modal-btn-save:hover { opacity: 0.9; }

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

.modal-btn-delete { 
  background: var(--bg-tertiary); 
  color: #dc2626; 
  border: 1px solid rgba(220, 38, 38, 0.3);
  flex: 0;
  padding: 12px 16px;
}
.modal-btn-delete:hover { 
  background: rgba(220, 38, 38, 0.1);
  border-color: #dc2626;
}

/* Board section */
.board-section {
  padding: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

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

.board-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.board-column {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 200px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.board-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.board-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.board-col-dot.notstarted { background: #9ca3af; }
.board-col-dot.started { background: #3b82f6; }
.board-col-dot.progress { background: #f59e0b; }
.board-col-dot.completed { background: #22c55e; }

.board-col-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.board-col-count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
}

.board-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 60px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 6px;
}

.board-list::-webkit-scrollbar { width: 4px; }
.board-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.board-list.drag-over { background: rgba(37, 99, 235, 0.05); border-radius: var(--radius-sm); }

.board-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: grab;
  transition: all 0.1s;
}

.board-card:hover { background: var(--bg-hover); }
.board-card.dragging { opacity: 0.4; }

.board-card-header {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}

.board-card-priority {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.board-card-priority.priority-high svg { fill: #f43f5e; }
.board-card-priority.priority-medium svg { fill: #f59e0b; }
.board-card-priority.priority-low svg { fill: #3b82f6; }

.board-card-text {
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
}

.board-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Dividers */
.section-divider, .board-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px auto;
  max-width: 800px;
}

/* Libraries */
.tools-library, .library {
  padding: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.library-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.library-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.library-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.library-search {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 13px;
  min-width: 160px;
}

.library-edit-btn,
.library-add-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.library-edit-btn:hover,
.library-add-btn:hover { background: var(--bg-hover); }

.library-edit-btn.active {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border-color: #dc2626;
}

.library-edit-btn svg,
.library-add-btn svg { width: 14px; height: 14px; }

/* Link card delete button */
.link-delete-btn {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc2626;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 10px;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.app-card {
  position: relative;
}

.library-grid.library-edit-mode .link-delete-btn {
  display: flex;
}

.library-grid, .tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.app-card, .tool-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.1s;
  border: 1px solid var(--border);
}

.app-card:hover, .tool-card:hover { background: var(--bg-hover); }

.app-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.app-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.app-name, .tool-name { font-size: 13px; color: var(--text-primary); }
.app-card a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; width: 100%; }

/* Tool modals */
.tool-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tool-modal.active { display: flex; }

.tool-modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.tool-modal-title { font-size: 14px; font-weight: 600; }

.tool-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.tool-modal-close:hover { background: var(--bg-hover); }

.tool-modal-body { flex: 1; overflow-y: auto; padding: 16px; }

/* Notes editor - styled like Simple Notes App */
.notes-modal-content {
  max-width: 600px;
  max-height: 80vh;
}

.notes-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: none;
}

.notes-title-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  text-align: left;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.notes-title-input:focus {
  background: var(--bg-tertiary);
}

.notes-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

.notes-toolbar-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

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

.notes-toolbar-btn.active {
  background: var(--bg-hover);
  color: var(--accent);
}

.notes-toolbar-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notes-toolbar-spacer {
  flex: 1;
}

.notes-char-count {
  color: var(--text-muted);
  font-size: 11px;
}

.notes-editor-container {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.notes-editor-content {
  min-height: 300px;
  outline: none;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  caret-color: var(--text-primary);
}

.notes-editor-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.notes-editor-content h1,
.notes-editor-content h2,
.notes-editor-content h3 {
  margin: 16px 0 8px;
  font-weight: 600;
}

.notes-editor-content h1 { font-size: 24px; }
.notes-editor-content h2 { font-size: 20px; }
.notes-editor-content h3 { font-size: 16px; }

.notes-editor-content p {
  margin: 8px 0;
}

.notes-editor-content code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 13px;
}

.notes-editor-content ul,
.notes-editor-content ol {
  padding-left: 24px;
  margin: 8px 0;
}

.notes-editor-content li {
  margin: 4px 0;
}

/* Calculator */
.calculator { display: flex; flex-direction: column; gap: 12px; }

.calc-display {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: right;
  font-size: 24px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  min-height: 60px;
}

.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.calc-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 14px;
  font-size: 16px;
  cursor: pointer;
}

.calc-btn:hover { background: var(--bg-hover); }
.calc-btn.operator { background: #2563eb; color: white; border-color: #2563eb; }
.calc-btn.clear { background: #dc2626; color: white; border-color: #dc2626; }
.calc-btn.equals { background: #16a34a; color: white; border-color: #16a34a; }

/* Emoji picker */
.emoji-picker { display: flex; flex-direction: column; gap: 12px; }

.emoji-search {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13px;
  outline: none;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
}

.emoji-btn {
  background: transparent;
  border: none;
  font-size: 22px;
  padding: 8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.emoji-btn:hover { background: var(--bg-hover); }

.emoji-copied { text-align: center; color: #16a34a; font-size: 12px; padding: 8px; }

/* Tag menu */
.tag-menu {
  position: absolute;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 4px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 2000;
  min-width: 120px;
}

.tag-menu button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}

.tag-menu button:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Responsive */
@media (max-width: 900px) {
  .board-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .board-grid { grid-template-columns: 1fr; }
  .filter-bar { width: 100%; order: 3; margin-left: 0; }
  .filter-label { display: none; }
  .clear-week-btn { order: 2; }
  .controls-row { gap: 6px; }
  .emoji-grid { grid-template-columns: repeat(6, 1fr); }
  .add-task-fab { bottom: 16px; right: 16px; width: 48px; height: 48px; }
}

/* Hide desktop elements on mobile and vice versa */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
}

@media (min-width: 769px) {
  .mobile-only { display: none !important; }
}

/* Desktop Views */
.desktop-views {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.view { display: none; }
.view.active { display: block; }

/* Weekly Grid */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.day-box {
  background: var(--bg-secondary);
  padding: 10px;
  min-height: 280px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.day-box .day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.day-box .day-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.day-box .day-date-num {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
}

.day-box.is-today .day-date-num {
  color: var(--accent);
}

.day-box .todo-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  padding-right: 4px;
}

.day-box .todo-list::-webkit-scrollbar { width: 3px; }
.day-box .todo-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.day-box .task-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  border-left: 3px solid var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  position: relative;
}

.day-box .task-item .task-checkbox {
  width: 14px;
  height: 14px;
  border: 2px solid var(--text-muted);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.1s;
}

.day-box .task-item .task-checkbox:hover {
  border-color: var(--accent);
}

.day-box .task-item .task-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.day-box .task-item .task-checkbox.checked::after {
  content: "✓";
  color: white;
  font-size: 9px;
  font-weight: bold;
}

.day-box .task-item .task-content {
  flex: 1;
  min-width: 0;
}

.day-box .task-item:hover { background: var(--bg-hover); }
.day-box .task-item.color-grey { border-left-color: #6b7280; }
.day-box .task-item.color-rose { border-left-color: #f43f5e; }
.day-box .task-item.color-purple { border-left-color: #8b5cf6; }
.day-box .task-item.color-amber { border-left-color: #f59e0b; }
.day-box .task-item.color-sky { border-left-color: #0ea5e9; }
.day-box .task-item.color-emerald { border-left-color: #10b981; }

.day-box .task-item .task-name {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.day-box .task-item .task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.day-box .task-item .task-time {
  font-size: 10px;
  color: var(--text-muted);
}

.day-box .task-item .mini-tag {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.day-box .task-item .mini-tag.priority-none { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.day-box .task-item .mini-tag.priority-high { background: rgba(244, 63, 94, 0.2); color: #fda4af; }
.day-box .task-item .mini-tag.priority-medium { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.day-box .task-item .mini-tag.priority-low { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.day-box .task-item .mini-tag.status { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }
.day-box .task-item .mini-tag.status-started { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.day-box .task-item .mini-tag.status-notstarted { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.day-box .task-item .mini-tag.status-progress { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.day-box .task-item .mini-tag.status-completed { background: rgba(34, 197, 94, 0.2); color: #86efac; }

.day-box .task-item .mini-tag svg { width: 8px; height: 8px; }
.day-box .task-item.dragging { opacity: 0.5; }
.day-box.drag-over { background: rgba(59, 130, 246, 0.1); }

/* Completed task in weekly view */
.day-box .task-item.completed {
  opacity: 0.6;
}

.day-box .task-item.completed .task-name {
  text-decoration: line-through;
}

/* Monthly task styling with colors */
.month-day .month-task {
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 2px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border-left: 2px solid var(--text-muted);
}

.month-day .month-task.color-grey { border-left-color: #6b7280; }
.month-day .month-task.color-rose { border-left-color: #f43f5e; }
.month-day .month-task.color-purple { border-left-color: #8b5cf6; }
.month-day .month-task.color-amber { border-left-color: #f59e0b; }
.month-day .month-task.color-sky { border-left-color: #0ea5e9; }
.month-day .month-task.color-emerald { border-left-color: #10b981; }

.month-day .month-task:hover { background: var(--bg-hover); }
.month-day .month-task.dragging { opacity: 0.5; }
.month-day.drag-over { background: rgba(59, 130, 246, 0.15); }

/* Completed tasks in monthly view */
.month-day .month-task.completed {
  opacity: 0.6;
  text-decoration: line-through;
}

.month-task-check {
  color: #22c55e;
  font-size: 8px;
  margin-right: 2px;
}

/* Inline add button in toolbar - styled like filter dropdown */
.add-btn-inline {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.1s;
}

.add-btn-inline:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.add-btn-inline svg { width: 12px; height: 12px; }

/* Edit mode for quick delete */
.edit-mode-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.edit-mode-btn:hover { background: var(--bg-hover); }
.edit-mode-btn.active { background: rgba(220, 38, 38, 0.1); color: #dc2626; border-color: #dc2626; }

.task-delete-btn {
  display: none;
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #dc2626;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

body.edit-mode .task-delete-btn { display: flex; }
body.edit-mode .schedule-task,
body.edit-mode .task-item,
body.edit-mode .month-task { position: relative; }

/* Tag popup menu */
.tag-popup {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  padding: 4px;
  z-index: 2000;
  min-width: 100px;
}

.tag-popup button {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 10px;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.tag-popup button:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Search highlight */
.search-highlight {
  box-shadow: 0 0 0 2px #3b82f6, 0 0 8px rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.1) !important;
}

.schedule-task.search-highlight,
.task-item.search-highlight,
.board-card.search-highlight {
  animation: highlight-pulse 1.5s ease-in-out infinite;
}

@keyframes highlight-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #3b82f6, 0 0 8px rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 0 0 2px #3b82f6, 0 0 16px rgba(59, 130, 246, 0.6); }
}

/* Monthly Calendar */
.month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.month-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-nav button {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
}

.month-nav button:hover { background: var(--bg-hover); }

.month-picker {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color-scheme: dark;
}

.month-wrapper {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.month-weekday {
  padding: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
}

.month-day {
  background: var(--bg-secondary);
  min-height: 80px;
  padding: 6px;
}

.month-day.is-today {
  background: rgba(59, 130, 246, 0.1);
}

.month-day .month-day-num {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.month-day.is-today .month-day-num {
  color: var(--accent);
  font-weight: 600;
}

.month-day .month-day-tasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}


.month-empty {
  background: var(--bg-primary);
  min-height: 80px;
}

/* Month more tasks indicator - clickable */
.month-more-tasks {
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 2px;
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.month-more-tasks:hover {
  background: var(--accent);
  color: white;
}

/* Day Tasks Modal */
.day-tasks-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.day-tasks-modal.active {
  display: flex;
}

.day-tasks-modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

.day-tasks-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.day-tasks-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

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

.day-tasks-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.day-tasks-modal-body .day-task-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  border-left: 3px solid var(--text-muted);
  transition: background 0.15s;
}

.day-tasks-modal-body .day-task-item:hover {
  background: var(--bg-hover);
}

.day-tasks-modal-body .day-task-item.color-grey { border-left-color: #6b7280; }
.day-tasks-modal-body .day-task-item.color-rose { border-left-color: #f43f5e; }
.day-tasks-modal-body .day-task-item.color-purple { border-left-color: #8b5cf6; }
.day-tasks-modal-body .day-task-item.color-amber { border-left-color: #f59e0b; }
.day-tasks-modal-body .day-task-item.color-sky { border-left-color: #0ea5e9; }
.day-tasks-modal-body .day-task-item.color-emerald { border-left-color: #10b981; }

.day-tasks-modal-body .day-task-item.completed {
  opacity: 0.6;
}

.day-tasks-modal-body .day-task-item.completed .day-task-name {
  text-decoration: line-through;
}

.day-task-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.day-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11px;
}

.day-task-time {
  color: var(--text-muted);
}

@media (max-width: 1024px) {
  .week-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  .week-grid { grid-template-columns: repeat(2, 1fr); }
  .day-box { min-height: 200px; }
}