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

:root {
  --bg: #f4f0fb;
  --surface: #ffffff;
  --border: #e8e4f0;
  --text: #1a1a2e;
  --text-muted: #9494a8;
  --accent-gradient: linear-gradient(135deg, #7c3aed, #a855f7);
  --accent: #7c3aed;

  --comp-color: #8b5cf6;
  --comp-border: #a78bfa;
  --comp-bg: #faf8ff;
  --liked-color: #16a34a;
  --liked-border: #22c55e;
  --liked-bg: #f7fdf9;
  --disliked-color: #dc2626;
  --disliked-border: #ef4444;
  --disliked-bg: #fef7f7;
  --improve-color: #ea580c;
  --improve-border: #f97316;
  --improve-bg: #fffaf5;
  --notes-color: #4f46e5;
  --notes-border: #6366f1;
  --notes-bg: #f8f7ff;

  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 2px 12px rgba(100, 80, 160, 0.06);
  --shadow-lg: 0 4px 24px rgba(100, 80, 160, 0.1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
}

body {
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

/* ===== Buttons ===== */
.btn {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

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

.btn--primary {
  background: var(--accent-gradient);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.btn--primary:hover {
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

/* ===== Login ===== */
.login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login__card {
  background: var(--surface);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.login__title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login__subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.login__form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.login__form input {
  font-family: var(--font);
  font-size: 15px;
  padding: 0.85rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login__form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.08);
}

.login__error {
  color: #dc2626;
  font-size: 0.85rem;
}

/* ===== Header ===== */
.header {
  background: var(--surface);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 0 var(--border);
}

.header__title {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.header__actions .btn {
  font-size: 14px;
  color: var(--text-muted);
}

.header__actions .btn .icon-emoji {
  font-size: 30px;
  line-height: 1;
}

.day-header__total .icon-total {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

/* ===== Day Header ===== */
.day-header {
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.day-header__nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.day-header__nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 300;
  transition: all 0.2s;
}

.day-header__nav-btn:hover {
  background: var(--surface);
  box-shadow: var(--shadow);
}

.day-header__date {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.day-header__streak {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.day-header__select {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  padding: 0.55rem 2.2rem 0.55rem 1.2rem;
  border-radius: 50px;
  border: none;
  background: #5b21b6;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(91, 33, 182, 0.4);
  -webkit-text-fill-color: #ffffff;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  outline: none;
  transition: box-shadow 0.2s;
}

.day-header__select:hover {
  background: #4c1d95;
  box-shadow: 0 6px 24px rgba(76, 29, 149, 0.45);
}

.day-header__check {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
}

.day-header__check:hover {
  border-color: #22c55e;
  color: #22c55e;
}

.day-header__check--active {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

.day-header__total {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.day-header__select option {
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
}

/* ===== Input Bar ===== */
.input-bar {
  padding: 0 2rem 0.5rem;
}

.input-bar__card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.6rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.input-bar__input {
  flex: 1;
  font-family: var(--font);
  font-size: 15px;
  padding: 0.8rem 1rem;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
}

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

.input-bar__btn {
  flex-shrink: 0;
}

.input-bar__btn .sparkle {
  font-size: 16px;
}

.input-bar__hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 0.5rem;
  padding-left: 0.5rem;
}

.input-bar--loading .input-bar__input {
  opacity: 0.5;
}

.input-bar--loading .input-bar__btn {
  opacity: 0.6;
  pointer-events: none;
}

/* ===== Days Bar ===== */
.days-bar {
  padding: 0.5rem 2rem 0.8rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.days-bar__item {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.days-bar__item:hover {
  color: var(--accent);
}

.days-bar__item--active {
  background: var(--accent-gradient);
  color: #fff;
}

/* ===== Board (Kanban) ===== */
.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  padding: 0.8rem 2rem 2rem;
  min-height: calc(100vh - 260px);
}

/* ===== Column ===== */
.column {
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.column--dragover {
  box-shadow: 0 0 0 3px var(--accent), var(--shadow-lg);
}

.column--compensation { border-color: var(--comp-border); background: var(--comp-bg); }
.column--liked { border-color: var(--liked-border); background: var(--liked-bg); }
.column--disliked { border-color: var(--disliked-border); background: var(--disliked-bg); }
.column--improvements { border-color: var(--improve-border); background: var(--improve-bg); }
.column--notes { border-color: var(--notes-border); background: var(--notes-bg); }

.column__header {
  padding: 1rem 1rem 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.column__header span:first-child {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.column--compensation .column__header { color: var(--comp-color); }
.column--liked .column__header { color: var(--liked-color); }
.column--disliked .column__header { color: var(--disliked-color); }
.column--improvements .column__header { color: var(--improve-color); }
.column--notes .column__header { color: var(--notes-color); }

.column__items {
  flex: 1;
  padding: 0 0.6rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 80px;
}

/* ===== Item Card ===== */
.item {
  background: var(--surface);
  border-radius: var(--radius-xs);
  padding: 0.8rem 0.9rem;
  cursor: grab;
  transition: all 0.15s;
  position: relative;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.item:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.item:active {
  cursor: grabbing;
}

.item.dragging {
  opacity: 0.4;
  transform: scale(0.96);
}

.item__text {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  color: var(--text);
}

.item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  gap: 0.5rem;
}

.item__strength {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}


.item__time {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-left: auto;
}

.item__delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  font-size: 15px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.item:hover .item__delete {
  display: flex;
}

.item__delete:hover {
  background: #fef2f2;
  color: #dc2626;
}

.item__edit-input {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  padding: 0.3rem 0.4rem;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  outline: none;
  resize: vertical;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.item__strength-select {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border: 1px solid var(--comp-border);
  border-radius: 6px;
  background: var(--comp-bg);
  color: var(--comp-color);
  outline: none;
  cursor: pointer;
}

.item__strength-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ===== Header Actions Icons ===== */
.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
}

/* ===== Settings ===== */
.settings {
  min-height: 100vh;
  padding: 2rem;
  display: flex;
  justify-content: center;
}

.settings__card {
  background: var(--surface);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 620px;
  box-shadow: var(--shadow-lg);
  height: fit-content;
}

.settings__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.settings__title {
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.settings__form {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.08);
}

.settings__section {
  margin-bottom: 0.5rem;
}

.settings__section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.settings__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.streaks-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.streak-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.6rem 0.9rem;
}

.streak-item__name {
  font-size: 14px;
  font-weight: 500;
}

.streak-item__delete {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.streak-item__delete:hover {
  background: #fef2f2;
  color: #dc2626;
}

.streaks-add {
  display: flex;
  gap: 0.5rem;
}

.streaks-add__input {
  flex: 1;
  font-family: var(--font);
  font-size: 14px;
  padding: 0.55rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.streaks-add__input:focus {
  border-color: var(--accent);
}

.settings__status {
  font-size: 13px;
  color: var(--liked-color);
  font-weight: 600;
}

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

@media (max-width: 800px) {
  .board {
    grid-template-columns: repeat(2, 1fr);
  }
  .header { padding: 0.8rem 1rem; }
  .day-header { padding: 1rem; }
  .input-bar { padding: 0 1rem 0.5rem; }
  .board { padding: 0.8rem 1rem 2rem; }
  .days-bar { padding: 0.5rem 1rem 0.8rem; }
}

@media (max-width: 550px) {
  .board {
    grid-template-columns: 1fr;
  }

  .day-header__date {
    font-size: 1.2rem;
  }

  .day-header__streak {
    width: 100%;
  }
}
