/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ═══════════════════════════════════════════
   DESIGN TOKENS — DARK (default)
═══════════════════════════════════════════ */
:root {
  --accent:       #8B5CF6;
  --accent-light: #A78BFA;
  --accent-dim:   rgba(139,92,246,0.12);
  --accent-glow:  rgba(139,92,246,0.35);

  --done:         #10B981;
  --done-dim:     rgba(16,185,129,0.12);
  --skip:         #F43F5E;
  --skip-dim:     rgba(244,63,94,0.12);
  --push:         #F59E0B;
  --push-dim:     rgba(245,158,11,0.12);

  --pri-high:     #EF4444;
  --pri-medium:   #F59E0B;
  --pri-low:      #3B82F6;

  --bg:           #0B0B14;
  --surface:      #131326;
  --surface2:     #1C1C35;
  --card:         #181830;
  --card-hover:   #20203C;
  --border:       rgba(255,255,255,0.06);
  --border-hi:    rgba(255,255,255,0.12);
  --text:         #E4E4F0;
  --text2:        #9494BB;
  --text3:        #5C5C8A;
  --shadow:       0 4px 20px rgba(0,0,0,0.45);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.65);
  --today-bg:     rgba(139,92,246,0.07);
  --today-bdr:    rgba(139,92,246,0.35);

  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --font: 'Inter', system-ui, sans-serif;
  --t:    180ms ease;
  --t-md: 300ms ease;

  --sidebar-w: 218px;
  --header-h:  52px;
}

/* ═══════════════════════════════════════════
   LIGHT THEME
═══════════════════════════════════════════ */
[data-theme="light"] {
  --bg:        #F4F4F8;
  --surface:   #FFFFFF;
  --surface2:  #EEEFF6;
  --card:      #FFFFFF;
  --card-hover:#F3EEFF;
  --border:    rgba(0,0,0,0.07);
  --border-hi: rgba(0,0,0,0.13);
  --text:      #18182A;
  --text2:     #50508A;
  --text3:     #8888AA;
  --shadow:    0 4px 20px rgba(0,0,0,0.09);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);
  --today-bg:  rgba(139,92,246,0.05);
  --today-bdr: rgba(139,92,246,0.3);
}

/* ═══════════════════════════════════════════
   BASE
═══════════════════════════════════════════ */
html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t-md), color var(--t-md);
}

