:root {
  --bg: #f4f7fb;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --text: #172033;
  --muted: #6d778a;
  --border: rgba(18, 26, 44, 0.1);
  --shadow: 0 18px 45px rgba(18, 90, 44, 0.08);
  --shadow-soft: 0 8px 20px rgba(18, 90, 44, 0.06);

  --primary: #2f8f46;
  --primary-hover: #26763a;

  --weekend: #3ca44d;
  --completed: #0f766e;

  --day-bg: rgba(255, 255, 255, 0.96);
  --day-hover: #eef9f0;
  --today: #dcf6e4;
  --empty: transparent;
  --danger: #ef4444;
  --success: #16a34a;
  --brand-green: #215732;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(47, 143, 70, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(123, 200, 87, 0.12), transparent 26%),
    linear-gradient(180deg, #f5fbf5 0%, #eef8ef 52%, #f8fcf8 100%);
  overflow: hidden;
}

.app-shell {
  max-width: 1600px;
  height: 100vh;
  margin: 0 auto;
  padding: 24px;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand__logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-green), #3f7f4e);
  box-shadow: 0 8px 18px rgba(18, 90, 44, 0.14);
  font-size: 16px;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.brand__logo::before {
  content: '';
  position: absolute;
  inset: -20%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.00) 34%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0.00) 66%,
    transparent 100%
  );
  transform: translateX(-80%) rotate(18deg);
  animation: brandSweep 2.8s ease-in-out infinite;
  pointer-events: none;
}

.brand__logo::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.brand__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.brand__subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-btn {
  background: var(--surface-solid);
  box-shadow: 0 8px 18px rgba(47, 143, 70, 0.10);
  border: 1.5px solid rgba(47, 143, 70, 0.22);
  font-weight: 700;
}

.toolbar-btn:hover {
  background: rgba(47, 143, 70, 0.1);
  box-shadow: 0 8px 22px rgba(47, 143, 70, 0.18);
}

.toolbar .btn-secondary,
.toolbar .icon-btn {
  background: var(--surface-solid);
}

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1.6fr) 220px;
  gap: 16px;
  align-items: start;
  flex: 1;
  min-height: 0;
}

main.layout {
  min-height: 0;
}

