:root {
  --primary: #6c5ce7;
  --primary-dark: #5847d6;
  --primary-soft: #f0edff;
  --text: #242635;
  --text-secondary: #73778a;
  --text-light: #a3a6b5;
  --background: #f7f8fc;
  --surface: #ffffff;
  --border: #e9eaf1;
  --work: #6c5ce7;
  --work-soft: #efedff;
  --personal: #23a784;
  --personal-soft: #e8f8f2;
  --meeting: #e69a35;
  --meeting-soft: #fff5e6;
  --danger: #e45c66;
  --shadow: 0 12px 35px rgba(39, 36, 75, .06);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 360px; background: var(--background); color: var(--text); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(108, 92, 231, .2); outline-offset: 2px; }
button { border: 0; background: none; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Authentication */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(440px, .95fr); background: white; }
.auth-brand-panel { position: relative; display: flex; flex-direction: column; padding: 46px 58px 36px; overflow: hidden; color: white; background: radial-gradient(circle at 88% 12%, rgba(144,123,255,.34), transparent 35%), radial-gradient(circle at 5% 90%, rgba(93,190,178,.13), transparent 30%), linear-gradient(145deg, #262047, #17152e 75%); }
.auth-brand-panel::after { content: ""; position: absolute; right: -140px; bottom: 8%; width: 390px; height: 390px; border: 1px solid rgba(255,255,255,.06); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018); pointer-events: none; }
.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-brand strong { font-size: 23px; letter-spacing: 3px; }
.auth-intro { margin: auto 0 38px; position: relative; z-index: 1; }
.auth-eyebrow { color: #a99ee9; font-size: 10px; letter-spacing: 2.4px; }
.auth-intro h1 { margin: 20px 0 22px; font-size: clamp(34px, 3.5vw, 52px); line-height: 1.4; letter-spacing: 1px; font-weight: 600; }
.auth-intro p { max-width: 420px; margin: 0; color: #aaa6c3; font-size: 14px; line-height: 1.9; }
.auth-features { position: relative; z-index: 1; display: grid; gap: 15px; margin-bottom: auto; }
.auth-features span { display: flex; align-items: center; gap: 10px; color: #c4c0d9; font-size: 12px; }
.auth-features svg { width: 16px; height: 16px; padding: 3px; border-radius: 50%; color: #bcb0ff; background: rgba(139,119,235,.18); box-sizing: content-box; }
.auth-brand-footer { margin: 45px 0 0; color: #67627f; font-size: 10px; letter-spacing: 1px; }
.auth-form-panel { display: grid; place-items: center; padding: 45px; background: #fbfbfd; }
.auth-card { width: min(390px, 100%); }
.auth-card h2 { margin: 9px 0; font-size: 29px; letter-spacing: -.5px; }
.auth-subtitle { margin: 0; color: var(--text-light); font-size: 12px; }
.auth-mobile-brand { display: none; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 30px 0 24px; padding: 4px; border-radius: 11px; background: #efeff5; }
.auth-tabs button { height: 37px; border-radius: 8px; color: var(--text-light); font-size: 12px; }
.auth-tabs button.active { color: var(--primary); background: white; box-shadow: 0 2px 8px rgba(42,39,74,.07); font-weight: 600; }
.auth-field { display: block; margin-bottom: 17px; }
.auth-field span { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 11px; }
.auth-field input { width: 100%; height: 45px; padding: 0 13px; border: 1px solid var(--border); border-radius: 10px; outline: 0; color: var(--text); background: white; font-size: 12px; transition: .18s; }
.auth-field input:focus { border-color: #bdb4f3; box-shadow: 0 0 0 3px rgba(108,92,231,.08); }
.auth-field input::placeholder { color: #b9bbc7; }
.auth-submit { width: 100%; min-height: 45px; margin-top: 7px; }
.auth-submit svg { margin-left: auto; }
.auth-error { margin: 0 0 12px; padding: 9px 11px; border-radius: 8px; color: var(--danger); background: #fff0f1; font-size: 11px; line-height: 1.5; }
.auth-privacy { margin: 20px 0 0; color: var(--text-light); font-size: 10px; line-height: 1.7; text-align: center; }

.app-shell { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 20px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 7px 30px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #8272f1, #5b49dc); box-shadow: 0 7px 16px rgba(108, 92, 231, .25); }
.brand-mark svg { width: 24px; height: 24px; stroke-width: 1.6; }
.brand strong { display: block; font-size: 20px; letter-spacing: 2px; line-height: 1.3; }
.brand small { display: block; margin-top: 4px; font-size: 10px; color: var(--text-light); letter-spacing: .6px; }
.nav-label { margin: 0 12px 10px; color: var(--text-light); font-size: 11px; letter-spacing: 1.5px; }
.main-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 45px; padding: 0 12px; border-radius: 11px; color: var(--text-secondary); text-align: left; transition: .18s ease; }
.nav-item > svg { width: 19px; height: 19px; }
.nav-item > span:nth-child(2) { flex: 1; }
.nav-item:hover { color: var(--primary); background: #faf9ff; }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-count { min-width: 24px; padding: 2px 6px; text-align: center; font-size: 11px; border-radius: 6px; background: #f3f3f7; color: var(--text-light); }
.nav-item.active .nav-count { color: var(--primary); background: rgba(108, 92, 231, .09); }
.nav-item .nav-arrow { width: 15px; height: 15px; color: #b7b8c4; }
.mini-calendar-section { margin-top: 30px; padding: 0 7px; }
.mini-calendar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.mini-calendar-head strong { font-size: 13px; font-weight: 600; }
.mini-calendar-head > div { display: flex; }
.mini-weekdays, .mini-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.mini-weekdays { margin-bottom: 6px; color: var(--text-light); font-size: 10px; }
.mini-day { position: relative; height: 27px; padding: 0; border-radius: 8px; color: #666a7c; font-size: 11px; }
.mini-day:hover { background: var(--primary-soft); color: var(--primary); }
.mini-day.outside { color: #c6c7d0; }
.mini-day.selected { background: var(--primary); color: white; font-weight: 600; }
.mini-day.today:not(.selected) { color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.mini-day.has-tasks::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 3px; height: 3px; border-radius: 50%; background: var(--primary); transform: translateX(-50%); }
.mini-day.selected.has-tasks::after { background: white; }
.category-section { margin-top: 29px; }
.section-title { display: flex; justify-content: space-between; margin: 0 12px 10px; color: var(--text-light); font-size: 11px; letter-spacing: 1px; }
.section-title .subtle { font-size: 10px; letter-spacing: 0; color: #c0c1cb; }
.category-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 37px; padding: 0 12px; border-radius: 9px; color: var(--text-secondary); font-size: 12px; text-align: left; }
.category-item > span:nth-child(2) { flex: 1; }
.category-item > span:last-child { color: var(--text-light); font-size: 11px; }
.category-item:hover, .category-item.active { background: #f8f8fb; color: var(--text); }
.category-item.active { font-weight: 600; }
.category-dot, .legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.category-dot.all { background: linear-gradient(135deg, var(--work) 0 50%, var(--personal) 50%); }
.category-dot.work, .legend-dot.work { background: var(--work); }
.category-dot.personal, .legend-dot.personal { background: var(--personal); }
.category-dot.meeting, .legend-dot.meeting { background: var(--meeting); }
.week-progress-card { margin: auto 3px 0; padding: 16px; border: 1px solid #ece9ff; border-radius: 14px; background: linear-gradient(135deg, #faf9ff, #f5f3ff); }
.progress-card-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.progress-card-head strong { color: var(--primary); font-size: 13px; }
.progress-track { height: 5px; margin: 12px 0 9px; border-radius: 5px; background: #e5e1f8; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8c7df1, var(--primary)); transition: width .4s ease; }
.week-progress-card p { margin: 0; color: var(--text-light); font-size: 10px; }
.sidebar-footer { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 18px; color: #b0b2bd; font-size: 10px; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #52b99a; }

.main-content { min-width: 0; padding: 0 32px 35px; }
.topbar { min-height: 116px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.page-heading p { margin: 0 0 7px; color: var(--text-light); font-size: 12px; }
.page-heading h1 { margin: 0; font-size: 27px; line-height: 1.2; letter-spacing: -.6px; }
.topbar-actions { display: flex; align-items: center; gap: 11px; }
.search-box { width: 218px; height: 41px; display: flex; align-items: center; gap: 9px; padding: 0 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; color: var(--text-light); transition: .2s; }
.search-box:focus-within { border-color: #bdb4f3; box-shadow: 0 0 0 3px rgba(108, 92, 231, .08); }
.search-box svg { width: 17px; height: 17px; }
.search-box input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #b3b5c1; }
.search-box kbd { min-width: 19px; height: 20px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 5px; color: #b5b6c0; background: #fafafd; font: 11px inherit; }
.icon-button { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-secondary); transition: .18s ease; flex: 0 0 auto; }
.icon-button:hover { border-color: #d9d5ef; background: var(--primary-soft); color: var(--primary); }
.icon-button svg { width: 17px; height: 17px; }
.icon-button.small { width: 24px; height: 24px; border: 0; background: transparent; }
.icon-button.small svg { width: 13px; height: 13px; }
.icon-button.soft { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.notification-button { position: relative; width: 41px; height: 41px; }
.notification-button span { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border: 1.5px solid white; border-radius: 50%; background: var(--danger); }
.notification-button.enabled span { background: var(--personal); }
.primary-button, .secondary-button, .danger-button, .danger-solid-button { min-height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 17px; border-radius: 11px; font-size: 13px; font-weight: 500; transition: .18s ease; }
.primary-button { color: white; background: var(--primary); box-shadow: 0 5px 13px rgba(108, 92, 231, .18); }
.primary-button:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 7px 17px rgba(108, 92, 231, .25); }
.primary-button svg, .secondary-button svg { width: 17px; height: 17px; }
.secondary-button { border: 1px solid var(--border); background: white; color: var(--text-secondary); box-shadow: none; }
.secondary-button:hover { border-color: #d5d0ef; color: var(--primary); background: #faf9ff; }
.danger-button { padding-left: 0; color: var(--danger); }
.danger-button:hover { color: #c9424e; }
.danger-button svg { width: 16px; height: 16px; }
.danger-solid-button { color: white; background: var(--danger); }
.danger-solid-button:hover { background: #cd4853; }

.view-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; }
.period-control { display: flex; align-items: center; gap: 19px; }
.period-control h2, .view-toolbar > div > h2 { min-width: 135px; margin: 0; font-size: 19px; letter-spacing: -.3px; }
.period-buttons { display: flex; align-items: center; gap: 4px; }
.today-button { height: 32px; padding: 0 10px; border-radius: 8px; color: var(--text-secondary); font-size: 12px; }
.today-button:hover { color: var(--primary); background: var(--primary-soft); }
.toolbar-right { display: flex; align-items: center; gap: 11px; }
.status-filter { height: 36px; padding: 0 29px 0 12px; border: 1px solid var(--border); border-radius: 9px; color: var(--text-secondary); background: var(--surface); font-size: 12px; outline: none; cursor: pointer; }
.status-filter:focus { border-color: #bdb4f3; }
.view-switch { display: flex; padding: 3px; background: #eeeff5; border-radius: 10px; }
.view-switch button { width: 32px; height: 29px; display: grid; place-items: center; border-radius: 7px; color: #9699a9; }
.view-switch button svg { width: 16px; height: 16px; }
.view-switch button.active { color: var(--primary); background: white; box-shadow: 0 2px 5px rgba(44, 43, 73, .07); }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 282px; gap: 20px; align-items: start; }
.calendar-card, .agenda-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.calendar-card { min-width: 0; overflow: hidden; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); height: 49px; align-items: center; border-bottom: 1px solid var(--border); color: var(--text-secondary); font-size: 11px; text-align: center; }
.calendar-weekdays .weekend { color: #aaaebe; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-day { position: relative; min-width: 0; min-height: 105px; padding: 9px 7px 7px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; overflow: hidden; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:nth-last-child(-n+7) { border-bottom: 0; }
.calendar-day:hover { background: #fbfaff; }
.calendar-day.outside { background: #fcfcfe; }
.calendar-day.outside .day-number { color: #c7c8d2; }
.calendar-day.selected { background: #faf9ff; box-shadow: inset 0 0 0 1.5px rgba(108, 92, 231, .3); }
.day-number { width: 24px; height: 24px; display: grid; place-items: center; margin-bottom: 5px; border-radius: 8px; color: #666a7c; font-size: 11px; }
.calendar-day.today .day-number { color: white; background: var(--primary); font-weight: 600; box-shadow: 0 3px 7px rgba(108, 92, 231, .22); }
.calendar-event { width: 100%; display: flex; align-items: center; gap: 4px; margin: 0 0 4px; padding: 4px 5px; border-radius: 5px; color: var(--work); background: var(--work-soft); font-size: 9px; line-height: 1.25; text-align: left; overflow: hidden; }
.calendar-event.personal { color: #178767; background: var(--personal-soft); }
.calendar-event.meeting { color: #bd7821; background: var(--meeting-soft); }
.calendar-event.completed { opacity: .45; }
.calendar-event.completed .event-title { text-decoration: line-through; }
.calendar-event .event-time { flex: 0 0 auto; font-size: 8px; opacity: .8; }
.calendar-event .event-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-events { display: block; padding: 1px 4px; color: var(--text-light); font-size: 9px; }
.calendar-legend { min-height: 45px; display: flex; align-items: center; gap: 16px; padding: 0 16px; border-top: 1px solid var(--border); color: var(--text-light); font-size: 10px; }
.calendar-legend > span { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 5px; height: 5px; }
.calendar-legend .legend-tip { margin-left: auto; color: #b8bac5; }
.agenda-panel { padding: 20px 18px 14px; }
.agenda-head { display: flex; justify-content: space-between; align-items: center; }
.agenda-head p { margin: 0 0 5px; color: var(--text-light); font-size: 10px; letter-spacing: 1px; }
.agenda-head h3 { margin: 0; font-size: 16px; }
.agenda-summary { margin: 16px 0 9px; padding: 10px 12px; border-radius: 9px; background: #f8f8fb; color: var(--text-secondary); font-size: 11px; }
.agenda-summary strong { color: var(--primary); }
.agenda-list { min-height: 280px; }
.agenda-item { position: relative; display: grid; grid-template-columns: 38px 9px minmax(0, 1fr); gap: 8px; padding: 12px 0; cursor: pointer; }
.agenda-item:not(:last-child)::after { content: ""; position: absolute; left: 58px; bottom: 0; right: 0; height: 1px; background: #f0f0f5; }
.agenda-time { padding-top: 2px; color: var(--text-light); font-size: 10px; line-height: 1.5; }
.agenda-time.all-day { font-size: 9px; }
.agenda-line { position: relative; display: flex; justify-content: center; }
.agenda-line::before { content: ""; position: absolute; top: 7px; bottom: -18px; width: 1px; background: #efedf8; }
.agenda-item:last-child .agenda-line::before { bottom: 5px; }
.agenda-line i { position: relative; z-index: 1; width: 7px; height: 7px; margin-top: 5px; border: 2px solid white; border-radius: 50%; background: var(--work); box-shadow: 0 0 0 1px var(--work); box-sizing: content-box; }
.agenda-item.personal .agenda-line i { background: var(--personal); box-shadow: 0 0 0 1px var(--personal); }
.agenda-item.meeting .agenda-line i { background: var(--meeting); box-shadow: 0 0 0 1px var(--meeting); }
.agenda-content { min-width: 0; }
.agenda-content strong { display: block; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; }
.agenda-content span { display: flex; align-items: center; gap: 4px; color: var(--text-light); font-size: 9px; }
.agenda-content span svg { width: 11px; height: 11px; }
.agenda-item.completed .agenda-content { opacity: .45; }
.agenda-item.completed .agenda-content strong { text-decoration: line-through; }
.text-button { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: 11px; }
.text-button svg { width: 13px; height: 13px; }
.agenda-all { width: 100%; justify-content: center; padding: 11px 0 0; border-top: 1px solid var(--border); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 230px; padding: 24px 12px; text-align: center; color: var(--text-light); }
.empty-state-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 16px; color: #a99eef; background: var(--primary-soft); }
.empty-state-icon svg { width: 24px; height: 24px; }
.empty-state strong { margin-bottom: 6px; color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.empty-state p { max-width: 260px; margin: 0; font-size: 11px; line-height: 1.7; }
.empty-state .text-button { margin-top: 14px; }

.list-view .view-toolbar { min-height: 48px; }
.view-description { margin: 6px 0 0; color: var(--text-light); font-size: 11px; }
.list-filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 17px; }
.date-chip { padding: 7px 13px; border: 1px solid var(--border); border-radius: 9px; color: var(--text-secondary); background: white; font-size: 11px; }
.date-chip:hover, .date-chip.active { color: var(--primary); border-color: #dcd6fb; background: var(--primary-soft); }
#listResultCount { margin-left: auto; color: var(--text-light); font-size: 11px; }
.task-list-container { display: grid; gap: 17px; }
.task-group { overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: white; box-shadow: 0 6px 22px rgba(39, 36, 75, .035); }
.task-group-head { display: flex; align-items: center; justify-content: space-between; min-height: 47px; padding: 0 20px; border-bottom: 1px solid var(--border); background: #fdfdfe; }
.task-group-head h3 { margin: 0; font-size: 13px; font-weight: 600; }
.task-group-head h3 span { margin-left: 8px; color: var(--text-light); font-size: 10px; font-weight: 400; }
.task-group-head > span { color: var(--text-light); font-size: 10px; }
.task-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 120px 90px 32px; align-items: center; gap: 13px; min-height: 70px; padding: 10px 18px; transition: background .15s; }
.task-row:not(:last-child) { border-bottom: 1px solid #f0f0f5; }
.task-row:hover { background: #fcfbff; }
.task-check { width: 18px; height: 18px; display: grid; place-items: center; padding: 0; border: 1.5px solid #d5d6e0; border-radius: 6px; color: white; }
.task-check svg { width: 12px; height: 12px; opacity: 0; }
.task-check:hover { border-color: var(--primary); background: var(--primary-soft); }
.task-check.checked { border-color: var(--primary); background: var(--primary); }
.task-check.checked svg { opacity: 1; }
.task-main { min-width: 0; cursor: pointer; }
.task-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.task-main p { display: flex; align-items: center; gap: 5px; margin: 6px 0 0; color: var(--text-light); font-size: 10px; }
.task-main p svg { width: 12px; height: 12px; }
.task-row.completed .task-main { opacity: .45; }
.task-row.completed .task-main strong { text-decoration: line-through; }
.task-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.category-badge, .priority-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px; color: var(--work); background: var(--work-soft); font-size: 9px; white-space: nowrap; }
.category-badge.personal { color: #178767; background: var(--personal-soft); }
.category-badge.meeting { color: #b97927; background: var(--meeting-soft); }
.priority-badge { padding: 0; color: var(--text-light); background: transparent; }
.priority-badge.urgent { color: var(--danger); }
.priority-badge.important { color: var(--meeting); }
.task-time { color: var(--text-secondary); font-size: 10px; line-height: 1.6; }
.task-time.overdue { color: var(--danger); }
.edit-task { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: var(--text-light); }
.edit-task:hover { color: var(--primary); background: var(--primary-soft); }
.edit-task svg { width: 15px; height: 15px; }
.list-empty { min-height: 350px; border: 1px solid var(--border); border-radius: 15px; background: white; }

/* Dialogs */
dialog { color: var(--text); border: 1px solid rgba(255,255,255,.5); padding: 0; background: white; box-shadow: 0 30px 90px rgba(31, 28, 62, .22); }
dialog::backdrop { background: rgba(31, 31, 47, .38); backdrop-filter: blur(4px); }
dialog[open] { animation: dialog-in .22s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.task-dialog { width: min(590px, calc(100vw - 32px)); max-height: calc(100vh - 40px); border-radius: 21px; overflow-y: auto; }
.task-dialog form { padding: 26px 28px 23px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-eyebrow { display: block; margin-bottom: 5px; color: #a39bd4; font-size: 9px; font-weight: 600; letter-spacing: 1.8px; }
.dialog-head h2 { margin: 0; font-size: 21px; letter-spacing: -.3px; }
.title-input-wrap { display: block; margin: 23px 0 20px; }
.title-input-wrap input { width: 100%; padding: 0 0 13px; border: 0; border-bottom: 1px solid var(--border); outline: 0; color: var(--text); background: transparent; font-size: 20px; font-weight: 500; }
.title-input-wrap input::placeholder { color: #c2c3cc; font-weight: 400; }
.title-input-wrap input:focus { border-bottom-color: var(--primary); }
.form-section { padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: #fbfbfd; }
.form-row { display: flex; align-items: flex-end; gap: 12px; }
.form-row label { min-width: 0; flex: 1; }
.form-row label > span, .form-grid label > span, .notes-field > span { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 11px; }
.form-row input, .form-grid select { width: 100%; height: 38px; padding: 0 9px; border: 1px solid var(--border); border-radius: 8px; outline: 0; color: var(--text); background: white; font-size: 11px; }
.form-row input:focus, .form-grid select:focus, .notes-field textarea:focus { border-color: #bdb4f3; box-shadow: 0 0 0 3px rgba(108, 92, 231, .06); }
.time-separator { height: 38px; display: grid; place-items: center; color: #b9bac4; }
.time-separator svg { width: 13px; height: 13px; }
.field-error { margin: 8px 0 0; color: var(--danger); font-size: 10px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--text-secondary); font-size: 11px; cursor: pointer; }
.toggle-row > span { display: flex; align-items: center; gap: 6px; }
.toggle-row svg { width: 13px; height: 13px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-control { position: relative; width: 32px; height: 18px; border-radius: 10px; background: #dbdce4; transition: .2s; }
.toggle-control::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: .2s; }
.toggle-row input:checked + .toggle-control { background: var(--primary); }
.toggle-row input:checked + .toggle-control::after { transform: translateX(14px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 18px; }
.priority-field { padding: 0; margin: 18px 0; border: 0; }
.priority-field legend { margin-bottom: 9px; color: var(--text-secondary); font-size: 11px; }
.priority-options { display: flex; gap: 8px; }
.priority-options label { cursor: pointer; }
.priority-options input { position: absolute; opacity: 0; }
.priority-options span { min-width: 74px; height: 33px; display: flex; justify-content: center; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-secondary); font-size: 11px; transition: .15s; }
.priority-options input:checked + span { color: var(--primary); border-color: #cfc7f8; background: var(--primary-soft); }
.priority-dot { width: 5px; height: 5px; border-radius: 50%; }
.priority-dot.important { background: var(--meeting); }
.priority-dot.urgent { background: var(--danger); }
.notes-field { display: block; }
.notes-field small { color: var(--text-light); font-size: 9px; }
.notes-field textarea { width: 100%; padding: 11px; resize: vertical; border: 1px solid var(--border); border-radius: 9px; outline: 0; color: var(--text); background: #fbfbfd; font-size: 11px; line-height: 1.6; }
.notes-field textarea::placeholder { color: #b9bbc6; }
.attachments-field { margin-top: 18px; }
.attachments-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; color: var(--text-secondary); font-size: 11px; }
.attachments-label small { color: var(--text-light); font-size: 9px; font-weight: 400; }
.attachment-dropzone { min-height: 76px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; border: 1.5px dashed #d9d5eb; border-radius: 11px; color: var(--text-secondary); background: #fbfaff; cursor: pointer; transition: .18s ease; }
.attachment-dropzone:hover, .attachment-dropzone.dragging { border-color: var(--primary); background: var(--primary-soft); }
.attachment-dropzone.dragging { box-shadow: inset 0 0 0 2px rgba(108, 92, 231, .08); }
.upload-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: white; box-shadow: 0 3px 10px rgba(72, 60, 145, .08); }
.upload-icon svg { width: 17px; height: 17px; }
.attachment-dropzone strong { display: block; font-size: 11px; font-weight: 500; }
.attachment-dropzone p { margin: 5px 0 0; color: var(--text-light); font-size: 9px; line-height: 1.5; }
.attachment-list { display: grid; gap: 8px; margin-top: 10px; }
.attachment-list:empty { display: none; }
.attachment-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) 30px 30px; align-items: center; gap: 9px; min-height: 56px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 10px; background: white; }
.attachment-thumb { width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; color: var(--primary); background: var(--primary-soft); }
.attachment-thumb svg { width: 19px; height: 19px; }
.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment-info { min-width: 0; }
.attachment-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 500; }
.attachment-info span { display: block; margin-top: 5px; color: var(--text-light); font-size: 9px; }
.attachment-action { width: 29px; height: 29px; display: grid; place-items: center; padding: 0; border-radius: 7px; color: var(--text-light); }
.attachment-action:hover { color: var(--primary); background: var(--primary-soft); }
.attachment-action.remove:hover { color: var(--danger); background: #fff0f1; }
.attachment-action svg { width: 14px; height: 14px; }
.attachment-action.download svg { transform: rotate(90deg); }
.primary-button:disabled { opacity: .6; cursor: wait; transform: none; }
.dialog-footer { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.footer-spacer { flex: 1; }

.weekly-dialog { width: min(990px, calc(100vw - 36px)); max-height: calc(100vh - 42px); padding: 28px; border-radius: 22px; overflow-y: auto; }
.weekly-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 25px 0 20px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: #fbfbfd; }
.weekly-toolbar > div { display: flex; gap: 8px; }
.week-navigator { align-items: center; }
.week-navigator > div { min-width: 225px; text-align: center; }
.week-navigator strong { display: block; font-size: 15px; }
.week-navigator span { display: block; margin-top: 5px; color: var(--text-light); font-size: 12px; }
.weekly-toolbar .secondary-button { min-height: 37px; padding: 0 13px; font-size: 12px; }
.weekly-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { padding: 17px; border: 1px solid var(--border); border-radius: 12px; background: white; }
.stat-card span { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 12px; }
.stat-card strong { font-size: 27px; font-weight: 600; }
.stat-card strong small { margin-left: 4px; color: var(--text-light); font-size: 12px; font-weight: 400; }
.stat-card.highlight { border-color: #e6e0ff; background: var(--primary-soft); }
.stat-card.highlight strong { color: var(--primary); }
.weekly-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.weekly-column { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 14px; }
.weekly-column.next { background: #fcfdfc; border-color: #e4f0eb; }
.weekly-column-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.weekly-column-head > div { display: flex; align-items: center; gap: 9px; }
.weekly-column-head h3 { margin: 0; font-size: 16px; }
.weekly-column-head > span { color: var(--text-light); font-size: 12px; }
.weekly-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; }
.weekly-icon svg { width: 16px; height: 16px; }
.weekly-icon.lavender { color: var(--primary); background: var(--primary-soft); }
.weekly-icon.green { color: var(--personal); background: var(--personal-soft); }
.weekly-task-list { max-height: 420px; overflow-y: auto; }
.weekly-task { display: flex; align-items: flex-start; gap: 11px; padding: 14px 0; }
.weekly-task:not(:last-child) { border-bottom: 1px solid #f0f0f4; }
.weekly-task > i { width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: var(--work); flex: 0 0 auto; }
.weekly-task > i.personal { background: var(--personal); }
.weekly-task > i.meeting { background: var(--meeting); }
.weekly-task-content { min-width: 0; flex: 1; }
.weekly-task-content strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.55; overflow-wrap: anywhere; }
.weekly-task-content span { display: block; margin-top: 6px; color: var(--text-light); font-size: 11px; line-height: 1.5; }
.weekly-task-notes { margin: 9px 0 0; padding: 9px 11px; border-radius: 8px; color: #65697b; background: #f6f6fa; font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.weekly-column.next .weekly-task-notes { background: #f0f7f3; }
.weekly-task.completed .weekly-task-content strong { color: var(--text-light); text-decoration: line-through; }
.weekly-empty { padding: 45px 10px; color: var(--text-light); text-align: center; font-size: 12px; }
.carry-over-label { margin: 15px 0 3px; color: var(--personal); font-size: 12px; font-weight: 600; }
.weekly-tip { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 20px; color: var(--text-light); font-size: 11px; }
.weekly-tip svg { width: 14px; height: 14px; color: #a99eef; }
.confirm-dialog { width: min(370px, calc(100vw - 32px)); padding: 29px; border-radius: 18px; text-align: center; }
.confirm-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 14px; color: var(--danger); background: #fff0f1; }
.confirm-dialog h3 { margin: 0 0 9px; font-size: 17px; }
.confirm-dialog p { margin: 0; color: var(--text-light); font-size: 11px; }
.confirm-dialog > div { display: flex; justify-content: center; gap: 10px; margin-top: 23px; }
.toast-container { position: fixed; top: 24px; left: 50%; z-index: 1000; display: grid; gap: 10px; transform: translateX(-50%); pointer-events: none; }
.toast { min-width: 260px; max-width: min(420px, calc(100vw - 30px)); display: flex; align-items: center; gap: 10px; padding: 13px 17px; border: 1px solid #e6e4f0; border-radius: 12px; color: var(--text); background: rgba(255,255,255,.97); box-shadow: 0 12px 35px rgba(35,31,70,.16); font-size: 12px; animation: toast-in .25s ease-out; }
.toast > span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--personal); }
.toast > span svg { width: 13px; height: 13px; }
.toast.reminder > span { background: var(--primary); }
.toast.error > span { background: var(--danger); }
.toast.leaving { opacity: 0; transform: translateY(-8px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
/* Accounts, AI, recurrence and drag */
.account-button { height: 41px; display: flex; align-items: center; gap: 7px; padding: 0 10px 0 6px; border: 1px solid var(--border); border-radius: 11px; color: var(--text-secondary); background: white; font-size: 11px; }
.account-button:hover { border-color: #d9d5ef; background: #faf9ff; }
.account-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 600; }
.account-button small { color: var(--text-light); font-size: 9px; }
#currentUsername { max-width: 86px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-assistant { margin-top: 20px; padding: 14px; border: 1px solid #e4dffc; border-radius: 12px; background: linear-gradient(135deg, #faf8ff, #f5f3ff); }
.ai-assistant-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.ai-assistant-title > span { display: flex; align-items: center; gap: 6px; color: var(--primary); font-size: 12px; font-weight: 600; }
.ai-assistant-title svg { width: 15px; height: 15px; }
.ai-assistant-title small { color: #9c94bd; font-size: 9px; }
.ai-input-row { display: flex; align-items: stretch; gap: 8px; }
.ai-input-row textarea { min-width: 0; flex: 1; padding: 9px 10px; resize: none; border: 1px solid #e3def2; border-radius: 9px; outline: 0; color: var(--text); background: rgba(255,255,255,.85); font-size: 11px; line-height: 1.6; }
.ai-input-row textarea:focus { border-color: #bdb4f3; }
.ai-parse-button { min-width: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 9px; color: white; background: var(--primary); font-size: 10px; }
.ai-parse-button:hover { background: var(--primary-dark); }
.ai-parse-button:disabled { opacity: .55; cursor: wait; }
.ai-parse-button svg { width: 15px; height: 15px; }
.ai-assistant > p { margin: 8px 0 0; color: #9c94bd; font-size: 9px; }
.recurrence-fields { padding: 15px 0 0; }
.recurrence-fields .form-grid { margin-top: 0; }
.recurrence-fields input { width: 100%; height: 38px; padding: 0 9px; border: 1px solid var(--border); border-radius: 8px; outline: 0; color: var(--text); background: white; font-size: 11px; }
.recurrence-fields label small { color: var(--text-light); font-size: 9px; }
.recurrence-fields > p, .series-hint { margin: 8px 0 0; color: var(--text-light); font-size: 9px; line-height: 1.6; }
.series-hint { margin-top: 14px; padding: 9px 11px; border-radius: 8px; color: #8074bd; background: var(--primary-soft); }
.calendar-event { cursor: grab; }
.calendar-event:active { cursor: grabbing; }
.calendar-event.dragging { opacity: .35; }
.calendar-day.drag-over { background: #f0edff; box-shadow: inset 0 0 0 2px rgba(108,92,231,.35); }
.repeat-badge { display: inline-flex; align-items: center; padding: 3px 6px; border-radius: 5px; color: #8074bd; background: #f3f0ff; font-size: 9px; white-space: nowrap; }
.mobile-nav { display: none; }

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { min-height: 100vh; padding: 32px 22px; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 35px; }
  .auth-mobile-brand strong { font-size: 21px; letter-spacing: 2px; }
}
@media (max-width: 650px) {
  .account-button { width: 38px; height: 38px; padding: 0; justify-content: center; border: 0; }
  .account-button #currentUsername, .account-button small { display: none; }
  .account-avatar { width: 30px; height: 30px; }
  .ai-assistant-title small { display: none; }
  .ai-input-row textarea { font-size: 10px; }
  .topbar-actions { flex-wrap: wrap; }
}

@media (min-width: 1500px) {
  .app-shell { grid-template-columns: 255px minmax(0, 1fr); }
  .main-content { padding: 0 42px 40px; }
  .calendar-layout { grid-template-columns: minmax(0, 1fr) 305px; gap: 24px; }
  .calendar-day { min-height: 118px; padding: 10px; }
  .calendar-event { padding: 5px 6px; font-size: 10px; }
  .agenda-panel { padding: 23px; }
}
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 218px minmax(0, 1fr); }
  .sidebar { padding-left: 15px; padding-right: 15px; }
  .main-content { padding-left: 24px; padding-right: 24px; }
  .calendar-layout { grid-template-columns: 1fr; }
  .agenda-panel { display: none; }
  .calendar-day { min-height: 105px; }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 0 22px 100px; }
  .mobile-nav { position: fixed; left: 50%; bottom: 15px; z-index: 20; width: min(410px, calc(100vw - 30px)); height: 65px; display: flex; justify-content: space-around; align-items: center; padding: 0 12px; border: 1px solid rgba(232,232,240,.9); border-radius: 20px; background: rgba(255,255,255,.95); box-shadow: 0 10px 35px rgba(32,30,61,.15); backdrop-filter: blur(12px); transform: translateX(-50%); }
  .mobile-nav button { min-width: 48px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-light); font-size: 9px; }
  .mobile-nav button svg { width: 19px; height: 19px; }
  .mobile-nav button.active { color: var(--primary); }
  .mobile-nav .mobile-add { width: 44px; min-width: 44px; height: 44px; margin-top: -24px; display: grid; place-items: center; border-radius: 14px; color: white; background: var(--primary); box-shadow: 0 7px 17px rgba(108,92,231,.3); }
  .mobile-nav .mobile-add svg { width: 22px; height: 22px; }
}
@media (max-width: 650px) {
  .main-content { padding-left: 14px; padding-right: 14px; }
  .topbar { min-height: 96px; }
  .page-heading p { font-size: 10px; }
  .page-heading h1 { font-size: 23px; }
  .search-box { display: none; }
  .topbar-actions { gap: 8px; }
  .notification-button { width: 38px; height: 38px; }
  .topbar .primary-button { width: 38px; min-height: 38px; padding: 0; border-radius: 11px; }
  .topbar .primary-button span { display: none; }
  .view-toolbar { align-items: flex-start; flex-wrap: wrap; gap: 13px; }
  .period-control { width: 100%; justify-content: space-between; }
  .toolbar-right { width: 100%; justify-content: space-between; }
  .calendar-card { overflow-x: auto; border-radius: 14px; }
  .calendar-weekdays, .calendar-grid, .calendar-legend { min-width: 650px; }
  .calendar-day { min-height: 95px; }
  .calendar-legend .legend-tip { display: none; }
  .list-filter-bar { overflow-x: auto; padding-bottom: 3px; }
  .date-chip { white-space: nowrap; }
  #listResultCount { display: none; }
  .task-row { grid-template-columns: 22px minmax(0, 1fr) 28px; gap: 10px; padding: 12px 14px; }
  .task-meta, .task-time { display: none; }
  .task-group-head { padding: 0 15px; }
  .task-dialog form { padding: 22px 18px; }
  .form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .time-separator { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .dialog-footer { flex-wrap: wrap; }
  .dialog-footer .secondary-button, .dialog-footer .primary-button { padding: 0 12px; }
  .weekly-dialog { padding: 22px 16px; }
  .weekly-toolbar { align-items: stretch; flex-direction: column; }
  .weekly-toolbar > div:last-child { justify-content: flex-end; }
  .week-navigator { justify-content: space-between; }
  .week-navigator > div { min-width: 0; }
  .weekly-stats { grid-template-columns: 1fr 1fr; }
  .weekly-columns { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
