:root,
[data-theme="violet"] {
  --background: #f7f6fa;
  --foreground: #191a26;
  --card: #ffffff;
  --muted: #ebe6f5;
  --muted-foreground: #5d5968;
  --border: #e5e0ed;
  --input: #e5e0ed;
  --primary: #8c7ab8;
  --primary-foreground: #ffffff;
  --primary-soft: #ebe6f5;
  --primary-strong: #655493;
  --secondary: #b48bbb;
  --destructive: #cf6d68;
  --success: #6a9c82;
  --warning: #d39a45;
  --info: #8297c0;
  --sidebar: #30344f;
  --sidebar-foreground: #dadcef;
  --shadow-sm: 0 1px 2px rgba(25, 26, 38, .06);
  --shadow-md: 0 8px 24px rgba(25, 26, 38, .09);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--foreground);
  background: var(--background);
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: 0 0 auto;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 16px 14px;
  color: var(--sidebar-foreground);
  background: var(--sidebar);
}

.brand {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  padding: 2px 4px 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--primary-strong);
  background: var(--card);
  font-weight: 800;
}

.brand-title {
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-subtitle {
  margin-top: 2px;
  color: rgba(255, 255, 255, .58);
  font-size: 12px;
  line-height: 1.3;
}

.nav-list {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, .72);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .1);
}

.summary {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.summary-item {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .08);
  font-size: 13px;
  font-weight: 600;
}

.summary-item span {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, .68);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-item strong {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--primary-strong);
  background: #ffffff;
}

.filters {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.sidebar-field {
  display: grid;
  gap: 6px;
}

.sidebar-field span {
  color: rgba(255, 255, 255, .68);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-field select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-md);
  color: #ffffff;
  background: rgba(255, 255, 255, .08);
}

.sidebar-field select option {
  color: var(--foreground);
  background: #ffffff;
}

.project-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 6px;
}

.project-form input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-md);
  outline: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, .08);
}

.project-form input::placeholder {
  color: rgba(255, 255, 255, .58);
}

.sidebar-button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-md);
  color: #ffffff;
  background: rgba(255, 255, 255, .08);
  font-weight: 700;
}

.sidebar-icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-md);
  color: #ffffff;
  background: rgba(255, 255, 255, .08);
}

.auth-panel {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.auth-label {
  color: rgba(255, 255, 255, .58);
  font-size: 12px;
  font-weight: 700;
}

.auth-status {
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-md);
  color: #ffffff;
  background: rgba(255, 255, 255, .08);
  font-weight: 700;
}

.google-btn:disabled {
  cursor: wait;
  opacity: .7;
}

.workspace {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-actions {
  display: grid;
  gap: 8px;
  width: min(420px, 44vw);
}

.week-switcher {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.eyebrow {
  margin-bottom: 2px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .025em;
}

h1 {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.08;
  font-weight: 800;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
}

.week-range {
  margin-top: 4px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 700;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--muted-foreground);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--foreground);
  background: transparent;
  font-size: 14px;
}

.search-results {
  display: grid;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.search-results[hidden] {
  display: none;
}

.search-results-title {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 800;
}

.search-results-hint {
  color: var(--muted-foreground);
  font-size: 12px;
}

.search-result-list {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 1px;
}

.search-result {
  display: grid;
  gap: 2px;
  min-width: min(320px, 80vw);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--foreground);
  background: var(--muted);
  text-align: left;
}

.search-result:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.search-result-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.search-result-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 700;
}

.task-form-card,
.column,
.dialog-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.task-form-card {
  padding: 10px 14px;
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.section-head p {
  display: none;
}

.task-form {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 190px 96px 92px 126px 158px 126px;
  gap: 9px;
  align-items: end;
}

.task-form > * {
  min-width: 0;
}

.title-field {
  grid-column: auto;
}

.repeat-field {
  grid-column: auto;
}

.time-field input {
  padding-right: 8px;
}

.add-task-btn {
  min-width: 0;
}

.field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field span {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  outline: 0;
  color: var(--foreground);
  background: #ffffff;
  font-size: 14px;
}

.field input,
.field select {
  height: 36px;
  padding: 0 12px;
}

.field select {
  padding-right: 28px;
  text-overflow: ellipsis;
}

.field select option {
  color: var(--foreground);
  background: #ffffff;
}

.field textarea {
  min-height: 104px;
  padding: 12px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(140, 122, 184, .18);
}

.primary-btn,
.danger-btn,
.ghost-btn,
.quiet-btn,
.icon-button,
.status-btn {
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 700;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 16px;
  color: var(--primary-foreground);
  background: var(--primary);
}

.primary-btn:hover {
  background: var(--primary-strong);
}

.quiet-btn {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  color: var(--primary-strong);
  background: var(--card);
}

.quiet-btn:hover {
  background: var(--primary-soft);
}

.danger-btn {
  min-height: 40px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--destructive);
}

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