.calendar-panel,
.side-card,
.modal__content {
  backdrop-filter: blur(12px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 22px;
}

.calendar-panel {
  padding: 14px 16px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.month-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.calendar-wrapper {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.calendar-side-btn {
  flex: 0 0 44px;
  width: 44px;
  border-radius: 14px;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(47, 143, 70, 0.18), rgba(47, 143, 70, 0.1));
  border: 1.5px solid rgba(47, 143, 70, 0.25);
  color: var(--primary);
  box-shadow: 0 4px 14px rgba(47, 143, 70, 0.18);
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.calendar-side-btn:hover {
  background: linear-gradient(135deg, rgba(47, 143, 70, 0.3), rgba(47, 143, 70, 0.18));
  box-shadow: 0 5px 18px rgba(47, 143, 70, 0.28);
  transform: none;
}

.month-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
  margin-left: 20px;
  margin-right: 20px;
}

.icon-btn,
.btn {
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: 0.2s ease;
  font-weight: 600;
}

.icon-btn {
  width: 44px;
  height: 44px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  font-size: 18px;
  position: relative;
}

.icon-btn:hover,
.btn:hover {
  transform: translateY(-1px);
}

.icon-btn--close {
  width: 42px;
  height: 42px;
  font-size: 28px;
  line-height: 1;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.btn {
  padding: 12px 16px;
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #58b96c);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), #2f8f46);
}

.btn-secondary {
  background: #e8f6ea;
  color: #1f3b27;
  font-weight: 700;
  border: 1.5px solid rgba(47, 143, 70, 0.2);
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.calendar-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  flex: 1;
  min-width: 0;
  min-height: 0;
  align-content: start;
}

.weekday {
  text-align: center;
  padding: 8px 4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(47, 143, 70, 0.08);
  border-radius: 10px;
}

.day {
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-radius: 18px;
  background: var(--day-bg);
  border: 2px solid rgba(18, 26, 44, 0.18);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
  padding: 8px 10px 9px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: 0.2s ease;
  align-self: stretch;
}

.day:hover {
  background: var(--day-hover);
  transform: translateY(-1px);
}

.day.empty {
  background: var(--empty);
  border: 2px solid transparent;
  box-shadow: none;
  cursor: default;
}

.day.today {
  background: linear-gradient(180deg, #e6f8ea, #f2fbf4);
  border-color: rgba(47, 143, 70, 0.55);
  box-shadow: 0 0 0 1px rgba(47, 143, 70, 0.12), 0 8px 18px rgba(18, 90, 44, 0.08);
  animation: todayBorderPulse 5s ease-in-out infinite;
}


.day.weekend {
  border-color: rgba(60, 164, 77, 0.35);
  background: linear-gradient(180deg, rgba(242, 252, 244, 0.98), rgba(255, 255, 255, 0.98));
}

.day.day--outside-month {
  opacity: 0.38;
  filter: saturate(0.65);
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(18, 26, 44, 0.08);
}

.day.day--outside-month .day-number {
  background: rgba(15, 23, 42, 0.03);
  color: rgba(23, 32, 51, 0.55);
}

.day.day--outside-month .entry-list {
  opacity: 0.55;
}

.day.day--outside-month:hover {
  opacity: 0.58;
}

.day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 16px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.05);
  font-weight: 800;
  font-size: 9px;
  flex-shrink: 0;
}

.entry-first-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.entry-first-row .task-square {
  flex: 1;
  min-width: 0;
}

.day.today .day-number {
  background: rgba(47, 143, 70, 0.12);
}

.day.weekend .day-number {
  background: rgba(60, 164, 77, 0.16);
}

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 0;
  max-height: calc(100% - 24px);
  overflow: hidden;
}

.task-square {
  height: 16px;
  border-radius: 6px;
  color: white;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  overflow: hidden;
  padding: 0 7px;
  text-align: left;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(18, 90, 44, 0.10);
  white-space: nowrap;
  text-overflow: ellipsis;
  gap: 4px;
  position: relative;
}

.task-square::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: #1e293b;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 100;
}

.task-square:hover::after {
  opacity: 1;
}

.more {
  margin-top: 0;
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.1;
}

.left-panel,
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.side-card {
  padding: 18px;
}

.side-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.side-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.help-modal {
  min-height: 180px;
}

.help-list {
  display: grid;
  gap: 10px;
  max-height: 60vh;
  overflow: auto;
  padding-right: 6px;
}

.help-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid var(--border);
}

.help-item__num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #dcfce7;
  color: #166534;
  font-weight: 800;
  font-size: 13px;
}

.help-item__text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.upcoming-list {
  display: grid;
  gap: 10px;
}

.urgent-section {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.urgent-section__title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: #b91c1c;
}

.upcoming-item {
  padding: 12px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid var(--border);
  min-width: 0;
}

.upcoming-item--important {
  border-color: rgba(239, 68, 68, 0.25);
  background: linear-gradient(180deg, rgba(255, 241, 241, 0.95), rgba(255, 255, 255, 0.98));
}

.upcoming-item__date {
  font-size: 11px;
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upcoming-item__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 4px;
}

.upcoming-item__title {
  font-size: 14px;
  font-weight: 800;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upcoming-item__desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upcoming-item__important {
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}

.legend {
  display: grid;
  gap: 8px;
}

.legend--scroll {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.75);
  border: 3px solid rgba(18, 26, 44, 0.08);
  cursor: pointer;
}

.legend-row.active {
  background: rgba(47, 143, 70, 0.08);
}

.legend-row__main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.legend-row__name {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.15;
}

.legend-row__count {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  background: rgba(47, 143, 70, 0.10);
  border-radius: 999px;
  padding: 3px 7px;
  line-height: 1;
}