button { cursor: pointer; }
input, textarea { font-family: var(--font); }

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
.app-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left  { display: flex; align-items: center; gap: 8px; min-width: 0; flex-shrink: 0; }
.header-center{ flex: 1; display: flex; justify-content: center; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Logo */
.app-logo { display: flex; align-items: center; gap: 7px; user-select: none; }
.logo-text { font-weight: 700; font-size: 15px; letter-spacing: -0.3px; white-space: nowrap; }

/* View tabs */
.view-tabs {
  display: flex;
  background: var(--surface2);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.view-tab {
  background: none;
  border: none;
  color: var(--text2);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: 7px;
  transition: all var(--t);
}
.view-tab:hover  { color: var(--text); }
.view-tab.active { background: var(--accent); color: #fff; }

/* Period nav */
.period-nav { display: flex; align-items: center; gap: 2px; }
.period-label {
  background: none; border: none;
  color: var(--text); font-family: var(--font);
  font-size: 13px; font-weight: 600;
  padding: 4px 8px; border-radius: var(--r-sm);
  transition: background var(--t); cursor: pointer;
}
.period-label:hover { background: var(--surface2); }

/* Buttons */
.btn-icon {
  width: 30px; height: 30px;
  background: none; border: none;
  border-radius: var(--r-sm);
  color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.btn-icon:hover { background: var(--surface2); color: var(--text); }

.btn-nav { width: 26px; height: 26px; }

.btn-today {
  background: none;
  border: 1px solid var(--border-hi);
  border-radius: var(--r-sm);
  color: var(--text2); font-family: var(--font);
  font-size: 12px; font-weight: 500;
  padding: 3px 10px;
  transition: all var(--t);
}
.btn-today:hover { color: var(--accent); border-color: var(--accent); }

.btn-add-task {
  background: var(--accent);
  border: none;
  border-radius: var(--r-sm);
  color: #fff; font-family: var(--font);
  font-size: 12px; font-weight: 600;
  padding: 6px 14px;
  display: flex; align-items: center; gap: 6px;
  transition: all var(--t);
  white-space: nowrap;
}
.btn-add-task:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-add-task:active { transform: translateY(0); }

/* Theme toggle icons */
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; pointer-events: none; }
[data-theme="dark"]  .theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Settings dropdown */
.settings-wrapper { position: relative; }
.settings-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  padding: 6px; min-width: 158px;
  box-shadow: var(--shadow);
  display: none; z-index: 200;
}
.settings-menu.open { display: block; animation: popIn 140ms ease; }

.settings-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; background: none; border: none;
  border-radius: var(--r-sm);
  color: var(--text); font-family: var(--font);
  font-size: 12px; padding: 7px 10px;
  transition: background var(--t);
}
.settings-item:hover { background: var(--surface2); }
.settings-item.settings-danger { color: var(--skip); }
.settings-item.settings-danger:hover { background: var(--skip-dim); }
.settings-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
.app-main {
  display: flex;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.today-sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden; flex-shrink: 0;
  transition: width var(--t-md);
}
.today-sidebar.collapsed { width: 0; }

.sidebar-header {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-eyebrow {
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.12em; color: var(--accent); text-transform: uppercase;
}
.sidebar-date-info { display: flex; align-items: baseline; gap: 6px; }
.sidebar-dayname  { font-size: 17px; font-weight: 700; }
.sidebar-datestr  { font-size: 13px; font-weight: 500; color: var(--text2); }

/* Ring */
.sidebar-ring-wrap {
  position: relative; width: 58px; height: 58px;
  margin: 10px auto 2px;
}
.ring-svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface2); stroke-width: 5; }
.ring-fill  {
  fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 138.2; stroke-dashoffset: 138.2;
  transition: stroke-dashoffset 600ms cubic-bezier(.4,0,.2,1), stroke 400ms ease;
}
.ring-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}

/* Sidebar sections */
.sidebar-section-label {
  display: flex; align-items: center; gap: 5px;
  padding: 9px 14px 4px;
  font-size: 10px; font-weight: 600;
  color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em;
}
.sidebar-tasks {
  overflow-y: auto;
  padding: 2px 8px;
  max-height: 180px;
}
#overdueList { max-height: 110px; }
.sidebar-empty {
  color: var(--text3); font-size: 12px;
  text-align: center; padding: 16px 0;
}

/* Sidebar task row */
.sidebar-task {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 6px 8px; border-radius: var(--r-sm);
  cursor: pointer; transition: background var(--t);
}
.sidebar-task:hover { background: var(--surface2); }