.column {
  min-width: 0;
  min-height: 220px;
  padding: 10px;
}

.column.today {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(140, 122, 184, .12);
}

.column.drag-over {
  border-color: var(--primary);
  background: var(--muted);
}

.column-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.column-title {
  min-width: 0;
}

.column-title h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 19px;
}

.column-title p {
  margin-top: 2px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 700;
}

.column.today .column-title p {
  color: var(--primary-strong);
}

.column-count {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 800;
}

.task-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 132px;
}

@media (min-width: 921px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    min-height: 0;
  }

  .sidebar {
    height: 100vh;
    min-height: 0;
  }

  .workspace {
    height: 100vh;
    min-height: 0;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  .board {
    min-height: 0;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    height: 100%;
  }

  .column {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
  }

  .task-list {
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
  }
}

.task-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.task-card.done {
  opacity: .72;
}

.task-card.done .task-title {
  text-decoration: line-through;
}

.task-card.highlighted {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(140, 122, 184, .18), var(--shadow-sm);
}

.task-top {
  display: grid;
  gap: 6px;
}

.task-title {
  display: -webkit-box;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.16;
  font-weight: 750;
}

.task-kicker {
  min-height: 12px;
  margin-bottom: 2px;
  color: var(--primary-strong);
  font-size: 10px;
  font-weight: 800;
}

.task-notes {
  display: -webkit-box;
  margin-top: 3px;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.25;
}

.task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.ghost-btn,
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: var(--muted-foreground);
  background: var(--muted);
}

.ghost-btn:hover,
.icon-button:hover {
  color: var(--foreground);
  background: var(--primary-soft);
}

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

.badge,
.status-btn {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.priority-low { color: var(--success); background: rgba(106, 156, 130, .14); }
.priority-medium { color: var(--info); background: rgba(130, 151, 192, .16); }
.priority-high { color: var(--warning); background: rgba(211, 154, 69, .18); }
.status-todo { color: var(--muted-foreground); background: #f3f6f7; }
.status-in-progress { color: var(--primary-strong); background: var(--primary-soft); }
.status-done { color: var(--success); background: rgba(106, 156, 130, .14); }
.repeat-badge { color: var(--primary-strong); background: var(--primary-soft); }

.empty {
  display: grid;
  place-items: center;
  min-height: 66px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.task-dialog {
  width: min(620px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
}

.task-dialog::backdrop {
  background: rgba(23, 33, 43, .35);
}

.dialog-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 1160px) {
  .app-shell {
    grid-template-columns: 212px minmax(0, 1fr);
  }

  .task-form {
    grid-template-columns: minmax(260px, 1.4fr) minmax(168px, .8fr) 104px minmax(112px, .6fr);
  }

  .title-field {
    grid-column: span 2;
  }

  .priority-field,
  .repeat-field,
  .add-task-btn {
    grid-column: span 1;
  }

  .primary-btn {
    width: 100%;
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    padding: 12px;
  }

  .brand {
    padding-bottom: 12px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 12px;
  }

  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
    padding-top: 12px;
  }

  .auth-panel {
    margin-top: 14px;
  }

  .summary-item {
    min-height: 34px;
    padding: 0 8px;
    gap: 6px;
  }

  .summary-item span {
    font-size: 12px;
  }

  .summary-item strong {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
  }

  .workspace {
    padding: 14px 12px 24px;
  }

  .topbar,
  .section-head {
    display: grid;
  }

  .topbar-actions {
    width: 100%;
  }

  .week-switcher {
    justify-content: flex-start;
  }

  .search {
    width: 100%;
  }

  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dialog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .nav-list,
  .task-form,
  .board,
  .filters {
    grid-template-columns: 1fr;
  }

  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .title-field,
  .priority-field,
  .repeat-field,
  .add-task-btn {
    grid-column: auto;
  }

  .task-form-card,
  .dialog-card,
  .column {
    padding: 12px;
  }

  h1 {
    font-size: 26px;
  }

  .dialog-actions {
    display: grid;
  }
}
