:root {
  color-scheme: light;
  --bg: #eef3f1;
  --paper: #fffef9;
  --paper-strong: #ffffff;
  --ink: #151a2d;
  --muted: #667085;
  --line: #d7ddd8;
  --soft-line: #e8ede8;
  --green: #087f5b;
  --blue: #2f5fb3;
  --amber: #d97706;
  --rose: #be3b2f;
  --violet: #6d4aff;
  --shadow: 0 22px 52px rgba(21, 26, 45, 0.1);
  font-family: "Avenir Next", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(8, 127, 91, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 95, 179, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto;
}

button,
select,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: var(--green);
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(47, 95, 179, 0.25);
  outline-offset: 2px;
}

.app-shell {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 42px;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 22px 0 18px;
  border-bottom: 3px solid var(--ink);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-size: 3.2rem;
  line-height: 1.02;
}

h2 {
  font-size: 2rem;
  line-height: 1.12;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.header-actions {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px;
  align-items: end;
}

.total-progress {
  min-width: 104px;
  padding: 9px 11px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  text-align: right;
  box-shadow: 4px 4px 0 rgba(21, 26, 45, 0.12);
}

.total-progress span {
  display: block;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}

.total-progress small {
  color: var(--muted);
  font-weight: 700;
}

#todayButton,
.ghost-button,
.primary-action {
  min-height: 42px;
  padding: 0 15px;
  font-weight: 850;
}

#todayButton {
  border-color: var(--ink);
  box-shadow: 4px 4px 0 rgba(21, 26, 45, 0.12);
}

.ghost-button {
  color: var(--muted);
}

.primary-action {
  border-color: var(--blue);
  background: #eff5ff;
  color: #1d4ed8;
}

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

.status-line {
  min-height: 20px;
  margin: 9px 0 0;
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 800;
}

.rule-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 20px;
}

.rule-strip span {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: rgba(255, 254, 249, 0.92);
  color: #344054;
  font-size: 0.92rem;
  font-weight: 800;
}

.rule-strip span:nth-child(2) {
  border-left-color: var(--blue);
}

.rule-strip span:nth-child(3) {
  border-left-color: var(--amber);
}

.cloud-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 16px;
  align-items: center;
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 249, 0.94);
  box-shadow: 5px 5px 0 rgba(21, 26, 45, 0.08);
}

.cloud-panel h2 {
  font-size: 1.3rem;
}

.auth-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-form input {
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
}

.auth-form input:first-child {
  grid-column: 1 / -1;
}

.auth-form button {
  min-height: 40px;
  font-weight: 850;
}

.user-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.user-bar strong,
.user-bar span {
  overflow-wrap: anywhere;
}

.user-bar span {
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 850;
}

.user-bar button {
  min-height: 38px;
  padding: 0 12px;
  font-weight: 850;
}

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.day-nav {
  position: sticky;
  top: 14px;
  min-width: 0;
  overflow: hidden;
}

.day-nav-head {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 249, 0.94);
}

.day-nav-head strong {
  font-size: 1.05rem;
}

select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
}

.day-list {
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding: 2px;
}

.day-button {
  width: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  margin: 0 0 8px;
  padding: 9px;
  border: 1px solid rgba(215, 221, 216, 0.92);
  border-left: 5px solid transparent;
  background: rgba(255, 254, 249, 0.78);
  text-align: left;
}

.day-button:hover,
.day-button.is-selected {
  border-left-color: var(--green);
  background: var(--paper-strong);
  box-shadow: 5px 5px 0 rgba(8, 127, 91, 0.12);
}

.day-button.is-today {
  border-left-color: var(--blue);
}

.date-box {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f9f7;
  font-weight: 950;
}

.day-button.is-done .date-box {
  border-color: #9bd2be;
  background: #e5f6ee;
  color: #047857;
}

.day-main {
  min-width: 0;
}

.day-main strong,
.day-main span {
  display: block;
  overflow-wrap: anywhere;
}

.day-main strong {
  font-size: 0.94rem;
  line-height: 1.1;
}

.day-main span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
}

.day-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.task-view {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.task-view::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 10px;
  background: repeating-linear-gradient(
    to bottom,
    var(--green) 0 18px,
    var(--blue) 18px 36px,
    var(--amber) 36px 54px,
    var(--rose) 54px 72px
  );
}

.task-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 22px 22px 16px 30px;
  border-bottom: 1px solid var(--line);
}

.day-progress {
  padding: 14px 22px 18px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.progress-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(21, 26, 45, 0.08);
  border-radius: 999px;
  background: #e1e6e2;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 180ms ease;
}

.dashboard-panel {
  padding: 16px 22px 16px 30px;
  border-bottom: 1px solid var(--line);
  background: #f9fbf8;
}

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