.st-check {
  width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px;
  border: 1.5px solid var(--border-hi); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.sidebar-task.st-done .st-check { background: var(--done); border-color: var(--done); }
.st-check svg { display: none; }
.sidebar-task.st-done .st-check svg { display: block; }

.st-title { font-size: 12px; font-weight: 500; flex: 1; line-height: 1.4; }
.sidebar-task.st-done     .st-title { text-decoration: line-through; color: var(--text3); }
.sidebar-task.st-skipped  .st-title { text-decoration: line-through; color: var(--text3); opacity: .6; }
.sidebar-task.overdue-item .st-title { color: var(--skip); }
.sidebar-task.overdue-item .st-check { border-color: var(--skip-dim); }
.st-time { font-size: 10px; color: var(--text3); flex-shrink: 0; margin-top: 2px; }

.sidebar-add-btn {
  display: flex; align-items: center; gap: 7px;
  margin: 8px; padding: 8px 10px;
  background: none;
  border: 1px dashed var(--border-hi);
  border-radius: var(--r-sm);
  color: var(--text3); font-family: var(--font); font-size: 12px;
  transition: all var(--t);
  width: calc(100% - 16px);
}
.sidebar-add-btn:hover {
  border-color: var(--accent); color: var(--accent); background: var(--accent-dim);
}

/* ═══════════════════════════════════════════
   CALENDAR AREA
═══════════════════════════════════════════ */
.calendar-area { flex: 1; overflow: auto; min-width: 0; }

/* ═══════════════════════════════════════════
   WEEK VIEW
═══════════════════════════════════════════ */
.week-view { display: flex; flex-direction: column; min-height: 100%; }

.week-header {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.week-header-day {
  padding: 10px 10px 9px; text-align: center;
  border-right: 1px solid var(--border);
  cursor: pointer; transition: background var(--t);
  user-select: none;
}
.week-header-day:last-child { border-right: none; }
.week-header-day:hover { background: var(--surface); }
.week-header-day.today {
  background: var(--today-bg);
  border-bottom: 2px solid var(--accent);
}
.whd-name {
  font-size: 10px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .06em;
}
.whd-date {
  font-size: 19px; font-weight: 700; line-height: 1.1; margin-top: 2px;
}
.week-header-day.today .whd-date { color: var(--accent); }
.whd-count { font-size: 10px; color: var(--text3); margin-top: 3px; min-height: 14px; }

.week-body {
  display: grid; grid-template-columns: repeat(7, 1fr); flex: 1;
  min-height: calc(100vh - var(--header-h) - 84px);
}
.week-col {
  border-right: 1px solid var(--border);
  padding: 10px 7px;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-h) - 84px);
  transition: background var(--t);
}
.week-col:last-child { border-right: none; }
.week-col.today-col  { background: var(--today-bg); }
.week-col.drag-over  { background: var(--accent-dim) !important; outline: 1px dashed var(--accent); outline-offset: -2px; }

.day-tasks { display: flex; flex-direction: column; gap: 5px; min-height: 30px; }

.day-add-btn {
  margin-top: 8px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px; background: none;
  border: 1px dashed transparent; border-radius: var(--r-sm);
  color: var(--text3); font-family: var(--font); font-size: 11px;
  transition: all var(--t); opacity: 0;
}
.week-col:hover .day-add-btn { opacity: 1; border-color: var(--border-hi); }
.day-add-btn:hover { border-color: var(--accent) !important; color: var(--accent); background: var(--accent-dim); }

/* ═══════════════════════════════════════════
   TASK CARD (week / generic)
═══════════════════════════════════════════ */
.task-card {
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--pri-medium);
  border-radius: var(--r-sm);
  padding: 7px 8px 7px 9px;
  cursor: pointer; position: relative; user-select: none;
  display: flex; flex-direction: column; gap: 3px;
  transition: all var(--t);
}
.task-card[data-priority="high"]   { border-left-color: var(--pri-high); }
.task-card[data-priority="medium"] { border-left-color: var(--pri-medium); }
.task-card[data-priority="low"]    { border-left-color: var(--pri-low); }

.task-card:hover {
  background: var(--card-hover); border-color: var(--border-hi);
  transform: translateY(-1px); box-shadow: var(--shadow);
}
.task-card:active { transform: translateY(0); }
.task-card.dragging { opacity: .45; transform: scale(.95); }

.tc-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; }
.tc-title { font-size: 12px; font-weight: 500; color: var(--text); flex: 1; line-height: 1.4; word-break: break-word; }
.task-card.status-done    .tc-title { text-decoration: line-through; color: var(--text3); }
.task-card.status-skipped .tc-title { text-decoration: line-through; color: var(--text3); opacity: .6; }