.legend__remove,
.legend__add,
.legend__edit {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  font-weight: 800;
  display: grid;
  place-items: center;
  transition: 0.2s ease;
  flex: 0 0 auto;
}

.legend__add {
  background: #dcfce7;
  color: #166534;
}

.legend__remove {
  background: #fee2e2;
  color: #991b1b;
}

.legend__edit {
  background: #e0f2fe;
  color: #075985;
}

.legend__remove:hover,
.legend__add:hover,
.legend__edit:hover {
  transform: translateY(-1px);
}

.legend__actions {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  padding: 18px;
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
}

.modal--top {
  align-items: flex-start;
  padding-top: 22px;
}

.modal.open {
  display: flex;
}

.modal__content {
  width: 100%;
  max-width: 760px;
  padding: 22px;
  background: rgba(255,255,255,0.92);
}

#dayModal {
  align-items: flex-start;
  padding-top: 18px;
}

#dayModal .modal__content {
  width: min(96vw, 1400px);
  max-width: 1400px;
  max-height: 92vh;
  overflow: auto;
  padding: 28px;
  border-radius: 28px;
}

#dayModal .tasks-list {
  max-height: 68vh;
}

#dayModal .modal__title {
  font-size: 26px;
}

#dayModal .modal__date {
  font-size: 15px;
  display: none;
}

.modal__content--small {
  max-width: 520px;
}

.modal__content--wide {
  max-width: 1100px;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal__title {
  margin: 0;
  font-size: 22px;
}

.modal__date {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.task-form {
  padding: 16px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}

.form-row--category {
  grid-template-columns: 1.4fr 220px;
  align-items: end;
}

.form-row--category .field input[type="color"] {
  height: 46px;
  padding: 6px;
  cursor: pointer;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: #2a3550;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(18, 26, 44, 0.12);
  background: white;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
  transition: 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(47, 143, 70, 0.5);
  box-shadow: 0 0 0 4px rgba(47, 143, 70, 0.08);
}

#taskDescription {
  resize: none;
}

.task-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.task-form__actions--split {
  justify-content: space-between;
  gap: 10px;
}

.task-form__actions--inline {
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.task-form__left-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #2a3550;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: #16a34a;
}

.repeat-toggle {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.repeat-toggle__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(18, 26, 44, 0.12);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  user-select: none;
}

.repeat-toggle__item input {
  accent-color: #16a34a;
}

.tasks-list,
.all-tasks-list,
.completed-tasks-list {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.tasks-list {
  max-height: 58vh;
  overflow: auto;
  padding-right: 6px;
}

#dayModal .tasks-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-content: start;
}

#dayModal .tasks-list[data-columns="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#dayModal .task-group-title {
  grid-column: 1 / -1;
}

#dayModal .empty-state {
  grid-column: 1 / -1;
}

.closed-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.closed-tab {
  padding: 8px 20px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface-solid);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: 0.2s ease;
}

.closed-tab:hover {
  background: rgba(47, 143, 70, 0.08);
  color: var(--text);
}

.closed-tab--active {
  background: rgba(47, 143, 70, 0.15);
  border-color: rgba(47, 143, 70, 0.25);
  color: var(--primary);
  font-weight: 700;
}

.task-card,
.all-task-row,
.completed-task-row {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: white;
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.all-task-row:hover,
.completed-task-row:hover {
  box-shadow: 0 6px 20px rgba(47, 143, 70, 0.1);
  border-color: rgba(47, 143, 70, 0.2);
  transform: translateY(-1px);
}

.task-card {
  padding: 10px;
}

.task-card--important {
  border-color: rgba(239, 68, 68, 0.25);
  background: linear-gradient(180deg, rgba(255, 241, 241, 0.96), #ffffff);
}

.task-card__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 6px;
}

.task-card__title {
  font-weight: 800;
  font-size: 14px;
  margin: 0;
}

.task-card__desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
  white-space: pre-wrap;
}

.task-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 14px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}


.task-important-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  color: #b91c1c;
  background: #fee2e2;
  flex-shrink: 0;
}

