:root {
  color-scheme: light;
  --ink: #192334;
  --muted: #748096;
  --line: #e6eaf0;
  --surface: #fff;
  --canvas: #f5f7fb;
  --primary: #4c6fff;
  --primary-dark: #3658e8;
  --green: #14825d;
  --red: #c74747;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 15px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  height: 68px; padding: 0 28px; display: flex; align-items: center;
  justify-content: space-between; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; gap: 10px; align-items: center; font-weight: 750; letter-spacing: -.3px; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
  background: linear-gradient(140deg, #7189ff, #4c6fff); color: #fff; font-weight: 800; font-size: 22px;
  box-shadow: 0 8px 18px rgba(76,111,255,.2);
}
.brand-mark.small { width: 34px; height: 34px; border-radius: 11px; font-size: 17px; }
.account { display: flex; align-items: center; gap: 20px; }
.account-name { font-weight: 650; }
.app-shell { max-width: 1280px; margin: 0 auto; padding: 28px; display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 36px; }
.navigation { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.navigation a { color: #637086; padding: 11px 14px; border-radius: 10px; font-weight: 600; }
.navigation a:hover { background: #eaf0ff; color: var(--primary); }
.navigation a.active { background: #eaf0ff; color: var(--primary); }
.main-content { min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 5px 0 24px; }
.page-heading h1 { margin: 2px 0 4px; font-size: clamp(25px, 3vw, 32px); line-height: 1.2; letter-spacing: -.7px; }
.page-heading p { margin: 0; }
.eyebrow { color: var(--primary); font-weight: 750; font-size: 11px; letter-spacing: 1.2px; }
.muted { color: var(--muted); }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 15px; border-radius: 9px; border: 1px solid transparent; font-weight: 650; cursor: pointer; transition: .15s ease; }
.button.primary { color: #fff; background: var(--primary); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: #fff; border-color: var(--line); color: #42506a; }
.button.secondary:hover { border-color: #b9c5dc; background: #fafbff; }
.button.danger-outline { color: var(--red); border-color: #f0d7d7; background: #fff; }
.button.danger-outline:hover { background: #fff6f6; }
.button.full { width: 100%; }
.link-button { padding: 4px 0; border: 0; background: none; color: var(--primary); cursor: pointer; font-weight: 650; }
.link-button:hover { text-decoration: underline; }
.danger-link { color: var(--red); }
.inline { display: inline-flex; margin: 0; }
.dashboard-toolbar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.dashboard-filters { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: 10px; }
.dashboard-filters select { min-width: 0; }
.icon-button { width: 44px; height: 44px; padding: 0; flex: 0 0 44px; font-size: 28px; line-height: 1; }
.dashboard-add { position: relative; flex: 0 0 44px; }
.dashboard-add summary { list-style: none; }
.dashboard-add summary::-webkit-details-marker { display: none; }
.dashboard-add summary:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 3px; }
.dashboard-add > form { position: absolute; z-index: 4; right: 0; top: 54px; width: min(320px, calc(100vw - 28px)); box-shadow: 0 12px 30px rgba(36,54,94,.12); }

.panel, .task-card, .project-card, .empty-state {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.panel { padding: 22px; margin-bottom: 22px; }
.panel h2 { font-size: 17px; margin: 0 0 16px; }
.stack { display: flex; flex-direction: column; gap: 15px; }
label { display: flex; flex-direction: column; gap: 7px; font-weight: 650; color: #3a465b; font-size: 13px; }
input, select, textarea {
  width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #dfe4ec; border-radius: 9px;
  background: #fff; color: var(--ink); outline: none;
}
textarea { min-height: 85px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #8da3ff; box-shadow: 0 0 0 3px rgba(76,111,255,.12); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.member-picker { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.member-picker legend { padding: 0 5px; font-size: 13px; font-weight: 650; color: #3a465b; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.check-option { flex-direction: row; align-items: flex-start; gap: 9px; padding: 8px 4px; font-weight: 500; }
.check-option input { width: 17px; height: 17px; min-height: 17px; margin: 2px 0 0; accent-color: var(--primary); }
.check-option span { display: flex; flex-direction: column; }
.check-option small { color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.task-list { display: grid; gap: 12px; }
.task-card { padding: 18px 20px; }
.task-topline { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.project-label { font-size: 12px; font-weight: 700; color: var(--primary); }
.progress-label { color: var(--green); font-size: 12px; font-weight: 750; }
.task-card h2 { font-size: 16px; margin: 9px 0 13px; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 18px; color: var(--muted); font-size: 12px; margin-top: 5px; }
.progress-track { height: 5px; margin: 13px 0 0; background: #edf0f5; border-radius: 5px; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: linear-gradient(90deg, #778dff, #4c6fff); border-radius: inherit; }
.task-actions { margin-top: 14px; }
.task-actions .button { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.task-more { margin-top: 6px; }
.task-more > summary { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: auto; border-radius: 9px; color: var(--muted); cursor: pointer; list-style: none; }
.task-more > summary::-webkit-details-marker { display: none; }
.task-more > summary:hover { background: #edf1ff; color: var(--primary); }
.task-more > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.task-chevron { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s ease; }
.task-more[open] .task-chevron { transform: rotate(225deg); }
.task-more > .task-actions { margin-top: 0; }
.task-progress-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; }
.task-progress-form input[type="number"] { width: 76px; min-height: 36px; padding: 6px 8px; }
.section-actions { margin-bottom: 18px; }
.revenue-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 12px; }
.revenue-summary { display: grid; gap: 10px; }
.revenue-summary-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.revenue-summary-chip { display: inline-flex; align-items: center; width: 100%; min-width: 0; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #42506a; font-size: 13px; font-weight: 650; white-space: nowrap; }
.revenue-summary-chip:last-child { justify-content: flex-end; }
.revenue-card strong { overflow-wrap: anywhere; min-width: 0; }
.revenue-card .status-badge { flex-shrink: 0; }
.customer-picker { min-width: 0; }
.customer-picker-row { display: flex; align-items: flex-end; gap: 8px; }
.customer-picker-row > label { flex: 1; min-width: 0; }
.customer-picker-row select { min-width: 0; }
.customer-picker [hidden] { display: none; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state h2 { margin: 11px 0 4px; color: var(--ink); font-size: 18px; }
.empty-state p { margin: 0; }
.empty-icon { margin: 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--primary); background: #edf1ff; font-size: 22px; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.project-card { padding: 18px; }
.project-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: #edf1ff; color: var(--primary); font-size: 20px; }
.project-card h2 { margin: 12px 0 5px; font-size: 17px; }
.project-card > p { min-height: 42px; margin: 0; color: var(--muted); font-size: 13px; }
.project-stats { display: flex; gap: 15px; margin: 14px 0; color: var(--muted); font-size: 12px; }
.count-pill, .role-badge, .status-badge { border-radius: 99px; padding: 5px 10px; background: #f0f3f8; color: #59667b; font-size: 12px; font-weight: 650; white-space: nowrap; }
.breadcrumbs { display: flex; gap: 9px; margin: 2px 0 15px; color: var(--muted); font-size: 13px; }
.breadcrumbs a { color: var(--primary); }
.employee-list { display: flex; flex-direction: column; }
.employee-row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-top: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; display: grid; place-items: center; background: #edf1ff; color: var(--primary); font-weight: 750; }
.employee-info { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.employee-info span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.status-badge.enabled { background: #eaf7f0; color: var(--green); }
.status-badge.disabled { background: #fff0f0; color: var(--red); }
.alert { padding: 12px 15px; margin-bottom: 18px; border-radius: 10px; font-size: 13px; }
.alert.success { color: #126a4d; background: #e8f7ef; }
.alert.error { color: #9c3434; background: #fff0f0; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 20%, #edf1ff 0, var(--canvas) 42%); }
.login-card { width: min(100%, 410px); padding: 34px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 50px rgba(36,54,94,.08); }
.login-card .brand-mark { margin-bottom: 18px; }
.login-card .eyebrow { margin-bottom: 5px; }
.login-card h1 { margin: 0; font-size: 27px; letter-spacing: -.5px; }
.login-card .muted { margin: 5px 0 22px; }

@media (max-width: 760px) {
  .topbar { height: 60px; padding: 0 16px; }
  .account { gap: 12px; }
  .account-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .app-shell { display: block; padding: 18px 14px 30px; }
  .navigation { position: sticky; z-index: 3; top: 0; flex-direction: row; gap: 5px; margin: -18px -14px 20px; padding: 10px 14px; overflow-x: auto; background: rgba(245,247,251,.96); border-bottom: 1px solid var(--line); }
  .navigation a { flex: 0 0 auto; padding: 9px 12px; font-size: 13px; }
  .page-heading { align-items: flex-start; }
  .page-heading > .button { display: none; }
  .panel { padding: 17px; }
  .task-card { padding: 16px; }
  .project-grid { grid-template-columns: 1fr; }
  .employee-row { flex-wrap: wrap; gap: 9px; }
  .employee-info { flex-basis: calc(100% - 54px); }
  .employee-row .role-badge { margin-left: 47px; }
  .employee-row .status-badge { margin-right: auto; }
}
@media (max-width: 480px) {
  .revenue-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-toolbar { align-items: flex-start; }
  .dashboard-toolbar > .icon-button, .dashboard-add { margin-top: 26px; }
  .dashboard-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-filters > button { grid-column: 1 / -1; }
  .form-grid, .checkbox-grid { grid-template-columns: 1fr; }
  .page-heading { margin-top: 0; }
  .count-pill { margin-top: 8px; }
  .login-card { padding: 26px 21px; }
}