.tc-quick-done {
  width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px;
  border: 1.5px solid var(--border-hi); border-radius: 50%;
  background: none;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.tc-quick-done:hover { border-color: var(--done); background: var(--done-dim); }
.task-card.status-done .tc-quick-done { background: var(--done); border-color: var(--done); }

.tc-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tc-time  { font-size: 10px; color: var(--text3); font-weight: 500; }
.tc-tag   {
  font-size: 9px; font-weight: 600; color: var(--accent);
  background: var(--accent-dim); padding: 1px 5px;
  border-radius: 4px; text-transform: uppercase; letter-spacing: .04em;
}
.tc-pushed-badge {
  font-size: 9px; font-weight: 600; color: var(--push);
  background: var(--push-dim); padding: 1px 5px; border-radius: 4px;
}

/* ═══════════════════════════════════════════
   MONTH VIEW
═══════════════════════════════════════════ */
.month-view { display: flex; flex-direction: column; }

.month-header {
  display: grid; grid-template-columns: repeat(7,1fr);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.mh-cell {
  padding: 8px 10px; text-align: center;
  font-size: 10px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .06em;
}
.month-grid { display: grid; grid-template-columns: repeat(7,1fr); }

.month-cell {
  min-height: 96px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 7px 6px; cursor: pointer; overflow: hidden;
  transition: background var(--t);
}
.month-cell:nth-child(7n) { border-right: none; }
.month-cell:hover { background: var(--surface); }
.month-cell.today-cell { background: var(--today-bg); }
.month-cell.other-month .mc-date { opacity: .3; }

.mc-date {
  font-size: 13px; font-weight: 600;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; margin-bottom: 4px;
}
.month-cell.today-cell .mc-date { background: var(--accent); color: #fff; }
.mc-tasks { display: flex; flex-direction: column; gap: 2px; }

.mc-task-pill {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: var(--accent-dim); color: var(--text);
  font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; transition: background var(--t);
}
.mc-task-pill:hover { background: var(--accent); color: #fff; }
.mc-task-pill.pill-done    { background: var(--done-dim); color: var(--text3); text-decoration: line-through; }
.mc-task-pill.pill-skipped { background: var(--skip-dim); color: var(--text3); opacity: .6; text-decoration: line-through; }
.mc-more { font-size: 10px; color: var(--accent); font-weight: 600; padding: 2px 0; }

/* ═══════════════════════════════════════════
   DAY VIEW
═══════════════════════════════════════════ */
.day-view { max-width: 660px; margin: 0 auto; padding: 28px 24px; }

.dv-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 28px;
}
.dv-title    { font-size: 28px; font-weight: 800; line-height: 1.1; }
.dv-subtitle { font-size: 13px; color: var(--text2); margin-top: 4px; }

.dv-stats { display: flex; gap: 16px; }
.dv-stat  { text-align: center; }
.dv-stat-num { font-size: 22px; font-weight: 800; line-height: 1; }
.dv-stat-lbl { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

.dv-section-header {
  font-size: 10px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .09em;
  margin-bottom: 8px; margin-top: 22px;
}
.dv-task-list { display: flex; flex-direction: column; gap: 7px; }

.dv-task-card {
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--pri-medium);
  border-radius: var(--r-md); padding: 13px 14px;
  cursor: pointer; display: flex; align-items: flex-start; gap: 12px;
  transition: all var(--t);
}
.dv-task-card[data-priority="high"]   { border-left-color: var(--pri-high); }
.dv-task-card[data-priority="medium"] { border-left-color: var(--pri-medium); }
.dv-task-card[data-priority="low"]    { border-left-color: var(--pri-low); }
.dv-task-card:hover {
  background: var(--card-hover); transform: translateX(2px); box-shadow: var(--shadow);
}
.dv-task-card.status-done .dv-tc-title { text-decoration: line-through; color: var(--text3); }
.dv-task-card.status-skipped .dv-tc-title { text-decoration: line-through; color: var(--text3); opacity: .6; }

.dv-tc-check {
  width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px;
  border: 2px solid var(--border-hi); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t); cursor: pointer;
}
.dv-tc-check:hover { border-color: var(--done); background: var(--done-dim); }
.dv-task-card.status-done .dv-tc-check { background: var(--done); border-color: var(--done); }

.dv-tc-body  { flex: 1; min-width: 0; }
.dv-tc-title { font-size: 14px; font-weight: 600; }
.dv-tc-meta  { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.dv-tc-time  { font-size: 11px; color: var(--text3); }
.dv-tc-notes { font-size: 12px; color: var(--text2); margin-top: 6px; line-height: 1.55; }

.dv-add-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; background: none;
  border: 1px dashed var(--border-hi); border-radius: var(--r-md);
  color: var(--text3); font-family: var(--font); font-size: 13px;
  width: 100%; margin-top: 12px; transition: all var(--t);
}
.dv-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ═══════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════ */
.empty-view {
  display: flex; flex-direction: column; align-items: center;
  padding: 44px 20px; color: var(--text3); text-align: center; gap: 10px;
}
.empty-view svg { opacity: .25; margin-bottom: 4px; }
.empty-view-title { font-size: 14px; font-weight: 600; color: var(--text2); }
.empty-view-sub   { font-size: 12px; }

/* ═══════════════════════════════════════════
   MODAL
═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.58); backdrop-filter: blur(5px);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  padding: 16px; opacity: 0; pointer-events: none;
  transition: opacity var(--t);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.task-modal {
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: var(--r-xl); width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(.97); transition: transform var(--t);
}
.modal-overlay.open .task-modal { transform: translateY(0) scale(1); }

.modal-header { padding: 20px 20px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { font-size: 16px; font-weight: 700; }
.modal-body   { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { padding: 0 20px 20px; display: flex; justify-content: flex-end; gap: 8px; }

.task-main-input {
  width: 100%; background: var(--surface2);
  border: 1px solid var(--border-hi); border-radius: var(--r-sm);
  color: var(--text); font-size: 15px; font-weight: 500;
  padding: 10px 12px; outline: none;
  transition: border-color var(--t);
}
.task-main-input:focus { border-color: var(--accent); }
.task-main-input::placeholder { color: var(--text3); }

.modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.modal-field { display: flex; flex-direction: column; gap: 5px; }
.modal-field label {
  font-size: 11px; font-weight: 600;
  color: var(--text3); text-transform: uppercase; letter-spacing: .06em;
}
.opt { font-weight: 400; text-transform: none; letter-spacing: 0; }

.modal-input {
  width: 100%; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); font-size: 13px;
  padding: 8px 10px; outline: none;
  transition: border-color var(--t);
}
.modal-input:focus { border-color: var(--accent); }
.modal-input::placeholder { color: var(--text3); }
.modal-input::-webkit-calendar-picker-indicator { filter: invert(.5); cursor: pointer; }
[data-theme="light"] .modal-input::-webkit-calendar-picker-indicator { filter: none; }

.modal-textarea { resize: vertical; min-height: 72px; line-height: 1.55; }

.priority-row { display: flex; gap: 6px; }
.pri-btn {
  flex: 1; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text2); font-family: var(--font);
  font-size: 11px; font-weight: 600; padding: 7px;
  transition: all var(--t);
}
.pri-btn:hover { border-color: var(--border-hi); color: var(--text); }
.pri-btn.active[data-p="high"]   { background: var(--skip-dim);  border-color: var(--pri-high);   color: var(--pri-high); }
.pri-btn.active[data-p="medium"] { background: var(--push-dim);  border-color: var(--pri-medium); color: var(--pri-medium); }
.pri-btn.active[data-p="low"]    { background: rgba(59,130,246,.1); border-color: var(--pri-low); color: var(--pri-low); }

.btn-ghost {
  background: none; border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text2);
  font-family: var(--font); font-size: 13px; font-weight: 500;
  padding: 8px 16px; transition: all var(--t);
}
.btn-ghost:hover { border-color: var(--border-hi); color: var(--text); }

.btn-primary {
  background: var(--accent); border: none;
  border-radius: var(--r-sm); color: #fff;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 8px 20px; transition: all var(--t);
}
.btn-primary:hover { background: var(--accent-light); box-shadow: 0 4px 14px var(--accent-glow); }

/* ═══════════════════════════════════════════
   CONTEXT MENU
═══════════════════════════════════════════ */
.ctx-menu {
  position: fixed; background: var(--surface);
  border: 1px solid var(--border-hi); border-radius: var(--r-md);
  padding: 6px; min-width: 172px;
  box-shadow: var(--shadow-lg); z-index: 400; display: none;
}
.ctx-menu.open { display: block; animation: popIn 140ms ease; }

.ctx-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; background: none; border: none;
  border-radius: var(--r-sm); color: var(--text);
  font-family: var(--font); font-size: 12px; font-weight: 500;
  padding: 8px 10px; transition: background var(--t);
}
.ctx-item:hover { background: var(--surface2); }
.ctx-done:hover  { color: var(--done); }
.ctx-skip:hover  { color: var(--skip); }
.ctx-push:hover  { color: var(--push); }
.ctx-edit:hover  { color: var(--accent); }
.ctx-del:hover   { color: var(--skip); background: var(--skip-dim); }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ═══════════════════════════════════════════
   PUSH DATE OVERLAY
═══════════════════════════════════════════ */
.overlay-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  z-index: 350; display: none;
  align-items: center; justify-content: center;
}
.overlay-backdrop.open { display: flex; animation: fadeIn 150ms ease; }