.task-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.task-card__actions .btn-success {
  margin-left:30px;
}

.task-card__actions .btn-danger {
  margin-left: 0;
}




.btn-ghost {
  background: #f3f4f6;
  color: #1f2937;
}

.btn-success {
  background: #dcfce7;
  color: #166534;
}

.empty-state {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(18, 26, 44, 0.15);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.7);
}

.all-tasks-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.all-tasks-list,
.completed-tasks-list {
  max-height: 72vh;
  overflow: auto;
  padding-right: 6px;
}

.all-task-row,
.completed-task-row {
  display: flex;
  align-items: stretch;
  gap: 14px;
}

.all-task-row__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 64px;
  flex-shrink: 0;
}

.all-task-row__side-date {
  font-weight: 800;
  font-size: 13px;
  color: #1f2a44;
  line-height: 1.2;
  text-align: center;
}

.all-task-row__side-badge {
  border-radius: 10px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  color: white;
  text-align: center;
  white-space: nowrap;
  max-width: 64px;
}

.all-task-row__divider {
  width: 3px;
  border-radius: 3px;
  flex-shrink: 0;
  min-height: 100%;
}

.all-task-row__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.all-task-row__main h3,
.completed-task-row__main h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
}

.all-task-row__main p,
.completed-task-row__main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.all-task-row__main .task-important-badge {
  align-self: flex-start;
}

.all-task-row__date,
.completed-task-row__date {
  font-weight: 800;
  color: #1f2a44;
  font-size: 13px;
}

.all-task-row__actions,
.completed-task-row__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  align-items: flex-end;
  justify-content: center;
}

.task-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(47, 143, 70, 0.2);
  background: rgba(47, 143, 70, 0.06);
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  transition: 0.15s ease;
}

.task-link-btn:hover {
  background: rgba(47, 143, 70, 0.14);
  border-color: rgba(47, 143, 70, 0.3);
}

.btn-danger {
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 12px;
  border: 1.5px solid rgba(220, 38, 38, 0.15);
  background: rgba(239, 68, 68, 0.06);
  color: #b91c1c;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(220, 38, 38, 0.3);
}

.completed-task-row__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.completed-note {
  font-size: 12px;
  color: var(--completed);
  font-weight: 700;
}

.task-card__urgent-label {
  font-size: 11px;
  font-weight: 800;
  color: #b91c1c;
  margin-top: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.96);
  color: #17301f;
  border: 1px solid rgba(47, 143, 70, 0.18);
  box-shadow: 0 14px 30px rgba(18, 90, 44, 0.14);
  border-radius: 18px;
  padding: 14px 18px;
  font-weight: 700;
  z-index: 2000;
  transition: 0.25s ease;
  max-width: min(92vw, 420px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.calendar--week {
  align-content: start;
}

.calendar--week .day {
  aspect-ratio: auto;
  min-height: 260px;
}

.calendar--week .entry-list {
  max-height: none;
  overflow: visible;
}

.calendar--week .task-square {
  height: 22px;
  font-size: 10px;
}

@media (max-width: 1300px) {
  .layout {
    grid-template-columns: 1fr 320px;
  }

  .left-panel {
    grid-column: 1 / -1;
    order: -1;
  }
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }

  .left-panel {
    grid-column: auto;
    order: 0;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .calendar {
    gap: 8px;
  }

  .day {
    min-height: 104px;
    padding: 8px;
  }

  .weekday {
    font-size: 11px;
    padding: 8px 2px;
  }

  .brand__title {
    font-size: 22px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row--category {
    grid-template-columns: 1fr;
  }

  .side-panel,
  .layout {
    grid-template-columns: 1fr;
  }

  .modal__content {
    padding: 16px;
  }

  .all-task-row,
  .completed-task-row {
    flex-direction: column;
  }

  .all-task-row__divider {
    width: 100%;
    height: 3px;
    min-height: 3px;
  }

  .all-task-row__side {
    flex-direction: row;
    min-width: auto;
    width: 100%;
  }

  .all-task-row__actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  #dayModal .modal__content {
    width: 100%;
    max-width: none;
    max-height: 94vh;
    padding: 18px;
    border-radius: 22px;
  }

  #dayModal .tasks-list {
    max-height: 56vh;
  }

  #dayModal .tasks-list[data-columns="2"] {
    grid-template-columns: 1fr;
  }
}

