:root {
  font-family: "Segoe UI", "DM Sans", sans-serif;
  color: #1b2b26;
  background: #f6f7f4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --green: #2e7458;
  --green-dark: #225b45;
  --ink: #1b2b26;
  --muted: #78847e;
  --line: #e8ebe6;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; min-height: 100vh; }

button { font: inherit; }
[hidden] { display: none !important; }

.app-shell { display: flex; min-height: 100vh; }
.app-shell[hidden] { display: none; }

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 16px;
  background: radial-gradient(ellipse at 80% 10%, rgba(196, 221, 193, .24), transparent 34%), #f6f7f4;
}

.auth-card {
  width: min(100%, 410px);
  padding: 34px 35px 27px;
  border: 1px solid #e7ebe5;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(34, 64, 46, .07);
}

.auth-brand { margin: 0 0 32px; }
.auth-card .eyebrow { margin-bottom: 9px; }
.auth-card h1 { margin-bottom: 8px; font-size: 27px; letter-spacing: -1px; }
.auth-description { margin-bottom: 21px; color: #78847e; font-size: 12px; line-height: 1.65; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 21px; border-radius: 7px; background: #f3f5f2; }
.auth-tab { min-height: 34px; border: 0; border-radius: 5px; background: transparent; color: #7d8981; cursor: pointer; font-size: 11px; }
.auth-tab.active { background: white; color: var(--green-dark); box-shadow: 0 1px 4px rgba(0,0,0,.07); font-weight: 600; }
.auth-label { display: block; margin: 13px 0 6px; color: #516158; font-size: 10px; font-weight: 600; }
.auth-input { width: 100%; height: 41px; padding: 0 11px; border: 1px solid #e0e6df; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; outline: none; }
.auth-input:focus { border-color: #80a78c; box-shadow: 0 0 0 3px rgba(86, 139, 103, .12); }
.password-hint { margin: 6px 0 0; color: #8a958e; font-size: 10px; }
.auth-submit { width: 100%; min-height: 42px; margin-top: 20px; }
.resend-button { display: block; margin: 12px auto 0; color: var(--green); }
.auth-message { padding: 10px 11px; margin: 14px 0 0; border: 1px solid #d6e5d7; border-radius: 6px; background: #f1f7f1; color: #39674b; font-size: 11px; line-height: 1.55; }
.auth-message.error { border-color: #eed4cc; background: #fcf2ef; color: #9d5140; }
.auth-privacy { margin: 19px 0 0; color: #9aa49d; font-size: 9px; text-align: center; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 2;
  display: flex;
  width: 252px;
  flex-direction: column;
  padding: 31px 18px 22px;
  border-right: 1px solid #e9ece7;
  background: #fbfcfa;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 55px 7px;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.8px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  background: var(--green);
  color: white;
  font-size: 16px;
}

.brand-dot { color: #78aa8a; }
.nav-label { margin: 0 0 12px 10px; color: #9aa39d; font-size: 10px; font-weight: 700; letter-spacing: 1.15px; }
.navigation { display: grid; gap: 5px; }

.nav-item {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #69756e;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}

.nav-item:hover { background: #f1f4ef; }
.nav-item.active { background: #eaf2eb; color: var(--green-dark); font-weight: 600; }
.nav-icon { width: 17px; color: #84928a; font-size: 17px; text-align: center; }
.nav-item.active .nav-icon { color: var(--green); }
.nav-count { margin-left: auto; color: #8b9690; font-size: 11px; }
.subject-label { margin-top: 28px; }
.schedule-navigation { max-height: min(42vh, 360px); overflow-y: auto; }
.subject-group { display: grid; gap: 1px; }
.subject-filter { min-height: 38px; gap: 8px; }
.subject-filter .subject-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-item { display: flex; min-height: 31px; align-items: center; gap: 7px; padding: 3px 8px 3px 26px; border: 0; border-radius: 6px; background: transparent; color: #89938d; cursor: pointer; font-size: 10px; text-align: left; }
.schedule-item:hover { background: #f1f4ef; color: #52635a; }
.schedule-item.active { background: #edf3ee; color: var(--green-dark); font-weight: 600; }
.schedule-item .schedule-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-bottom { margin-top: auto; }
.privacy-note { display: flex; gap: 10px; padding: 13px 10px; border-top: 1px solid var(--line); color: #77827c; }
.privacy-icon { color: var(--green); font-size: 18px; }
.privacy-note p { margin: 0; font-size: 10px; line-height: 1.6; }
.privacy-note strong { color: #53625a; font-size: 10px; font-weight: 600; }

.import-button, .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 150ms ease, transform 150ms ease;
}

.import-button { width: 100%; min-height: 42px; margin-top: 9px; }
.primary-button { min-height: 40px; padding: 0 15px; }
.import-button:hover, .primary-button:hover { background: var(--green-dark); }
.primary-button:active, .import-button:active { transform: translateY(1px); }

.main-content { width: calc(100% - 252px); min-height: 100vh; margin-left: 252px; }
.topbar { display: flex; height: 67px; align-items: center; justify-content: space-between; padding: 0 6.2%; border-bottom: 1px solid #e9ece7; background: rgba(251, 252, 250, 0.75); }
.breadcrumb { color: #89938e; font-size: 11px; }
.breadcrumb span { padding: 0 8px; color: #c0c6c1; }
.breadcrumb strong { color: #46564e; font-weight: 600; }
.local-status { display: flex; align-items: center; gap: 7px; color: #849088; font-size: 10px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #61a778; }
.topbar-actions { display: flex; align-items: center; gap: 19px; }
.account-button { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid #e6ebe5; border-radius: 6px; background: #fff; color: #607066; cursor: pointer; font-size: 9px; }
.account-avatar { color: #76a783; font-size: 9px; }
.account-action { margin-left: 3px; color: #8c9790; }
.account-button:hover { border-color: #cad9cc; }

.page-content { width: min(950px, 88%); margin: 0 auto; padding: 45px 0 24px; }
.welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 9px; font-weight: 700; letter-spacing: 1.3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-family: "Manrope", sans-serif; font-size: clamp(26px, 3vw, 35px); font-weight: 700; letter-spacing: -1.5px; }
.subtitle { margin-bottom: 0; color: #7d8881; font-size: 12px; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 34px; }
.summary-card { position: relative; display: grid; min-height: 105px; grid-template-columns: 39px 1fr; grid-template-rows: 1fr 1fr; align-items: center; padding: 17px 17px 14px; border: 1px solid #e9ece7; border-radius: 9px; background: #fff; }
.summary-icon { display: grid; width: 32px; height: 32px; grid-row: span 2; place-items: center; border-radius: 8px; font-size: 15px; }
.icon-tasks { background: #edf4ee; color: #428061; }
.icon-late { background: #fbf1e8; color: #c27b41; }
.icon-done { background: #eff1fa; color: #7885bb; }
.summary-card p { margin: 0 0 1px; color: #7e8982; font-size: 10px; }
.summary-card strong { color: var(--ink); font-family: "Manrope", sans-serif; font-size: 22px; font-weight: 700; }
.summary-caption { position: absolute; right: 16px; bottom: 18px; color: #a0a9a3; font-size: 9px; }

.task-section { margin-top: 39px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-heading h2 { margin: 0 0 4px; font-family: "Manrope", sans-serif; font-size: 16px; letter-spacing: -0.3px; }
.section-heading p { margin: 0; color: #89938d; font-size: 10px; }
.task-total { color: #89938d; font-size: 10px; }
.task-list { display: grid; gap: 9px; }
.import-option { display: flex; width: fit-content; align-items: center; gap: 8px; padding: 8px 10px; margin: 0 0 12px; border: 1px solid #e8ebe6; border-radius: 6px; background: rgba(255,255,255,.7); color: #77847c; cursor: pointer; font-size: 10px; }
.import-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.option-check { display: grid; width: 14px; height: 14px; place-items: center; border: 1px solid #cbd4cc; border-radius: 3px; background: white; color: transparent; font-size: 9px; }
.import-option input:checked + .option-check { border-color: var(--green); background: var(--green); color: white; }
.import-option input:focus-visible + .option-check { outline: 2px solid #80a78c; outline-offset: 2px; }
.option-info { display: grid; width: 14px; height: 14px; place-items: center; border-radius: 50%; background: #f0f3ef; color: #829087; font-size: 9px; font-weight: 700; }

.task-card { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 76px; padding: 14px 16px; border: 1px solid #e8ebe6; border-radius: 8px; background: white; transition: border-color 150ms ease, opacity 150ms ease; }
.task-card:hover { border-color: #cbd9ce; }
.task-card.completed { opacity: 0.66; }
.task-card.completed .task-title { text-decoration: line-through; }
.task-check { width: 17px; height: 17px; margin: 0; accent-color: var(--green); cursor: pointer; }
.task-main { min-width: 0; }
.task-title { overflow: hidden; margin: 0 0 5px; color: #293a31; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; color: #87918b; font-size: 10px; }
.subject-chip { max-width: 150px; overflow: hidden; padding: 3px 7px; border-radius: 4px; background: #f1f5f0; color: #577264; text-overflow: ellipsis; white-space: nowrap; }
.task-badge { padding: 4px 7px; border-radius: 4px; background: #f4f4f1; color: #777f79; font-size: 9px; white-space: nowrap; }
.task-badge.preparation { background: #edf4ee; color: #428061; }
.task-badge.review { background: #edf1fa; color: #6b79ac; }
.task-badge.exam { background: #fbf0e9; color: #ad6935; }
.task-due { min-width: 82px; color: #68756d; font-size: 10px; text-align: right; white-space: nowrap; }
.task-due.overdue { color: #bc654b; }
.task-due small { display: block; margin-top: 4px; color: #a0a8a2; font-size: 9px; }
.task-due.overdue small { color: #bc806e; }
.goals { grid-column: 2 / -1; margin: -4px 0 2px; padding: 9px 11px; border-left: 2px solid #d5b18a; border-radius: 0 5px 5px 0; background: #fcf8f2; color: #76634f; font-size: 10px; line-height: 1.6; }
.goals strong { font-weight: 600; }
.source-note { color: #a3aaa5; font-size: 9px; }

.empty-state { display: flex; min-height: 310px; flex-direction: column; align-items: center; justify-content: center; padding: 28px; border: 1px dashed #dce3db; border-radius: 9px; background: rgba(255,255,255,.55); text-align: center; }
.empty-illustration { position: relative; display: grid; width: 66px; height: 58px; place-items: center; margin-bottom: 17px; border: 1px solid #e0e9df; border-radius: 17px; background: #f1f6ef; color: #71917a; font-size: 29px; }
.empty-illustration i { position: absolute; right: -9px; bottom: -5px; display: grid; width: 25px; height: 25px; place-items: center; border: 3px solid #f6f7f4; border-radius: 50%; background: #76a783; color: white; font-size: 12px; font-style: normal; }
.empty-state h3 { margin-bottom: 7px; font-family: "Manrope", sans-serif; font-size: 15px; }
.empty-state p { max-width: 365px; margin-bottom: 16px; color: #818d85; font-size: 11px; line-height: 1.6; }
.empty-state .primary-button { min-height: 37px; }
.supported-format { margin-top: 11px; color: #a0a9a2; font-size: 9px; }
.import-message { margin-bottom: 12px; padding: 10px 12px; border: 1px solid #d6e5d7; border-radius: 6px; background: #f1f7f1; color: #39674b; font-size: 11px; line-height: 1.5; }
.import-message.error { border-color: #eed4cc; background: #fcf2ef; color: #9d5140; }
.import-message ul { margin: 5px 0 0; padding-left: 17px; }
.page-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 36px; padding-top: 14px; border-top: 1px solid #e9ece7; color: #a0a9a3; font-size: 9px; }
.text-button { padding: 0; border: 0; background: none; color: #8e9992; cursor: pointer; font-size: 9px; }
.text-button:hover { color: #ad5949; }

@media (max-width: 800px) {
  .sidebar { width: 215px; }
  .main-content { width: calc(100% - 215px); margin-left: 215px; }
  .page-content { width: 90%; }
  .topbar { padding: 0 5%; }
  .summary-grid { gap: 8px; }
  .summary-card { padding: 13px 10px; }
  .summary-caption { display: none; }
}

@media (max-width: 620px) {
  .auth-card { padding: 28px 23px 23px; }
  .app-shell { display: block; }
  .sidebar { position: sticky; inset: 0 0 auto; width: 100%; height: auto; padding: 11px 15px; border-right: 0; border-bottom: 1px solid #e9ece7; }
  .brand { margin: 0 0 10px; font-size: 16px; }
  .brand-mark { width: 26px; height: 26px; }
  .nav-label { display: none; }
  .navigation { display: flex; gap: 4px; overflow-x: auto; }
  .schedule-navigation { display: grid; max-height: 130px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; }
  .subject-group { min-width: 0; }
  .subject-filter { min-height: 30px; }
  .schedule-item { min-height: 25px; padding-left: 13px; }
  .sidebar-bottom { display: none; }
  .nav-item { min-height: 35px; justify-content: center; gap: 6px; padding: 0 8px; font-size: 10px; }
  .nav-icon { width: auto; font-size: 14px; }
  .nav-count { margin-left: 0; }
  .main-content { width: 100%; margin: 0; }
  .topbar { height: 48px; }
  .topbar-actions { gap: 8px; }
  .local-status { font-size: 0; }
  .account-button { gap: 5px; padding: 4px 6px; }
  .account-action { display: none; }
  .page-content { width: 91%; padding-top: 29px; }
  .welcome-row { align-items: flex-start; }
  .welcome-row > .primary-button { min-height: 35px; padding: 0 10px; font-size: 10px; }
  .summary-grid { grid-template-columns: 1fr; margin-top: 24px; }
  .summary-card { min-height: 72px; grid-template-columns: 42px 1fr; grid-template-rows: 1fr; padding: 12px; }
  .summary-icon { grid-row: auto; }
  .summary-card strong { font-size: 19px; }
  .summary-card p { margin-bottom: 2px; }
  .task-section { margin-top: 28px; }
  .import-option { width: 100%; font-size: 9px; }
  .task-card { grid-template-columns: 20px minmax(0, 1fr); gap: 9px; padding: 12px; }
  .task-due { grid-column: 2; text-align: left; }
  .task-due small { display: inline; margin-left: 5px; }
  .goals { grid-column: 2; }
  .page-footer { flex-direction: column; }
}