.mini-modal {
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: var(--r-xl); padding: 24px; min-width: 280px;
  box-shadow: var(--shadow-lg); animation: popIn 180ms ease;
}
.mini-modal h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.mini-modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ═══════════════════════════════════════════
   TOASTS
═══════════════════════════════════════════ */
.toast-stack {
  position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%);
  z-index: 500; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none;
}
.toast {
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: var(--r-md); color: var(--text);
  font-size: 12px; font-weight: 500; padding: 8px 18px;
  box-shadow: var(--shadow); white-space: nowrap;
  animation: toastIn 230ms ease; pointer-events: all;
}
.toast.toast-success { border-color: var(--done);   color: var(--done); }
.toast.toast-error   { border-color: var(--skip);   color: var(--skip); }
.toast.toast-out     { animation: toastOut 230ms ease forwards; }

/* ═══════════════════════════════════════════
   KEYBOARD HINT
═══════════════════════════════════════════ */
.kb-bar {
  position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--text3); z-index: 50;
  white-space: nowrap; pointer-events: none;
}
kbd {
  background: var(--surface2); border: 1px solid var(--border-hi);
  border-radius: 4px; padding: 1px 5px;
  font-size: 10px; font-family: var(--font); font-weight: 600;
  color: var(--text2);
}

/* ═══════════════════════════════════════════
   CONFETTI
═══════════════════════════════════════════ */
#confettiCanvas {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 600;
  width: 100vw; height: 100vh;
}