.notifications-card {
  background: rgba(255, 255, 255, 0.82);
}

.notifications-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid var(--border);
}

.notification-item__title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #1f2a44;
}

.notification-item__value {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 600;
}

.notification-item__value--danger {
  color: #b91c1c;
}

.notification-item__value--success {
  color: #166534;
}

@media (max-width: 560px) {
  .calendar {
    gap: 6px;
  }

  .day {
    min-height: 88px;
  }

  .month-title {
    font-size: 18px;
  }
}

@keyframes brandSweep {
  0% {
    transform: translateX(-80%) rotate(18deg);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  50% {
    transform: translateX(80%) rotate(18deg);
    opacity: 1;
  }
  82% {
    opacity: 0;
  }
  100% {
    transform: translateX(80%) rotate(18deg);
    opacity: 0;
  }
}
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(245, 251, 245, 0.96), rgba(238, 248, 239, 0.98));
  backdrop-filter: blur(10px);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-screen__card {
  min-width: 260px;
  padding: 28px 32px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(18, 26, 44, 0.08);
  box-shadow: 0 18px 45px rgba(18, 90, 44, 0.12);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 14px;
}

.loading-screen__title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.loading-screen__text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 5px solid rgba(47, 143, 70, 0.15);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.auth-card {
  background: rgba(255, 255, 255, 0.82);
}

.auth-code-block {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.auth-code-block__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.auth-code-block__value {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(18, 26, 44, 0.1);
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form__input {
  width: 100%;
  border: 1px solid rgba(18, 26, 44, 0.12);
  background: white;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
  transition: 0.2s ease;
}

.auth-form__input:focus {
  border-color: rgba(47, 143, 70, 0.5);
  box-shadow: 0 0 0 4px rgba(47, 143, 70, 0.08);
}

.auth-form__btn {
  width: 100%;
}

.toolbar-code-block {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(18, 26, 44, 0.08);
  box-shadow: 0 8px 18px rgba(18, 90, 44, 0.06);
}

.toolbar-code-block__value {
  min-width: 160px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(18, 26, 44, 0.1);
  font-weight: 800;
  font-size: 13px;
  color: transparent;
  text-shadow: 0 0 8px rgba(23, 32, 51, 0.55);
  white-space: nowrap;
  transition: 0.2s ease;
  user-select: none;
}

.toolbar-code-block:hover .toolbar-code-block__value {
  color: var(--text);
  text-shadow: none;
  user-select: text;
}



.toolbar-code-block__input {
  width: 160px;
  border: 1px solid rgba(18, 26, 44, 0.12);
  background: white;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  outline: none;
  transition: 0.2s ease;
}

.toolbar-code-block__input:focus {
  border-color: rgba(47, 143, 70, 0.5);
  box-shadow: 0 0 0 4px rgba(47, 143, 70, 0.08);
}
.toolbar-code-block__input-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.toolbar-code-block__submit {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9px;
  background: #e8f6ea;
  color: #166534;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
  flex: 0 0 auto;
}

.toolbar-code-block__submit:hover {
  background: #dcfce7;
  transform: translateY(-1px);
}

.toolbar-code-block__submit:active {
  transform: translateY(0);
}

/* ===== Switch Account ===== */

.switch-account-btn {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1.5px solid rgba(47, 143, 70, 0.28);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(47, 143, 70, 0.10);
  transition: all 0.22s ease;
  flex: 0 0 auto;
}

.switch-account-btn:hover {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  box-shadow: 0 6px 20px rgba(47, 143, 70, 0.18);
  transform: translateY(-1px);
}

.switch-account-btn:active {
  transform: translateY(0);
}

.switch-account-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 0 6px;
}

.switch-account-form__label {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.switch-account-form__row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.switch-account-form__row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 10px 18px;
}

.switch-account-form__input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid rgba(47, 143, 70, 0.22);
  border-radius: 10px;
  background: var(--surface-solid);
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.switch-account-form__input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.switch-account-form__input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 143, 70, 0.12);
}

