:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --sidebar: #111827;
  --sidebar-soft: #1f2937;
  --text: #172033;
  --muted: #6b7280;
  --line: #e5e9f0;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #16a34a;
  --success-soft: #ecfdf3;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 5%);
  --shadow-lg: 0 22px 55px rgb(15 23 42 / 18%);
  --radius: 16px;
  --sidebar-width: 272px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-shell { min-height: 100vh; }

.session-loader { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 7px; color: #667085; background: radial-gradient(circle at 50% 35%, #eef2ff 0, transparent 30%), var(--bg); }
.session-loader-mark { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 7px; border-radius: 17px; color: #fff; background: linear-gradient(135deg, #6366f1, #4338ca); box-shadow: 0 15px 35px rgb(79 70 229 / 24%); animation: loader-pulse 1.25s ease-in-out infinite alternate; }
.session-loader-mark svg { width: 31px; height: 31px; stroke-width: 2.6; }
.session-loader strong { color: #172033; font-size: 17px; }
.session-loader span { font-size: 12px; }
@keyframes loader-pulse { to { transform: translateY(-3px); box-shadow: 0 19px 42px rgb(79 70 229 / 29%); } }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, 1.05fr) minmax(440px, .95fr); background: #fff; }
.auth-visual { position: relative; min-height: 100vh; display: grid; place-items: center; overflow: hidden; padding: 64px; color: #fff; background: radial-gradient(circle at 16% 16%, rgb(129 140 248 / 44%), transparent 34%), radial-gradient(circle at 90% 88%, rgb(99 102 241 / 33%), transparent 34%), #111827; }
.auth-visual::after { content: ""; position: absolute; inset: 0; opacity: .11; background-image: linear-gradient(rgb(255 255 255 / 15%) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 15%) 1px, transparent 1px); background-size: 54px 54px; mask-image: linear-gradient(to bottom right, #000, transparent 76%); }
.auth-visual-copy { position: relative; z-index: 2; width: min(510px, 100%); }
.auth-logo { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 54px; border: 1px solid rgb(255 255 255 / 18%); border-radius: 18px; background: rgb(255 255 255 / 10%); box-shadow: 0 18px 45px rgb(0 0 0 / 22%); backdrop-filter: blur(10px); }
.auth-logo svg { width: 32px; height: 32px; stroke-width: 2.6; }
.auth-visual-copy > p { margin: 0 0 16px; color: #a5b4fc; font-size: 12px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.auth-visual-copy h1 { margin: 0; font-size: clamp(42px, 5vw, 68px); line-height: 1.02; letter-spacing: -.055em; }
.auth-visual-copy > span { display: block; max-width: 430px; margin-top: 26px; color: #aeb8c8; font-size: 17px; line-height: 1.65; }
.auth-orbit { position: absolute; border: 1px solid rgb(165 180 252 / 18%); border-radius: 50%; }
.orbit-one { width: 520px; height: 520px; top: -260px; right: -170px; }
.orbit-two { width: 360px; height: 360px; right: 11%; bottom: -220px; box-shadow: 0 0 0 60px rgb(99 102 241 / 3%), 0 0 0 120px rgb(99 102 241 / 2%); }
.auth-panel { min-height: 100vh; display: grid; place-items: center; padding: 48px; background: radial-gradient(circle at 100% 0, #eef2ff, transparent 32%), #fff; }
.auth-card { width: min(420px, 100%); }
.auth-card-heading { margin-bottom: 32px; }
.auth-kicker { display: inline-flex; padding: 6px 9px; border-radius: 8px; color: #4f46e5; background: #eef2ff; font-size: 11px; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.auth-card h2 { margin: 17px 0 8px; color: #101828; font-size: 34px; line-height: 1.12; letter-spacing: -.04em; }
.auth-card-heading p { margin: 0; color: #667085; font-size: 14px; line-height: 1.55; }
.auth-field { display: grid; gap: 8px; margin-bottom: 17px; }
.auth-field > span { color: #344054; font-size: 12px; font-weight: 780; }
.auth-input-wrap { height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid #d0d5dd; border-radius: 12px; background: #fff; transition: border-color 120ms ease, box-shadow 120ms ease; }
.auth-input-wrap:focus-within { border-color: #818cf8; box-shadow: 0 0 0 4px rgb(99 102 241 / 10%); }
.auth-input-wrap svg { width: 19px; height: 19px; flex: none; color: #98a2b3; }
.auth-input-wrap input { width: 100%; height: 100%; padding: 0; border: 0; outline: 0; color: #101828; background: transparent; font-size: 15px; }
.auth-error { min-height: 18px; margin: -2px 0 12px; color: var(--danger); font-size: 12px; font-weight: 650; }
.auth-submit { width: 100%; min-height: 50px; justify-content: space-between; padding: 0 17px 0 20px; border-radius: 12px; font-size: 15px; }
.auth-submit:disabled { opacity: .7; transform: none; }
.auth-submit.is-loading svg { animation: auth-arrow 700ms ease-in-out infinite alternate; }
@keyframes auth-arrow { to { transform: translateX(4px); } }
.auth-security-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 18px 0 0; color: #98a2b3; text-align: center; font-size: 10px; line-height: 1.4; }
.auth-security-note svg { width: 15px; height: 15px; flex: none; color: #667085; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar-width);
  display: flex; flex-direction: column; padding: 24px 18px 18px; color: #d1d5db;
  background: radial-gradient(circle at 0 0, rgb(79 70 229 / 22%), transparent 34%), var(--sidebar);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #6366f1, #4338ca); box-shadow: 0 8px 20px rgb(79 70 229 / 34%); }
.brand-mark svg { width: 24px; height: 24px; stroke-width: 2.6; }
.brand strong { display: block; color: #fff; font-size: 16px; letter-spacing: -.015em; }
.brand span { display: block; margin-top: 2px; color: #8d97a8; font-size: 12px; }
.sidebar-close { display: none !important; margin-left: auto; }

.primary-button, .secondary-button, .text-button, .icon-button { border: 0; transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease; }
.primary-button, .secondary-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border-radius: 11px; font-weight: 700; font-size: 14px; }
.primary-button { color: #fff; background: var(--primary); box-shadow: 0 8px 18px rgb(79 70 229 / 19%); }
.primary-button:hover { background: var(--primary-hover); transform: translateY(-1px); }
.secondary-button { color: #344054; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.secondary-button:hover { border-color: #c8d0dd; background: var(--surface-soft); }
.primary-button svg, .secondary-button svg { width: 18px; height: 18px; }
.sidebar-add { width: 100%; margin: 28px 0 24px; box-shadow: none; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border-radius: 10px; background: transparent; }
.icon-button:hover { background: rgb(148 163 184 / 14%); }

.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; scrollbar-color: #374151 transparent; }
.nav-label { margin: 17px 10px 8px; color: #778195; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nav-heading-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.mini-icon-button { width: 28px; height: 28px; display: grid; place-items: center; margin: 8px 6px 0 0; padding: 0; border: 0; border-radius: 8px; color: #8d97a8; background: transparent; }
.mini-icon-button:hover { color: #fff; background: rgb(255 255 255 / 7%); }
.mini-icon-button svg { width: 15px; height: 15px; }
.nav-item { width: 100%; min-height: 42px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 6px 10px; margin: 2px 0; border: 0; border-radius: 10px; color: #b9c0cc; background: transparent; text-align: left; font-size: 14px; font-weight: 600; }
.nav-item:hover { color: #fff; background: rgb(255 255 255 / 6%); }
.nav-item.is-active { color: #fff; background: var(--sidebar-soft); box-shadow: inset 3px 0 0 #818cf8; }
.nav-icon { display: grid; place-items: center; }
.nav-icon svg { width: 18px; height: 18px; }
.project-dot { width: 10px; height: 10px; margin-left: 4px; border-radius: 50%; box-shadow: 0 0 0 4px rgb(255 255 255 / 4%); }
.nav-count { min-width: 23px; padding: 2px 6px; border-radius: 999px; color: #9ca3af; background: rgb(255 255 255 / 6%); text-align: center; font-size: 11px; font-weight: 800; }
.nav-item.is-active .nav-count { color: #dbeafe; background: rgb(129 140 248 / 18%); }
.nav-count.danger:not(:empty) { color: #fca5a5; }

.sidebar-footer { padding: 15px 4px 0; border-top: 1px solid rgb(255 255 255 / 8%); }
.footer-action { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px; border: 0; border-radius: 8px; color: #99a3b3; background: transparent; text-align: left; font-size: 12px; font-weight: 650; }
.footer-action:hover { color: #fff; background: rgb(255 255 255 / 5%); }
.footer-action svg { width: 16px; height: 16px; }
.storage-note { margin: 9px 8px 0; color: #636f81; font-size: 10px; line-height: 1.4; }

.main-content { min-height: 100vh; margin-left: var(--sidebar-width); padding: 34px 42px 50px; }
.topbar { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.page-heading { flex: 1; }
.page-heading p { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 600; text-transform: capitalize; }
.page-heading h1 { margin: 0; color: #101828; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -.035em; }
.header-actions { display: flex; gap: 10px; }
.user-menu { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 4px 5px 4px 7px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.user-avatar { width: 31px; height: 31px; display: grid; place-items: center; flex: none; border-radius: 9px; color: #4338ca; background: #eef2ff; font-size: 12px; font-weight: 850; }
.user-copy { min-width: 78px; display: grid; gap: 1px; line-height: 1.15; }
.user-copy strong { overflow: hidden; max-width: 120px; color: #344054; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { color: #98a2b3; font-size: 9px; }
.logout-button { width: 32px; height: 32px; color: #98a2b3; }
.logout-button:hover { color: #dc2626; background: #fef2f2; }
.logout-button:disabled { opacity: .5; }
.menu-button { display: none; }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(200px, 1.2fr); gap: 14px; margin-bottom: 18px; }
.stat-card { min-height: 94px; display: flex; align-items: center; gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-icon { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; }
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon.blue { color: #4f46e5; background: #eef2ff; }
.stat-icon.amber { color: #d97706; background: #fffbeb; }
.stat-icon.red { color: #dc2626; background: #fef2f2; }
.stat-card span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 650; }
.stat-card strong { color: #101828; font-size: 25px; line-height: 1; letter-spacing: -.04em; }
.progress-card { display: block; padding-top: 17px; }
.progress-copy { display: flex; align-items: end; justify-content: space-between; }
.progress-copy strong { font-size: 22px; }
.progress-track { height: 8px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: #eef0f4; }
.progress-track span { width: 0; height: 100%; margin: 0; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #8b5cf6); transition: width 300ms ease; }

.workspace-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.toolbar { min-height: 68px; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.search-box { min-width: 220px; max-width: 330px; flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color 120ms ease, box-shadow 120ms ease; }
.search-box:focus-within { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgb(99 102 241 / 10%); }
.search-box svg { width: 18px; height: 18px; color: #98a2b3; }
.search-box input { width: 100%; height: 40px; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #98a2b3; }
.search-box kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: #98a2b3; background: var(--surface-soft); font-size: 10px; }
.filter-chips { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.filter-chip { min-height: 34px; padding: 0 11px; border: 0; border-radius: 8px; color: #667085; background: transparent; white-space: nowrap; font-size: 12px; font-weight: 700; }
.filter-chip:hover { background: #f2f4f7; }
.filter-chip.is-active { color: #4338ca; background: var(--primary-soft); }
.view-switch { display: flex; gap: 3px; margin-left: auto; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.view-switch button { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; color: #98a2b3; background: transparent; }
.view-switch button:hover { color: #475467; }
.view-switch button.is-active { color: #344054; background: #fff; box-shadow: 0 1px 3px rgb(16 24 40 / 10%); }
.view-switch svg { width: 17px; height: 17px; }

.task-list { min-height: 280px; }
.list-head { display: grid; grid-template-columns: minmax(280px, 2.4fr) minmax(120px, .8fr) minmax(145px, .9fr) minmax(108px, .65fr) 76px; align-items: center; gap: 14px; padding: 11px 18px; color: #98a2b3; background: #fafbfc; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.task-row { display: grid; grid-template-columns: minmax(280px, 2.4fr) minmax(120px, .8fr) minmax(145px, .9fr) minmax(108px, .65fr) 76px; align-items: center; gap: 14px; min-height: 74px; padding: 10px 18px; border-bottom: 1px solid #edf0f4; transition: background 120ms ease; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #fbfcfe; }
.task-row.is-done .task-name { color: #98a2b3; text-decoration: line-through; }
.task-row.is-overdue { box-shadow: inset 3px 0 0 #f87171; }
.task-main { min-width: 0; display: flex; align-items: flex-start; gap: 11px; }
.complete-button { width: 21px; height: 21px; display: grid; place-items: center; flex: 0 0 auto; margin-top: 1px; padding: 0; border: 1.7px solid #c5ccd7; border-radius: 7px; color: #fff; background: #fff; }
.complete-button:hover { border-color: #818cf8; }
.complete-button.is-done { border-color: var(--success); background: var(--success); }
.complete-button svg { width: 14px; height: 14px; stroke-width: 2.5; }
.task-copy { min-width: 0; }
.task-name { overflow: hidden; color: #1d2939; font-size: 14px; font-weight: 750; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.task-note { overflow: hidden; margin-top: 4px; color: #8a94a5; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.task-subline { min-width: 0; display: flex; align-items: center; gap: 7px; margin-top: 5px; }
.task-subline .task-note { margin-top: 0; }
.task-subline .priority-badge { flex: 0 0 auto; padding: 3px 6px; font-size: 9px; }
.project-badge, .priority-badge, .date-badge { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 11px; font-weight: 750; }
.project-badge { color: #475467; }
.project-badge i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; }
.project-badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priority-badge { width: fit-content; padding: 5px 8px; border-radius: 7px; }
.priority-badge.high { color: #b42318; background: #fef3f2; }
.priority-badge.medium { color: #b54708; background: #fffaeb; }
.priority-badge.low { color: #027a48; background: #ecfdf3; }
.date-badge { color: #667085; }
.date-badge svg { width: 15px; height: 15px; }
.date-badge.overdue { color: #d92d20; }
.status-select { width: 100%; max-width: 145px; height: 32px; padding: 0 27px 0 9px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: #475467; background-color: #fff; font-size: 11px; font-weight: 700; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; opacity: .35; transition: opacity 120ms ease; }
.task-row:hover .row-actions { opacity: 1; }
.row-action { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: #667085; background: transparent; }
.row-action:hover { color: #344054; background: #f2f4f7; }
.row-action.delete:hover { color: var(--danger); background: var(--danger-soft); }
.row-action svg { width: 16px; height: 16px; }

.purchase-list { min-height: 280px; }
.purchase-head, .purchase-row { display: grid; grid-template-columns: minmax(230px, 2fr) 120px 120px 95px 135px 76px; align-items: center; gap: 14px; }
.purchase-head { padding: 11px 18px; color: #98a2b3; background: #fafbfc; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.purchase-row { min-height: 76px; padding: 11px 18px; border-bottom: 1px solid #edf0f4; transition: background 120ms ease; }
.purchase-row:last-child { border-bottom: 0; }
.purchase-row:hover { background: #fbfcfe; }
.purchase-title { overflow: hidden; color: #1d2939; font-size: 14px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.purchase-note { overflow: hidden; margin-top: 4px; color: #8a94a5; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.marketplace-badge { width: fit-content; display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; font-size: 11px; font-weight: 800; }
.marketplace-badge.wb { color: #7e22ce; background: #faf5ff; }
.marketplace-badge.ozon { color: #1d4ed8; background: #eff6ff; }
.purchase-date, .purchase-quantity { color: #667085; font-size: 12px; font-weight: 650; }
.purchase-amount { color: #101828; font-size: 13px; font-weight: 800; text-align: right; }
.purchase-total-row { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 14px 94px 14px 18px; border-top: 1px solid var(--line); color: #667085; background: #fafbfc; font-size: 12px; }
.purchase-total-row strong { color: #101828; font-size: 15px; }

.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; padding: 14px; overflow-x: auto; background: #f8fafc; }
.board-column { min-height: 360px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: rgb(255 255 255 / 62%); }
.board-heading { display: flex; align-items: center; gap: 8px; padding: 3px 4px 12px; color: #475467; font-size: 12px; font-weight: 800; }
.board-heading i { width: 9px; height: 9px; border-radius: 50%; }
.board-heading span:last-child { min-width: 22px; margin-left: auto; padding: 2px 6px; border-radius: 999px; color: #667085; background: #eef1f5; text-align: center; font-size: 10px; }
.board-cards { display: grid; gap: 8px; }
.board-card { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); cursor: pointer; }
.board-card:hover { border-color: #c7d2fe; box-shadow: 0 5px 15px rgb(15 23 42 / 6%); }
.board-card.is-overdue { border-left: 3px solid #f87171; }
.board-card-title { color: #1d2939; font-size: 13px; font-weight: 750; line-height: 1.4; }
.board-card.is-done .board-card-title { color: #98a2b3; text-decoration: line-through; }
.board-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.board-card-note { display: -webkit-box; overflow: hidden; margin-top: 8px; color: #8a94a5; font-size: 11px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.empty-state { min-height: 390px; display: grid; place-items: center; padding: 40px; text-align: center; }
.empty-state-inner { max-width: 360px; }
.empty-illustration { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 24px; color: #6366f1; background: linear-gradient(145deg, #eef2ff, #e0e7ff); transform: rotate(-3deg); }
.empty-illustration svg { width: 37px; height: 37px; transform: rotate(3deg); }
.empty-state h2 { margin: 0; color: #1d2939; font-size: 19px; letter-spacing: -.02em; }
.empty-state p { margin: 8px auto 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.task-dialog { width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 20px; color: var(--text); background: #fff; box-shadow: var(--shadow-lg); }
.task-dialog::backdrop { background: rgb(15 23 42 / 52%); backdrop-filter: blur(3px); }
.task-dialog form { padding: 24px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.dialog-header p { margin: 0 0 4px; color: var(--primary); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.dialog-header h2 { margin: 0; font-size: 23px; letter-spacing: -.025em; }
.dialog-description { margin: -10px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span { color: #475467; font-size: 12px; font-weight: 750; }
.field b { color: var(--danger); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d7dce4; border-radius: 10px; outline: 0; color: #1d2939; background: #fff; transition: border-color 120ms ease, box-shadow 120ms ease; }
.field input, .field select { height: 43px; padding: 0 12px; }
.field textarea { min-height: 104px; padding: 11px 12px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgb(99 102 241 / 11%); }
.field input.is-invalid { border-color: #f87171; box-shadow: 0 0 0 3px rgb(248 113 113 / 10%); }
.field-error { min-height: 14px; color: var(--danger); font-size: 11px; }
.dialog-actions { display: flex; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.dialog-actions .text-button { margin-right: auto; }
.text-button { padding: 8px 2px; background: transparent; font-size: 12px; font-weight: 750; }
.danger-text { color: var(--danger); }
.keyboard-hint { color: #98a2b3; font-size: 10px; }
.project-dialog { width: min(660px, calc(100vw - 28px)); }
.project-manager-list { display: grid; gap: 9px; max-height: 330px; margin-bottom: 18px; overflow-y: auto; }
.project-manager-row { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; }
.project-color { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 4px #fff; }
.project-manager-row input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; outline: 0; color: #1d2939; background: transparent; font-weight: 700; }
.project-manager-row input:focus { border-color: #a5b4fc; background: #fff; box-shadow: 0 0 0 3px rgb(99 102 241 / 9%); }
.add-project-box { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; margin: 2px 0 18px; padding: 14px; border: 1px dashed #c7d2fe; border-radius: 12px; background: #f8f9ff; }
.add-project-box .field { margin: 0; }
.project-save-note { margin-right: auto; color: var(--success); font-size: 11px; font-weight: 700; }

.reviews-workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .75fr); gap: 18px; padding: 18px; background: #f7f8fb; }
.review-compose-panel, .review-training-panel { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 2px 8px rgb(15 23 42 / 3%); }
.review-training-panel { align-self: start; }
.review-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.review-panel-heading.compact { margin-bottom: 16px; }
.review-panel-heading h2 { margin: 3px 0 5px; color: #182230; font-size: 20px; line-height: 1.2; }
.review-panel-heading p { max-width: 600px; margin: 0; color: #667085; font-size: 12px; line-height: 1.55; }
.eyebrow { color: #6366f1; font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.manual-badge, .learning-match { flex: none; padding: 7px 10px; border: 1px solid #c7d7fe; border-radius: 999px; color: #3b5ccc; background: #eef4ff; font-size: 10px; font-weight: 800; }
.review-fields-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.review-fields-grid.two-columns { grid-template-columns: 1fr 1fr; }
.review-generate-row { display: flex; align-items: center; gap: 13px; margin: 16px 0; }
.review-generate-row span { color: #667085; font-size: 11px; }
.review-result { padding: 18px; border: 1px dashed #cbd5e1; border-radius: 14px; background: #fafbfc; }
.review-result.has-result { border-style: solid; border-color: #c7d7fe; background: #f8faff; }
.review-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.review-result-head h3 { margin: 3px 0 0; color: #344054; font-size: 15px; }
.review-result textarea { width: 100%; min-height: 142px; padding: 13px; resize: vertical; border: 1px solid #d0d5dd; border-radius: 10px; outline: 0; color: #1d2939; background: #fff; font: inherit; line-height: 1.55; }
.review-result textarea:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgb(99 102 241 / 9%); }
.review-result-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }
.review-result-actions button:disabled { cursor: not-allowed; opacity: .45; }
.review-training-panel > .field { margin-bottom: 12px; }
.wide-button { width: 100%; justify-content: center; }
.training-divider { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; color: #475467; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.training-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.training-divider b { order: 3; min-width: 24px; padding: 3px 7px; border-radius: 999px; color: #4f46e5; background: #eef2ff; text-align: center; }
.training-list { display: grid; gap: 9px; max-height: 520px; overflow: auto; }
.training-example { padding: 11px; border: 1px solid #e4e7ec; border-radius: 11px; background: #fafbfc; }
.training-example-head { display: flex; align-items: center; gap: 7px; color: #667085; font-size: 10px; font-weight: 700; }
.training-example-head .row-action { margin-left: auto; opacity: 1; }
.training-example p { display: -webkit-box; margin: 8px 0 5px; overflow: hidden; color: #667085; font-size: 11px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.training-example strong { display: -webkit-box; overflow: hidden; color: #344054; font-size: 11px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.training-empty { display: grid; gap: 4px; padding: 18px; border: 1px dashed #d0d5dd; border-radius: 11px; color: #667085; text-align: center; }
.training-empty strong { color: #344054; font-size: 12px; }
.training-empty span { font-size: 11px; line-height: 1.45; }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 380px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid #dbe3ee; border-radius: 11px; color: #344054; background: #fff; box-shadow: 0 14px 35px rgb(15 23 42 / 14%); font-size: 12px; font-weight: 650; animation: toast-in 180ms ease-out; }
.toast::before { content: ""; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--success); }
.toast.error::before { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.mobile-overlay { display: none; }

@media (max-width: 1180px) {
  .main-content { padding: 30px 26px 42px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { flex-wrap: wrap; }
  .search-box { max-width: none; }
  .filter-chips { order: 3; width: calc(100% - 48px); }
  .list-head { display: none; }
  .task-row { grid-template-columns: minmax(250px, 1.8fr) minmax(110px, .7fr) minmax(130px, .8fr) 70px; }
  .task-row > .priority-badge { display: none; }
  .purchase-head { display: none; }
  .purchase-row { grid-template-columns: minmax(180px, 1.5fr) 90px 110px 120px 76px; }
  .purchase-row > .purchase-quantity { display: none; }
  .reviews-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; padding: 32px 22px; }
  .sidebar { transform: translateX(-105%); transition: transform 180ms ease; box-shadow: 16px 0 45px rgb(15 23 42 / 22%); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: grid !important; }
  .mobile-overlay.is-open { position: fixed; inset: 0; display: block; z-index: 40; background: rgb(15 23 42 / 44%); backdrop-filter: blur(2px); }
  .main-content { margin-left: 0; padding: 22px 18px 38px; }
  .menu-button { display: grid; background: #fff; border: 1px solid var(--line); }
  .topbar { margin-bottom: 20px; }
  .desktop-new, .install-button { width: 42px; padding: 0; font-size: 0; }
  .stats-grid { gap: 10px; }
  .stat-card { min-height: 84px; padding: 14px; }
  .stat-icon { width: 38px; height: 38px; }
  .workspace-card { border-radius: 14px; }
  .task-row { grid-template-columns: minmax(200px, 1fr) 82px; gap: 8px; padding: 12px 14px; }
  .task-row > .project-badge, .task-row > .date-badge, .task-row > .priority-badge { display: none; }
  .status-select { max-width: 82px; padding-right: 8px; color: transparent; }
  .status-select option { color: #1d2939; }
  .row-actions { opacity: 1; }
  .row-action.delete { display: none; }
  .board { grid-template-columns: repeat(4, 250px); }
  .purchase-row { grid-template-columns: minmax(170px, 1fr) 82px 100px 112px 42px; padding: 12px 14px; }
  .purchase-amount { text-align: left; }
  .purchase-total-row { padding-right: 18px; }
}

@media (max-width: 560px) {
  .auth-card h2 { font-size: 29px; }
  .user-copy { display: none; }
  .user-menu { gap: 3px; padding-left: 5px; }
  .main-content { padding: 18px 12px 30px; }
  .page-heading p { font-size: 11px; }
  .page-heading h1 { font-size: 23px; }
  .header-actions { gap: 6px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 78px; gap: 10px; padding: 12px; }
  .stat-icon { width: 34px; height: 34px; border-radius: 10px; }
  .stat-icon svg { width: 18px; height: 18px; }
  .stat-card span { font-size: 10px; }
  .stat-card strong { font-size: 21px; }
  .purchase-row { grid-template-columns: minmax(140px, 1fr) 94px 102px 38px; gap: 8px; }
  .purchase-row > .marketplace-badge { display: none; }
  .reviews-workspace { padding: 10px; }
  .review-compose-panel, .review-training-panel { padding: 15px; }
  .review-fields-grid, .review-fields-grid.two-columns { grid-template-columns: 1fr; }
  .review-panel-heading, .review-result-head { align-items: flex-start; flex-direction: column; }
  .review-generate-row { align-items: stretch; flex-direction: column; }
  .review-result-actions { flex-direction: column; }
  .review-result-actions button { width: 100%; justify-content: center; }
  .toolbar { gap: 10px; padding: 10px; }
  .search-box { min-width: 100%; }
  .filter-chips { width: calc(100% - 46px); }
  .filter-chip { padding: 0 9px; }
  .task-row { min-height: 70px; }
  .task-name { font-size: 13px; }
  .task-note { max-width: 210px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .task-dialog form { padding: 19px; }
  .dialog-actions { flex-wrap: wrap; }
  .keyboard-hint { display: none; }
  .dialog-actions .secondary-button, .dialog-actions .primary-button { flex: 1; }
  .add-project-box { grid-template-columns: 1fr; }
  .add-project-box .secondary-button { width: 100%; }
  .toast-region { right: 12px; bottom: 12px; left: 12px; }
  .toast { min-width: 0; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
