/* ===== Design Tokens ===== */
:root {
  /* Colors */
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1c2a4a;
  --surface-glass: rgba(255, 255, 255, 0.04);
  --surface-glass-hover: rgba(255, 255, 255, 0.07);

  --text-primary: #e8e8f0;
  --text-secondary: #9a9ab0;
  --text-muted: #5a5a70;

  --accent-primary: #6c63ff;
  --accent-primary-hover: #7c74ff;
  --accent-danger: #ff4757;
  --accent-danger-hover: #ff6b81;
  --accent-backlog: #ff9f43;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);

  /* Fusen Colors */
  --fusen-yellow: #FFF9C4;
  --fusen-yellow-text: #5D4037;
  --fusen-yellow-accent: #F9A825;
  --fusen-pink: #FCE4EC;
  --fusen-pink-text: #880E4F;
  --fusen-pink-accent: #E91E63;
  --fusen-blue: #E3F2FD;
  --fusen-blue-text: #0D47A1;
  --fusen-blue-accent: #1976D2;
  --fusen-green: #E8F5E9;
  --fusen-green-text: #1B5E20;
  --fusen-green-accent: #388E3C;
  --fusen-purple: #F3E5F5;
  --fusen-purple-text: #4A148C;
  --fusen-purple-accent: #7B1FA2;
  --fusen-orange: #FFF3E0;
  --fusen-orange-text: #BF360C;
  --fusen-orange-accent: #E65100;

  /* Typography */
  --font-primary: 'Zen Maru Gothic', 'Inter', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Sizes */
  --backlog-width: 260px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-fusen: 2px 3px 8px rgba(0, 0, 0, 0.15);
  --shadow-fusen-hover: 4px 6px 16px rgba(0, 0, 0, 0.25);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  height: 100%;
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

textarea, input {
  font-family: inherit;
}

/* ===== App Layout ===== */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(108, 99, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(255, 71, 87, 0.05) 0%, transparent 50%),
    var(--bg-primary);
}

/* ===== Content Area (calendar + backlog) ===== */
.content-area {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

.calendar-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* ===== Header ===== */
#app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.header-left {
  flex: 1;
}

#app-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.title-icon {
  font-size: 1.4rem;
}

.header-center {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 2;
  justify-content: center;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.nav-btn:hover {
  background: var(--surface-glass-hover);
  color: var(--text-primary);
  transform: scale(1.05);
}

.nav-btn:active {
  transform: scale(0.95);
}

.today-btn {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  border: 1px solid rgba(108, 99, 255, 0.3);
  transition: all var(--transition-fast);
}

.today-btn:hover {
  background: rgba(108, 99, 255, 0.1);
  border-color: var(--accent-primary);
}

.period-label {
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 200px;
  text-align: center;
  letter-spacing: -0.01em;
}

.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

/* ===== View Switcher ===== */
.view-switcher {
  display: flex;
  background: var(--surface-glass);
  border-radius: var(--radius-md);
  padding: 3px;
  border: 1px solid var(--border-subtle);
}

.view-btn {
  padding: var(--space-xs) var(--space-md);
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.view-btn:hover {
  color: var(--text-primary);
}

.view-btn.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

/* ===== View Container ===== */
.view-container {
  display: none;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.view-container.active {
  display: flex;
  flex-direction: column;
  animation: viewFadeIn 300ms var(--ease-out);
}

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

/* ===== Weekly View ===== */
.weekly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  flex: 1;
  background: var(--border-subtle);
  min-height: 0;
}

.day-column {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  min-height: 0;
  overflow: hidden;
}

.day-column.is-today {
  background: rgba(108, 99, 255, 0.03);
}

.day-header {
  padding: var(--space-md);
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  flex-shrink: 0;
}

.day-header .day-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

.day-header .day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 600;
}

.day-column.is-today .day-number {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 12px rgba(108, 99, 255, 0.4);
}

.day-column.is-saturday .day-name,
.day-column.is-saturday .day-number {
  color: #5c9ce6;
}

.day-column.is-sunday .day-name,
.day-column.is-sunday .day-number {
  color: #e65c5c;
}

.day-column.is-today.is-saturday .day-number,
.day-column.is-today.is-sunday .day-number {
  color: white;
}

.day-body {
  flex: 1;
  padding: var(--space-sm);
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-height: 0;
}

/* Scrollbar styling */
.day-body::-webkit-scrollbar {
  width: 4px;
}
.day-body::-webkit-scrollbar-track {
  background: transparent;
}
.day-body::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 2px;
}

/* ===== Add Task Button ===== */
.add-fusen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  width: 100%;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-medium);
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.add-fusen-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(108, 99, 255, 0.05);
}

.add-fusen-btn svg {
  width: 14px;
  height: 14px;
}

/* ===== Fusen (Sticky Note) ===== */
.fusen {
  position: relative;
  padding: var(--space-sm) var(--space-md);
  padding-left: calc(var(--space-md) + 14px);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.5;
  cursor: grab;
  box-shadow: var(--shadow-fusen);
  transition: all var(--transition-normal);
  word-break: break-word;
  white-space: pre-wrap;
  border-left: 4px solid transparent;
  animation: fusenAppear 300ms var(--ease-spring);
  min-height: 40px;
  user-select: none;
  flex-shrink: 0;
}