.dashboard-head h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.2;
}

.dashboard-head span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e9f8f1;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 950;
  white-space: nowrap;
}

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

.metric {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.metric strong,
.metric span {
  display: block;
}

.metric strong {
  font-size: 1.2rem;
  line-height: 1;
}

.metric span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.dashboard-insight {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1.45;
}

.task-list {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-section-title {
  padding: 12px 22px 10px 30px;
  border-bottom: 1px solid #cdd9ee;
  background: #eef5ff;
  color: #1d4ed8;
  font-size: 0.86rem;
  font-weight: 950;
  text-transform: uppercase;
}

.task-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 13px;
  padding: 17px 22px 17px 30px;
  border-bottom: 1px solid var(--soft-line);
  background: rgba(255, 254, 249, 0.88);
}

.task-item::after {
  content: "";
  position: absolute;
  left: 44px;
  top: 46px;
  bottom: -10px;
  width: 1px;
  background: var(--soft-line);
}

.task-item:last-child {
  border-bottom: 0;
}

.task-item:last-child::after {
  display: none;
}

.task-item.is-done {
  background: #effaf4;
}

.task-item.is-optional {
  background: #f8fbff;
}

.task-item.is-deferred {
  background: #f5f8ff;
}

.task-item.is-deferred::before {
  content: "Ertelenen";
  position: absolute;
  right: 22px;
  top: 14px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.task-item.is-optional::before {
  content: "İş arası";
  position: absolute;
  right: 22px;
  top: 14px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.task-check {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  margin: 4px 0 0;
  accent-color: var(--green);
}

.task-content {
  min-width: 0;
  padding-right: 84px;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #eef2ff;
  color: #243b80;
  font-size: 0.78rem;
  font-weight: 900;
}

.pill.time {
  background: #e9f8f1;
  color: #0f5f59;
}

.pill.turkce,
.pill.sozel-mantik {
  background: #f1edff;
  color: #5b2ac7;
}

.pill.matematik,
.pill.geometri,
.pill.sayisal-mantik {
  background: #eaf1ff;
  color: #214ca3;
}

.pill.tarih {
  background: #fff1dc;
  color: #9a4f03;
}

.pill.cografya {
  background: #e9f8f1;
  color: #087443;
}

.pill.vatandaslik,
.pill.guncel {
  background: #fff0ef;
  color: #b42318;
}

.pill.deneme,
.pill.analiz,
.pill.telafi {
  background: #f1f2f4;
  color: #344054;
}

.pill.is-arasi {
  background: #eef6ff;
  color: #1d4ed8;
}

.pill.deferred-pill {
  background: #eef6ff;
  color: #1d4ed8;
}

.task-text {
  margin: 0;
  max-width: 82ch;
  font-size: 1.02rem;
  font-weight: 780;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.task-source {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.task-item.is-done .task-text,
.task-item.is-done .task-source {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(8, 127, 91, 0.35);
}

@media (max-width: 940px) {
  .app-shell {
    width: min(100% - 22px, 780px);
    padding-top: 16px;
  }

  .app-header,
  .task-head {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.85rem;
  }

  h2 {
    font-size: 1.9rem;
  }

  .header-actions {
    justify-content: space-between;
  }

  .rule-strip {
    grid-template-columns: 1fr;
  }

  .cloud-panel {
    grid-template-columns: 1fr;
  }

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

  .day-nav {
    position: static;
  }

  .day-list {
    width: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 74vw);
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
  }

  .day-button {
    margin-bottom: 0;
  }

  .task-content {
    padding-right: 0;
  }

  .task-item.is-optional::before {
    position: static;
    grid-column: 2;
    grid-row: 1;
    width: max-content;
    margin-bottom: -6px;
  }

  .task-item.is-deferred::before {
    position: static;
    grid-column: 2;
    grid-row: 1;
    width: max-content;
    margin-bottom: -6px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 14px, 540px);
  }

  .app-header {
    padding-top: 12px;
  }

  h1 {
    font-size: 2.34rem;
  }

  h2 {
    font-size: 1.65rem;
  }

  .header-actions {
    grid-template-columns: 1fr 1fr;
  }

  .total-progress,
  #todayButton {
    width: 100%;
  }

  .progress-line {
    flex-direction: column;
  }

  .auth-form,
  .user-bar,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .task-head,
  .day-progress,
  .dashboard-panel,
  .task-item,
  .task-section-title {
    padding-left: 22px;
    padding-right: 16px;
  }

  .task-actions {
    justify-content: stretch;
  }

  .task-actions button {
    width: 100%;
  }

  .task-item {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .task-item::after {
    left: 34px;
  }
}
