:root {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light dark;
  font-synthesis: none;
  --purple: #a997ff;
  --purple-strong: #806df0;
  --green: #38c88a;
  --red: #ff6969;
  --orange: #ffad58;
  --blue: #54a7ff;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #202124; }
button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
input, textarea, select { outline: none; }
textarea { resize: vertical; }

.platform-shell,
.auth-shell,
.boot-screen {
  --bg: #f4f5f8;
  --surface: #fff;
  --surface-2: #f7f7fa;
  --surface-3: #ececf1;
  --text: #1f2026;
  --muted: #767984;
  --line: #e4e5ea;
  --sidebar: #fff;
  --shadow: 0 12px 34px rgba(24, 25, 31, .08);
  background: var(--bg);
  color: var(--text);
}

.platform-shell.dark,
.auth-shell.dark,
.boot-screen.dark {
  --bg: #242526;
  --surface: #2d2e30;
  --surface-2: #292a2c;
  --surface-3: #36373a;
  --text: #f7f7f8;
  --muted: #9b9da5;
  --line: rgba(255, 255, 255, .09);
  --sidebar: #292a2c;
  --shadow: 0 14px 40px rgba(0, 0, 0, .22);
}

.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; }
.boot-screen p { margin: 0; font-weight: 700; letter-spacing: .02em; }
.logo-mark { position: relative; width: 26px; height: 22px; display: inline-block; }
.logo-mark::before { content: ""; position: absolute; inset: 2px 1px 7px 2px; border-radius: 3px 10px 3px 3px; background: linear-gradient(135deg, #d0c8ff, #806df0); transform: skewX(-18deg); }
.logo-mark::after { content: ""; position: absolute; left: 2px; bottom: 1px; width: 11px; height: 11px; background: inherit; border-left: 5px solid var(--sidebar, #292a2c); transform: rotate(45deg); }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(390px, .85fr); }
.auth-promo { position: relative; min-height: 100vh; padding: 42px clamp(36px, 6vw, 96px); overflow: hidden; background: radial-gradient(circle at 20% 10%, rgba(169, 151, 255, .28), transparent 35%), linear-gradient(145deg, #1d1e21, #292a2d 58%, #25232d); color: #fff; }
.auth-promo::after { content: ""; position: absolute; width: 520px; height: 520px; right: -210px; bottom: -210px; border: 1px solid rgba(169,151,255,.2); border-radius: 50%; box-shadow: 0 0 0 70px rgba(169,151,255,.035), 0 0 0 140px rgba(169,151,255,.025); }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; color: #d8d1ff; }
.auth-copy { position: relative; z-index: 1; max-width: 670px; margin-top: clamp(110px, 20vh, 210px); }
.eyebrow { display: block; color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.auth-copy h1 { max-width: 680px; margin: 20px 0; font-size: clamp(38px, 5vw, 68px); line-height: 1.02; letter-spacing: -.045em; }
.auth-copy p { max-width: 610px; margin: 0; color: #b9bac2; font-size: 17px; line-height: 1.65; }
.role-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.role-preview span { padding: 10px 14px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; background: rgba(255,255,255,.045); color: #e6e6ea; font-size: 12px; }
.auth-panel { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 44px; background: var(--bg); }
.auth-card { width: min(430px, 100%); }
.auth-card h2 { margin: 10px 0 8px; color: var(--text); font-size: 32px; letter-spacing: -.03em; }
.auth-card > p { margin: 0 0 28px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.auth-card form { display: grid; gap: 16px; }
.auth-card label, .field, .password-form label, .report-form label, .customer-review-form label { display: grid; gap: 8px; }
.auth-card label span, .field > span, .password-form label span, .report-form label span, .customer-review-form label span { color: var(--muted); font-size: 12px; font-weight: 650; }
.auth-card input, .field input, .field select, .field textarea, .password-form input, .report-form textarea, .customer-review-form textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); }
.auth-card input:focus, .field input:focus, .field select:focus, .field textarea:focus, .password-form input:focus, .report-form textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(169,151,255,.12); }
.auth-theme { position: absolute; top: 28px; right: 28px; }
.theme-button { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); color: var(--muted); }
.auth-switch { width: 100%; margin-top: 18px; background: transparent; color: var(--purple-strong); font-size: 13px; }
.form-error, .global-error { padding: 12px 14px; border: 1px solid rgba(255,105,105,.28); border-radius: 10px; background: rgba(255,105,105,.09); color: var(--red); font-size: 13px; }

.primary-button, .secondary-button, .danger-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 10px; font-size: 13px; font-weight: 750; }
.primary-button { background: linear-gradient(135deg, #b9adff, #9988ff); color: #25222f; box-shadow: 0 6px 18px rgba(128,109,240,.18); }
.secondary-button { border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.danger-button { background: rgba(255,105,105,.12); color: var(--red); }
.wide-button { width: 100%; }

.platform-shell { min-height: 100dvh; }
.app-sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 270px; display: flex; flex-direction: column; padding: 27px 16px 18px; border-right: 1px solid var(--line); background: var(--sidebar); }
.app-brand { width: max-content; height: 30px; margin: 0 12px 24px; display: flex; align-items: center; gap: 8px; background: transparent; color: var(--purple); font-size: 14px; }
.company-switcher { min-height: 62px; display: grid; grid-template-columns: 34px minmax(0,1fr) 18px; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.company-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(169,151,255,.15); color: var(--purple); }
.company-icon.large { width: 46px; height: 46px; }
.company-switcher span:nth-child(2) { min-width: 0; }
.company-switcher b, .company-switcher small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-switcher b { font-size: 12px; }
.company-switcher small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.company-switcher > svg { color: var(--muted); }
.desktop-nav { min-height: 0; flex: 1; margin-top: 25px; overflow: auto; scrollbar-width: none; }
.desktop-nav::-webkit-scrollbar { display: none; }
.nav-caption { display: block; margin: 0 12px 9px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.nav-button { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 12px; margin: 3px 0; padding: 0 12px; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; text-align: left; }
.nav-button span { flex: 1; }
.nav-button em { min-width: 30px; padding: 3px 7px; border-radius: 7px; background: var(--surface-3); color: var(--muted); font-size: 10px; font-style: normal; text-align: center; }
.nav-button:hover { background: var(--surface-2); color: var(--text); }
.nav-button.active { background: rgba(169,151,255,.14); color: var(--purple); font-weight: 750; }
.nav-button.active em { background: var(--purple); color: #27242f; }
.seat-widget { margin: 12px 4px 14px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.seat-widget > div { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.seat-widget > div b { color: var(--text); }
.seat-widget > i, .seat-banner > i { height: 5px; display: block; margin: 10px 0 8px; overflow: hidden; border-radius: 20px; background: var(--surface-3); }
.seat-widget > i b, .seat-banner > i b { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--purple-strong), var(--purple)); }
.seat-widget small { color: var(--muted); font-size: 9px; }
.sidebar-footer { position: relative; padding-top: 13px; border-top: 1px solid var(--line); }
.theme-row { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 8px; background: transparent; color: var(--muted); font-size: 11px; }
.theme-row span { flex: 1; text-align: left; }
.toggle { position: relative; width: 32px; height: 18px; border-radius: 20px; background: var(--surface-3); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: .2s; }
.toggle.on { background: rgba(169,151,255,.25); }
.toggle.on::after { left: 17px; background: var(--purple); }
.profile-row { width: calc(100% - 34px); min-height: 48px; display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; gap: 9px; margin-top: 6px; padding: 6px 8px; border-radius: 10px; background: transparent; color: var(--text); text-align: left; }
.profile-row:hover { background: var(--surface-2); }
.profile-row span:nth-child(2) { min-width: 0; }
.profile-row b, .profile-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-row b { font-size: 10px; }
.profile-row small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.logout-button { position: absolute; right: 4px; bottom: 12px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: transparent; color: var(--muted); }
.logout-button:hover { background: rgba(255,105,105,.1); color: var(--red); }
.avatar { flex: 0 0 auto; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 50%; background: linear-gradient(135deg, #54a7ff, #806df0); color: #fff; font-size: 12px; font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.topbar { position: fixed; z-index: 20; top: 0; right: 0; left: 270px; height: 104px; display: flex; align-items: center; gap: 22px; padding: 0 clamp(22px,3vw,44px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg), transparent 3%); backdrop-filter: blur(16px); }
.page-heading { min-width: 0; flex: 1; }
.page-heading h1 { margin: 0; font-size: 23px; letter-spacing: -.025em; }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.company-select { display: grid; gap: 3px; }
.company-select span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.company-select select { min-width: 170px; height: 38px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 11px; }
.top-avatar { width: 38px; height: 38px; }
.mobile-brand { display: none; }
.mobile-nav { display: none; }
.platform-content { min-height: 100dvh; margin-left: 270px; padding: 128px clamp(22px,3vw,44px) 42px; background: var(--bg); }
.panel { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.page-loading { min-height: 50vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.page-loading span { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.stat-card { position: relative; min-height: 132px; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stat-card::after { content: ""; position: absolute; width: 70px; height: 70px; top: -24px; right: -18px; border-radius: 50%; background: currentColor; opacity: .08; }
.stat-card span, .stat-card small, .stat-card b { display: block; }
.stat-card span { color: var(--muted); font-size: 11px; }
.stat-card b { margin-top: 13px; color: var(--text); font-size: 30px; line-height: 1; }
.stat-card small { margin-top: 10px; color: var(--muted); font-size: 9px; }
.stat-card.purple { color: var(--purple); } .stat-card.red { color: var(--red); } .stat-card.orange { color: var(--orange); } .stat-card.green { color: var(--green); }
.dashboard-scope { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; padding: 11px 14px; }
.dashboard-scope > div b, .dashboard-scope > div span { display: block; }
.dashboard-scope > div b { font-size: 11px; }
.dashboard-scope > div span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.dashboard-scope label, .executor-filter { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 8px; }
.dashboard-scope select, .executor-filter select { min-width: 190px; height: 38px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 9px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); gap: 16px; margin-top: 16px; }
.task-focus-panel { grid-row: span 2; padding: 18px; }
.workflow-panel, .team-load-panel { padding: 18px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 14px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.panel-head button { background: transparent; color: var(--purple); font-size: 10px; }
.compact-task-list { display: grid; gap: 8px; }
.compact-task { width: 100%; min-height: 62px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--text); text-align: left; }
.compact-task:hover { border-color: rgba(169,151,255,.55); }
.task-number { color: var(--muted); font-size: 9px; }
.task-copy { min-width: 0; }
.task-copy b, .task-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-copy b { font-size: 11px; }
.task-copy small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.workflow-badge { max-width: 170px; padding: 5px 8px; overflow: hidden; border-radius: 7px; background: var(--surface-3); color: var(--muted); font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.workflow-badge.purple { background: rgba(169,151,255,.15); color: var(--purple); }
.workflow-badge.danger { background: rgba(255,105,105,.12); color: var(--red); }
.workflow-badge.warning { background: rgba(255,173,88,.12); color: var(--orange); }
.workflow-badge.success { background: rgba(56,200,138,.12); color: var(--green); }
.workflow-badge.info { background: rgba(84,167,255,.12); color: var(--blue); }
.workflow-roadmap { display: grid; gap: 17px; }
.workflow-roadmap > div { position: relative; display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 10px; }
.workflow-roadmap > div:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 31px; width: 1px; height: 18px; background: var(--line); }
.workflow-roadmap > div > b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgba(169,151,255,.14); color: var(--purple); font-size: 10px; }
.workflow-roadmap strong, .workflow-roadmap small { display: block; }
.workflow-roadmap strong { font-size: 10px; }
.workflow-roadmap small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.team-load-list { display: grid; gap: 10px; }
.team-load-person { width: 100%; display: grid; grid-template-columns: 30px minmax(0,1fr) 30px; align-items: center; gap: 9px; padding: 5px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text); text-align: left; }
.team-load-person:hover, .team-load-person.active { border-color: rgba(169,151,255,.35); background: rgba(169,151,255,.08); }
.team-load-list .avatar { width: 30px; height: 30px; }
.team-load-list span b, .team-load-list span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-load-list span b { font-size: 9px; }
.team-load-list span small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.team-load-person > strong { color: var(--purple); font-size: 14px; text-align: right; }

.task-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px; }
.task-search-form { min-width: 260px; flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.task-search-form span { color: var(--muted); }
.task-search-form input { min-width: 0; flex: 1; height: 42px; border: 0; background: transparent; color: var(--text); font-size: 11px; }
.task-search-form button { background: transparent; color: var(--purple); font-size: 10px; }
.executor-filter { flex: 0 0 auto; }
.executor-filter select { min-width: 165px; height: 42px; }
.filter-pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.filter-pills button { min-height: 34px; padding: 0 11px; border-radius: 8px; background: transparent; color: var(--muted); font-size: 9px; white-space: nowrap; }
.filter-pills button.active { background: rgba(169,151,255,.14); color: var(--purple); }
.task-list { display: grid; gap: 9px; margin-top: 14px; }
.task-row-card { position: relative; min-height: 82px; display: grid; grid-template-columns: 46px minmax(230px,1fr) minmax(170px,.65fr) 92px 128px; align-items: center; gap: 14px; overflow: hidden; padding: 12px 16px 12px 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--text); text-align: left; }
.task-row-card:hover { border-color: rgba(169,151,255,.5); transform: translateY(-1px); }
.task-status-line { position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--purple); }
.task-status-line.overdue { background: var(--red); } .task-status-line.done { background: var(--green); } .task-status-line.in_progress { background: var(--orange); }
.task-id { color: var(--muted); font-size: 9px; }
.task-main, .assignee-stack { min-width: 0; }
.task-main b, .task-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-main b { font-size: 11px; }
.task-main small { margin-top: 6px; color: var(--muted); font-size: 8px; }
.assignee-stack { display: flex; align-items: center; }
.mini-avatar { width: 26px; height: 26px; margin-left: -5px; border: 2px solid var(--surface); font-size: 9px; }
.assignee-stack .mini-avatar:first-child { margin-left: 0; }
.assignee-stack small { min-width: 0; margin-left: 8px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.task-due small, .task-due b { display: block; white-space: nowrap; }
.task-due small { color: var(--muted); font-size: 7px; }
.task-due b { margin-top: 4px; font-size: 9px; }

.seat-banner { display: grid; grid-template-columns: 170px minmax(100px,1fr) auto; align-items: center; gap: 22px; padding: 18px; }
.seat-banner > div:first-child span, .seat-banner > div:first-child b, .seat-banner > div:first-child small { display: block; }
.seat-banner > div:first-child span { color: var(--muted); font-size: 9px; }
.seat-banner > div:first-child b { margin-top: 4px; font-size: 25px; }
.seat-banner > div:first-child small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.seat-actions { display: flex; gap: 8px; }
.member-grid, .organization-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin-top: 15px; }
.member-card-v2 { min-height: 140px; display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.member-avatar { width: 46px; height: 46px; }
.member-card-v2 > div:nth-child(2) { min-width: 0; }
.member-card-v2 > div:nth-child(2) b, .member-card-v2 > div:nth-child(2) span, .member-card-v2 > div:nth-child(2) small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-card-v2 > div:nth-child(2) b { font-size: 11px; }
.member-card-v2 > div:nth-child(2) span { margin-top: 5px; color: var(--muted); font-size: 8px; }
.member-card-v2 > div:nth-child(2) small { margin-top: 6px; color: var(--green); font-size: 8px; }
.member-metrics { grid-column: 1 / -1; display: flex; gap: 24px; padding-top: 10px; border-top: 1px solid var(--line); }
.member-metrics span b, .member-metrics span small { display: block; }
.member-metrics span b { font-size: 15px; }
.member-metrics span small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.danger-text b { color: var(--red); }

.invite-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.invite-option { padding: 24px; }
.option-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; background: rgba(169,151,255,.14); color: var(--purple); }
.invite-option h2 { margin: 18px 0 9px; font-size: 16px; }
.invite-option p { min-height: 56px; margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.active-invites { margin-top: 15px; padding: 20px; }
.invite-row { min-height: 56px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.invite-row > span { color: var(--muted); }
.invite-row b, .invite-row small { display: block; }
.invite-row b { font-size: 10px; }
.invite-row small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.invite-row em { color: var(--orange); font-size: 8px; font-style: normal; }

.organization-card { padding: 18px; }
.organization-head { display: grid; grid-template-columns: 46px minmax(0,1fr); align-items: center; gap: 12px; }
.organization-head h2 { margin: 0; font-size: 13px; }
.organization-head p { margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.organization-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 17px 0; }
.organization-stats span { padding: 9px; border-radius: 9px; background: var(--surface-2); }
.organization-stats b, .organization-stats small { display: block; }
.organization-stats b { font-size: 14px; }
.organization-stats small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.limit-form { display: flex; align-items: end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.limit-form label { min-width: 0; flex: 1; display: grid; gap: 5px; }
.limit-form label span { color: var(--muted); font-size: 8px; }
.limit-form input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); }

.automation-hero { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 15px; padding: 20px; }
.automation-pulse { width: 48px; height: 48px; border-radius: 50%; background: rgba(56,200,138,.13); box-shadow: inset 0 0 0 14px rgba(56,200,138,.08); }
.automation-hero h2 { margin: 0; font-size: 15px; }
.automation-hero p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.automation-hero > b { padding: 7px 11px; border-radius: 8px; background: rgba(56,200,138,.13); color: var(--green); font-size: 10px; }
.rule-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-top: 15px; }
.rule-card { min-height: 190px; padding: 18px; }
.rule-card > span { color: var(--purple); }
.rule-card h3 { margin: 22px 0 9px; font-size: 12px; }
.rule-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.rule-card small { display: block; margin-top: 18px; color: var(--green); font-size: 8px; }

.profile-view { display: grid; grid-template-columns: minmax(360px,1fr) minmax(320px,.8fr); gap: 15px; }
.profile-card { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 25px; padding: 28px; }
.profile-avatar-wrap { display: grid; justify-items: center; align-content: start; gap: 10px; }
.profile-avatar { width: 112px; height: 112px; font-size: 36px; }
.avatar-upload { position: relative; min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); font-size: 9px; cursor: pointer; }
.avatar-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.profile-avatar-wrap > small { color: var(--muted); font-size: 8px; }
.profile-details h2 { margin: 10px 0 4px; font-size: 23px; }
.profile-details > p { margin: 0; color: var(--muted); font-size: 11px; }
.profile-details dl { margin: 28px 0 0; }
.profile-details dl div { display: grid; grid-template-columns: 110px minmax(0,1fr); padding: 11px 0; border-top: 1px solid var(--line); }
.profile-details dt { color: var(--muted); font-size: 9px; }
.profile-details dd { margin: 0; font-size: 10px; }
.password-card { padding: 25px; }
.password-card h2 { margin: 0; font-size: 15px; }
.password-card p { margin: 7px 0 21px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.password-form { display: grid; gap: 14px; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(10,10,12,.7); backdrop-filter: blur(6px); }
.platform-modal { width: min(520px,100%); max-height: calc(100dvh - 40px); overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 30px 90px rgba(0,0,0,.35); }
.platform-modal.wide-modal { width: min(930px,100%); }
.platform-modal > header { position: sticky; z-index: 2; top: 0; min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.platform-modal > header span { color: var(--purple); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.platform-modal > header h2 { margin: 5px 0 0; font-size: 17px; }
.modal-close { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); color: var(--muted); }
.task-create-form, .member-create-form { padding: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.field.full, .assignee-picker.full { grid-column: 1 / -1; }
.field textarea { min-height: 96px; }
.assignee-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.assignee-picker legend { margin-bottom: 10px; font-size: 11px; font-weight: 750; }
.assignee-picker legend small { margin-left: 5px; color: var(--muted); font-size: 8px; font-weight: 400; }
.assignee-option { min-height: 49px; display: grid; grid-template-columns: 18px 28px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 8px 10px; border-top: 1px solid var(--line); }
.assignee-option > input { accent-color: var(--purple-strong); }
.assignee-option span b, .assignee-option span small { display: block; }
.assignee-option span b { font-size: 10px; }
.assignee-option span small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.assignee-option em { color: var(--muted); font-size: 8px; font-style: normal; }
.assignee-option em input { accent-color: var(--purple-strong); }
.task-create-form footer, .member-create-form footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.member-create-form { display: grid; gap: 14px; }
.password-generator { display: flex; gap: 7px; }
.password-generator input { flex: 1; }
.password-generator button { padding: 0 12px; border-radius: 9px; background: var(--surface-3); color: var(--purple); font-size: 9px; }
.share-content { display: grid; gap: 15px; padding: 22px; }
.share-content p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.share-content > small { color: var(--muted); font-size: 8px; }
.share-link { display: flex; gap: 7px; }
.share-link input { min-width: 0; flex: 1; height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 9px; }
.share-link button { padding: 0 12px; border-radius: 9px; background: rgba(169,151,255,.14); color: var(--purple); font-size: 9px; }
.credential-box { display: grid; gap: 5px; padding: 15px; border-radius: 11px; background: var(--surface-2); }
.credential-box span { margin-top: 7px; color: var(--muted); font-size: 8px; }
.credential-box b { font-size: 12px; }

.task-detail-body { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(270px,.65fr); }
.task-detail-main { padding: 22px; }
.task-detail-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.task-detail-meta > span { color: var(--muted); font-size: 9px; }
.task-detail-main > h3 { margin: 17px 0; font-size: 17px; line-height: 1.35; }
.task-detail-main > dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 0; }
.task-detail-main > dl div { padding: 10px; border-radius: 9px; background: var(--surface-2); }
.task-detail-main dt { color: var(--muted); font-size: 7px; }
.task-detail-main dd { margin: 4px 0 0; font-size: 9px; }
.assignment-list { margin-top: 22px; }
.assignment-list > h4, .task-action-panel > h4 { margin: 0 0 10px; font-size: 11px; }
.assignment-item { min-height: 52px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: start; gap: 9px; padding: 10px 0; border-top: 1px solid var(--line); }
.assignment-item > div:nth-child(2) b, .assignment-item > div:nth-child(2) small { display: block; }
.assignment-item > div:nth-child(2) b { font-size: 9px; }
.assignment-item > div:nth-child(2) small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.assignment-item p { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.assignment-actions { display: flex; gap: 5px; }
.assignment-actions button { min-height: 28px; padding: 0 8px; border-radius: 7px; background: rgba(56,200,138,.12); color: var(--green); font-size: 7px; }
.assignment-actions button.danger { background: rgba(255,105,105,.1); color: var(--red); }
.task-action-panel { padding: 22px; border-left: 1px solid var(--line); background: var(--surface-2); }
.task-action-panel > * + * { margin-top: 12px; }
.report-form, .customer-review-form { display: grid; gap: 11px; }
.customer-review-form > div { display: flex; gap: 7px; }
.action-note { padding: 12px; border-radius: 9px; background: var(--surface-3); color: var(--muted); font-size: 9px; line-height: 1.5; }
.action-note.warning { background: rgba(255,173,88,.1); color: var(--orange); }
.empty-state { min-height: 120px; display: grid; place-content: center; justify-items: center; gap: 9px; color: var(--muted); font-size: 10px; }
.toast { position: fixed; z-index: 200; right: 24px; bottom: 24px; min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 15px; border: 1px solid rgba(56,200,138,.25); border-radius: 11px; background: #24342d; color: #bff5d7; box-shadow: 0 12px 34px rgba(0,0,0,.24); font-size: 10px; }

@media (max-width: 1100px) {
  .app-sidebar { width: 230px; }
  .topbar { left: 230px; }
  .platform-content { margin-left: 230px; }
  .member-grid, .organization-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .rule-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .task-row-card { grid-template-columns: 42px minmax(190px,1fr) minmax(130px,.55fr) 90px; }
  .task-row-card > .workflow-badge { display: none; }
}

@media (max-width: 820px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .task-focus-panel { grid-row: auto; }
  .task-toolbar { align-items: stretch; flex-direction: column; }
  .task-row-card { grid-template-columns: 40px minmax(0,1fr) 90px; }
  .assignee-stack { display: none; }
  .profile-view { grid-template-columns: 1fr; }
  .seat-banner { grid-template-columns: 150px minmax(90px,1fr); }
  .seat-actions { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .auth-shell { display: block; }
  .auth-promo { min-height: 280px; padding: 28px 24px; }
  .auth-copy { margin-top: 54px; }
  .auth-copy h1 { margin: 14px 0; font-size: 31px; }
  .auth-copy p { font-size: 13px; line-height: 1.5; }
  .role-preview { margin-top: 18px; }
  .auth-panel { min-height: auto; padding: 36px 20px 48px; }
  .auth-theme { top: 16px; right: 16px; }
  .app-sidebar { display: none; }
  .topbar { position: sticky; left: 0; height: 64px; gap: 10px; padding: 0 10px; }
  .mobile-brand { display: flex; align-items: center; gap: 4px; color: var(--purple); }
  .mobile-brand .logo-mark { width: 18px; }
  .page-heading h1 { font-size: 15px; }
  .page-heading p { display: none; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .primary-button span, .company-select, .top-avatar { display: none; }
  .topbar-actions .primary-button { width: 34px; min-height: 34px; padding: 0; border-radius: 10px; }
  .platform-content { min-height: calc(100dvh - 64px); margin-left: 0; padding: 10px 10px 72px; }
  .mobile-nav { position: fixed; z-index: 60; right: 8px; bottom: 8px; left: 8px; min-height: 56px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface), transparent 5%); box-shadow: 0 10px 28px rgba(0,0,0,.28); backdrop-filter: blur(16px); }
  .mobile-nav button { display: grid; place-content: center; justify-items: center; gap: 2px; border-radius: 9px; background: transparent; color: var(--muted); font-size: 7px; }
  .mobile-nav svg { width: 17px; height: 17px; }
  .mobile-nav button.active { background: rgba(169,151,255,.14); color: var(--purple); }
  .stats-grid { gap: 6px; }
  .dashboard-scope { min-height: 52px; display: grid; grid-template-columns: minmax(0,1fr) minmax(140px,.9fr); align-items: center; gap: 8px; margin-bottom: 8px; padding: 8px 10px; }
  .dashboard-scope > div { min-width: 0; }
  .dashboard-scope > div b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .dashboard-scope > div span, .dashboard-scope label > span { display: none; }
  .dashboard-scope label { width: 100%; }
  .dashboard-scope select { width: 100%; min-width: 0; height: 34px; padding-left: 8px; font-size: 8px; }
  .executor-filter { width: 100%; height: 34px; align-items: stretch; gap: 0; }
  .executor-filter > span { display: none; }
  .executor-filter select { width: 100%; min-width: 0; height: 34px; }
  .stat-card { min-height: 78px; padding: 10px; border-radius: 11px; }
  .stat-card::after { width: 52px; height: 52px; top: -20px; right: -15px; }
  .stat-card span { font-size: 9px; }
  .stat-card b { margin-top: 6px; font-size: 23px; }
  .stat-card small { margin-top: 5px; overflow: hidden; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
  .dashboard-grid { margin-top: 8px; gap: 8px; }
  .task-focus-panel, .workflow-panel, .team-load-panel { padding: 12px; }
  .panel-head { gap: 8px; margin-bottom: 10px; }
  .panel-head h2 { font-size: 13px; }
  .panel-head p { margin-top: 3px; font-size: 8px; }
  .panel-head button { font-size: 8px; }
  .compact-task-list { gap: 6px; }
  .compact-task-list .compact-task:nth-child(n+4) { display: none; }
  .compact-task { min-height: 50px; grid-template-columns: 34px minmax(0,1fr); gap: 7px; padding: 7px 8px; border-radius: 9px; }
  .compact-task .workflow-badge { display: none; }
  .task-copy b { font-size: 10px; }
  .task-copy small { margin-top: 3px; font-size: 8px; }
  .workflow-roadmap { gap: 8px; }
  .workflow-roadmap > div { grid-template-columns: 24px minmax(0,1fr); gap: 8px; }
  .workflow-roadmap > div:not(:last-child)::after { left: 11px; top: 25px; height: 13px; }
  .workflow-roadmap > div > b { width: 24px; height: 24px; border-radius: 7px; font-size: 8px; }
  .workflow-roadmap small { margin-top: 2px; }
  .team-load-list { gap: 5px; }
  .team-load-list .team-load-person:nth-child(n+5) { display: none; }
  .team-load-person { grid-template-columns: 26px minmax(0,1fr) 26px; gap: 7px; padding: 3px; }
  .team-load-list .avatar { width: 26px; height: 26px; }
  .team-load-person > strong { font-size: 12px; }
  .task-toolbar { gap: 8px; padding: 8px; }
  .task-search-form { min-width: 0; }
  .task-search-form input { height: 36px; }
  .filter-pills button { min-height: 30px; padding: 0 9px; }
  .task-list { gap: 7px; margin-top: 8px; }
  .task-row-card { min-height: 76px; grid-template-columns: 32px minmax(0,1fr); gap: 6px; padding: 9px 10px 9px 13px; border-radius: 10px; }
  .task-row-card .task-due { grid-column: 2; }
  .filter-pills { width: 100%; }
  .seat-banner { display: block; padding: 12px; }
  .seat-banner > i { margin: 9px 0; }
  .seat-banner > div:first-child b { font-size: 21px; }
  .seat-actions { flex-direction: row; }
  .seat-actions button { flex: 1; padding: 0 8px; }
  .member-grid, .organization-grid { grid-template-columns: 1fr; gap: 7px; margin-top: 8px; }
  .member-card-v2 { min-height: 106px; padding: 12px; }
  .invite-options { grid-template-columns: 1fr; gap: 8px; }
  .invite-option { padding: 14px; }
  .invite-option h2 { margin: 12px 0 7px; font-size: 14px; }
  .invite-option p { min-height: 0; margin-bottom: 12px; font-size: 9px; }
  .rule-grid { grid-template-columns: 1fr; gap: 7px; }
  .rule-card { min-height: 112px; padding: 14px; }
  .rule-card h3 { margin: 12px 0 7px; }
  .rule-card small { margin-top: 10px; }
  .profile-card { grid-template-columns: 1fr; gap: 16px; padding: 14px; }
  .profile-details { text-align: center; }
  .profile-details dl div { grid-template-columns: 1fr; gap: 4px; text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full, .assignee-picker.full { grid-column: 1; }
  .platform-modal { max-height: 94dvh; border-radius: 14px; }
  .platform-modal > header { min-height: 62px; padding: 10px 14px; }
  .platform-modal > header h2 { font-size: 15px; }
  .modal-backdrop { align-items: end; padding: 8px; }
  .task-detail-body { grid-template-columns: 1fr; }
  .task-detail-main, .task-action-panel { padding: 14px; }
  .task-detail-main > h3 { margin: 12px 0; font-size: 15px; }
  .task-action-panel { border-top: 1px solid var(--line); border-left: 0; }
  .task-detail-main > dl { grid-template-columns: 1fr; }
  .assignment-item { grid-template-columns: 28px minmax(0,1fr); }
  .assignment-actions { grid-column: 2; }
  .toast { right: 10px; bottom: 72px; left: 10px; justify-content: center; }
}