/* Drag grip handle */
.fusen-grip {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: currentColor;
  opacity: 0.25;
  transition: opacity var(--transition-fast);
  cursor: grab;
  display: flex;
  align-items: center;
}

.fusen:hover .fusen-grip {
  opacity: 0.5;
}

/* Drag states */
.fusen.is-dragging {
  opacity: 0.35;
  transform: scale(0.95);
  box-shadow: none;
}

.fusen:active:not(.is-dragging) {
  cursor: grabbing;
}

/* Drop indicator line */
.drop-indicator {
  height: 3px;
  background: var(--accent-primary);
  border-radius: 2px;
  margin: 2px 0;
  box-shadow: 0 0 8px rgba(108, 99, 255, 0.5);
  animation: dropPulse 800ms ease-in-out infinite alternate;
  flex-shrink: 0;
}

@keyframes dropPulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* Drag-over zone */
.day-body.drag-over,
.backlog-body.drag-over {
  background: rgba(108, 99, 255, 0.04);
  outline: 2px dashed rgba(108, 99, 255, 0.3);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

/* Monthly drag-over */
.month-cell.drag-over {
  outline: 2px dashed rgba(108, 99, 255, 0.4);
  outline-offset: -2px;
  background: rgba(108, 99, 255, 0.08) !important;
}

@keyframes fusenAppear {
  from {
    opacity: 0;
    transform: scale(0.9) rotate(-2deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.fusen:hover {
  box-shadow: var(--shadow-fusen-hover);
  transform: translateY(-2px) rotate(0.5deg);
}

.fusen:active {
  transform: translateY(0) rotate(0deg);
}

/* Fusen Color Variants */
.fusen--yellow {
  background: var(--fusen-yellow);
  color: var(--fusen-yellow-text);
  border-left-color: var(--fusen-yellow-accent);
}
.fusen--pink {
  background: var(--fusen-pink);
  color: var(--fusen-pink-text);
  border-left-color: var(--fusen-pink-accent);
}
.fusen--blue {
  background: var(--fusen-blue);
  color: var(--fusen-blue-text);
  border-left-color: var(--fusen-blue-accent);
}
.fusen--green {
  background: var(--fusen-green);
  color: var(--fusen-green-text);
  border-left-color: var(--fusen-green-accent);
}
.fusen--purple {
  background: var(--fusen-purple);
  color: var(--fusen-purple-text);
  border-left-color: var(--fusen-purple-accent);
}
.fusen--orange {
  background: var(--fusen-orange);
  color: var(--fusen-orange-text);
  border-left-color: var(--fusen-orange-accent);
}

/* Fusen Done state */
.fusen.is-done {
  opacity: 0.55;
  text-decoration: line-through;
}

.fusen .fusen-check {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  background: rgba(255,255,255,0.5);
}

.fusen:hover .fusen-check {
  opacity: 0.7;
}

.fusen.is-done .fusen-check {
  opacity: 1;
  background: currentColor;
}

.fusen.is-done .fusen-check svg {
  color: white;
}

/* ===== Monthly View ===== */
.monthly-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.month-day-label {
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.month-day-label.sat { color: #5c9ce6; }
.month-day-label.sun { color: #e65c5c; }

.monthly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 1px;
  flex: 1;
  background: var(--border-subtle);
  min-height: 0;
}

.month-cell {
  background: var(--bg-primary);
  padding: var(--space-xs);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.month-cell:hover {
  background: var(--surface-glass-hover);
}

.month-cell.is-other-month {
  opacity: 0.3;
}

.month-cell.is-today {
  background: rgba(108, 99, 255, 0.06);
}

.month-cell .cell-date {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.month-cell.is-today .cell-date {
  background: var(--accent-primary);
  color: white;
  border-radius: var(--radius-sm);
  display: inline-block;
  width: fit-content;
}

.month-cell.is-saturday .cell-date { color: #5c9ce6; }
.month-cell.is-sunday .cell-date { color: #e65c5c; }
.month-cell.is-today.is-saturday .cell-date,
.month-cell.is-today.is-sunday .cell-date { color: white; }

.month-cell .cell-fusens {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.month-cell .cell-fusens::-webkit-scrollbar {
  width: 2px;
}
.month-cell .cell-fusens::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 1px;
}

.month-fusen {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: grab;
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
  user-select: none;
  flex-shrink: 0;
}

.month-fusen:hover {
  transform: translateX(2px);
}

.month-fusen.is-done {
  opacity: 0.45;
  text-decoration: line-through;
}

.month-fusen.is-dragging {
  opacity: 0.3;
}

/* Month Fusen Colors */
.month-fusen--yellow { background: var(--fusen-yellow); color: var(--fusen-yellow-text); border-left-color: var(--fusen-yellow-accent); }
.month-fusen--pink { background: var(--fusen-pink); color: var(--fusen-pink-text); border-left-color: var(--fusen-pink-accent); }
.month-fusen--blue { background: var(--fusen-blue); color: var(--fusen-blue-text); border-left-color: var(--fusen-blue-accent); }
.month-fusen--green { background: var(--fusen-green); color: var(--fusen-green-text); border-left-color: var(--fusen-green-accent); }
.month-fusen--purple { background: var(--fusen-purple); color: var(--fusen-purple-text); border-left-color: var(--fusen-purple-accent); }
.month-fusen--orange { background: var(--fusen-orange); color: var(--fusen-orange-text); border-left-color: var(--fusen-orange-accent); }

/* Month cell drop indicator */
.month-cell .drop-indicator-month {
  height: 2px;
  background: var(--accent-primary);
  border-radius: 1px;
  margin: 1px 0;
  box-shadow: 0 0 6px rgba(108, 99, 255, 0.5);
  flex-shrink: 0;
}

.month-cell .add-month-btn {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 3px;
  text-align: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.month-cell:hover .add-month-btn {
  opacity: 1;
}

.month-cell .add-month-btn:hover {
  background: rgba(108, 99, 255, 0.1);
  color: var(--accent-primary);
}

/* ===== Backlog Panel ===== */
.backlog-panel {
  width: var(--backlog-width);
  border-left: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition-normal), opacity var(--transition-normal);
  overflow: hidden;
  position: relative;
}

.backlog-panel.collapsed {
  width: 0;
  border-left: none;
  opacity: 0;
  pointer-events: none;
}

.backlog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.backlog-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-backlog);
  white-space: nowrap;
}

.backlog-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.backlog-add-btn:hover {
  background: rgba(255, 159, 67, 0.1);
  color: var(--accent-backlog);
}

.backlog-body {
  flex: 1;
  padding: var(--space-sm);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-height: 60px;
}

.backlog-body::-webkit-scrollbar {
  width: 4px;
}
.backlog-body::-webkit-scrollbar-track {
  background: transparent;
}
.backlog-body::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 2px;
}

.backlog-hint {
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  opacity: 0.6;
}

.backlog-body .backlog-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  gap: var(--space-sm);
  opacity: 0.5;
}

.backlog-body .backlog-empty-icon {
  font-size: 1.8rem;
}

/* Backlog toggle button */
.backlog-toggle-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 64px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all var(--transition-fast);
  z-index: 5;
  cursor: pointer;
}

.backlog-panel:not(.collapsed) ~ .backlog-toggle-btn {
  right: var(--backlog-width);
}

.backlog-toggle-btn:hover {
  background: var(--bg-card);
  color: var(--accent-backlog);
}

.backlog-count {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--accent-backlog);
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.backlog-count.is-empty {
  background: var(--text-muted);
  opacity: 0.5;
}

/* ===== Dialog ===== */
dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 440px;
  width: 90vw;
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-subtle);
  overflow: visible;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

dialog[open] {
  animation: dialogIn 300ms var(--ease-spring);
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dialog-content {
  padding: var(--space-lg);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.dialog-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.dialog-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.dialog-close-btn:hover {
  background: var(--surface-glass-hover);
  color: var(--text-primary);
}

/* ===== Form ===== */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-group textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--surface-glass);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color var(--transition-fast);
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.form-group textarea::placeholder {
  color: var(--text-muted);
}

/* ===== Color Picker ===== */
.color-picker {
  display: flex;
  gap: var(--space-sm);
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--swatch-color);
  border: 3px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  border-color: var(--swatch-border);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
  transform: scale(1.1);
}

/* ===== Buttons ===== */
.btn {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.btn-secondary {
  background: var(--surface-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

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

.btn-danger {
  background: var(--accent-danger);
  color: white;
}

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

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-lg);
}

.form-actions-right {
  display: flex;
  gap: var(--space-sm);
}

.form-actions.centered {
  justify-content: center;
  gap: var(--space-sm);
}

.hidden {
  display: none !important;
}

/* ===== Delete Dialog ===== */
.delete-confirm {
  text-align: center;
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
}

.delete-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.delete-confirm p {
  font-size: 1rem;
  margin-bottom: var(--space-lg);
  color: var(--text-secondary);
}

/* ===== Empty State ===== */
.day-body-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0.5;
  padding: var(--space-md);
  flex: 1;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  #app-header {
    flex-wrap: wrap;
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
  }

  .header-left {
    order: 1;
  }

  .header-right {
    order: 2;
  }

  .header-center {
    order: 3;
    flex: 1 0 100%;
  }

  .period-label {
    font-size: 0.95rem;
    min-width: auto;
  }

  #app-title {
    font-size: 1rem;
  }

  .weekly-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .day-column {
    min-height: 120px;
  }

  .day-header {
    padding: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
  }

  .day-header .day-name {
    margin-bottom: 0;
  }

  .day-header .day-number {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .backlog-panel {
    width: 200px;
  }

  :root {
    --backlog-width: 200px;
  }
}