.switch-account-form__input.is-invalid {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.12);
}

.switch-account-form__row .btn-primary {
  background: linear-gradient(135deg, #2f8f46 0%, #215732 100%);
  color: #fff;
  border: none;
  font-weight: 600;
}

.switch-account-form__row .btn-primary:hover {
  background: linear-gradient(135deg, #38a554 0%, #2a6d40 100%);
  box-shadow: 0 6px 20px rgba(47, 143, 70, 0.30);
}

.switch-account-form__actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.switch-account-form__actions .btn {
  flex: 1;
}

.switch-account-form__actions .btn-secondary {
  border: 1.5px solid rgba(47, 143, 70, 0.22);
  color: #1f3b27;
  font-weight: 600;
}

.switch-account-form__actions .btn-secondary:hover {
  background: rgba(47, 143, 70, 0.08);
}

.switch-account-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.switch-account-list::-webkit-scrollbar {
  width: 5px;
}

.switch-account-list::-webkit-scrollbar-thumb {
  background: rgba(47, 143, 70, 0.25);
  border-radius: 8px;
}

.switch-account-list__empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 0;
}

.switch-account-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-solid);
  border: 1.5px solid rgba(47, 143, 70, 0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.switch-account-item:hover {
  background: rgba(47, 143, 70, 0.06);
  border-color: rgba(47, 143, 70, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(47, 143, 70, 0.10);
}

.switch-account-item--active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  cursor: default;
}

.switch-account-item--active:hover {
  transform: none;
  box-shadow: none;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.switch-account-item__code {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
  font-family: 'Courier New', Courier, monospace;
  word-break: break-all;
}

.switch-account-item__badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(47, 143, 70, 0.10);
  padding: 2px 8px;
  border-radius: 20px;
  flex: 0 0 auto;
}

.switch-account-item__copy,
.switch-account-item__remove {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 0 0 auto;
  line-height: 1;
  font-size: 14px;
}

.switch-account-item__copy {
  border: 1.5px solid rgba(47, 143, 70, 0.18);
  padding: 2px;
}

.switch-account-item__copy:hover {
  background: rgba(47, 143, 70, 0.10);
  border-color: rgba(47, 143, 70, 0.35);
}

.switch-account-item__remove {
  border: 1.5px solid rgba(200, 0, 0, 0.15);
  color: #c80000;
  font-size: 16px;
}

.switch-account-item__remove:hover {
  background: rgba(200, 0, 0, 0.08);
  border-color: rgba(200, 0, 0, 0.3);
}

.switch-account-divider {
  height: 1px;
  background: rgba(47, 143, 70, 0.12);
  margin: 6px 0;
}

@keyframes todayBorderPulse {
  0% {
    border-color: rgba(47, 143, 70, 0.45);
    box-shadow: 0 0 0 1px rgba(47, 143, 70, 0.10), 0 8px 18px rgba(18, 90, 44, 0.06);
  }
  50% {
    border-color: rgba(47, 143, 70, 0.75);
    box-shadow: 0 0 0 2px rgba(47, 143, 70, 0.18), 0 10px 22px rgba(18, 90, 44, 0.10);
  }
  100% {
    border-color: rgba(47, 143, 70, 0.45);
    box-shadow: 0 0 0 1px rgba(47, 143, 70, 0.10), 0 8px 18px rgba(18, 90, 44, 0.06);
  }
}

/* ----- Reason label in closed tasks ----- */

.task-reason {
  margin-top: 6px;
  padding: 6px 10px;
  border-left: 3px solid #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: #92400e;
  font-weight: 500;
  line-height: 1.4;
}