/* ═══════════════════════════════════════════
   INSTALL BANNER
═══════════════════════════════════════════ */
.install-banner {
  position: fixed; bottom: 14px; right: 14px;
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: var(--r-md); padding: 10px 14px;
  display: none; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text);
  box-shadow: var(--shadow); z-index: 200;
}
.install-banner.visible { display: flex; animation: slideInRight 280ms ease; }
.install-yes {
  background: var(--accent); border: none; border-radius: 6px;
  color: #fff; font-family: var(--font);
  font-size: 11px; font-weight: 600; padding: 4px 12px;
}
.install-no {
  background: none; border: none;
  color: var(--text3); font-size: 14px; padding: 2px 4px;
}

/* ═══════════════════════════════════════════
   SCROLLBARS
═══════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ═══════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════ */
@keyframes popIn {
  from { opacity: 0; transform: scale(.92) translateY(-4px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(.93); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-10px) scale(.93); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.task-card.entering { animation: cardEnter 180ms ease; }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .today-sidebar { display: none; }
  .kb-bar { display: none; }
}
@media (max-width: 700px) {
  .header-center { display: none; }
  .period-nav    { display: none; }
  .logo-text     { display: none; }
  .btn-add-task  { padding: 6px 10px; }
}
@media (max-width: 520px) {
  .week-header-day { padding: 6px 4px; }
  .whd-date { font-size: 15px; }
  .week-col { padding: 6px 4px; }
}
