:root {
  --navy-950: #101b35;
  --navy-900: #172443;
  --navy-800: #213254;
  --blue-600: #2864dc;
  --blue-100: #eaf1ff;
  --green-600: #16805d;
  --green-100: #e5f6ef;
  --amber-600: #a55b09;
  --amber-100: #fff1d5;
  --violet-600: #7652c7;
  --violet-100: #f0ebff;
  --red-700: #a52a2a;
  --red-100: #fdeaea;
  --ink: #1a2538;
  --muted: #657086;
  --line: #dde3ec;
  --surface: #ffffff;
  --canvas: #f4f6fa;
  --shadow: 0 12px 35px rgb(20 38 75 / 8%);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input { font: inherit; }
a { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .75rem 1rem; background: white; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.eyebrow { margin: 0 0 .35rem; color: var(--blue-600); font-size: .73rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.eyebrow-light { color: #a9c5ff; }
.muted { color: var(--muted); }

.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 250px; flex-direction: column; padding: 1.4rem 1rem; color: #e9efff; background: var(--navy-950); }
.brand { display: flex; align-items: center; gap: .75rem; padding: .35rem .5rem; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 46px; place-items: center; color: white; font-size: 1.15rem; font-weight: 900; background: var(--blue-600); border-radius: 10px 10px 16px 16px; box-shadow: inset 0 0 0 2px rgb(255 255 255 / 18%); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; }
.brand small { color: #9eabc5; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.primary-nav { margin-top: 2.25rem; }
.nav-label { margin: 1.5rem .75rem .5rem; color: #7f8ba6; font-size: .65rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: .75rem; margin: .25rem 0; padding: .75rem; color: #b9c4da; border-radius: 9px; text-decoration: none; }
.nav-item:hover, .nav-item:focus-visible, .nav-item.is-active { color: white; background: var(--navy-800); outline: none; }
.sidebar-note { display: flex; align-items: center; gap: .65rem; margin-top: auto; padding: .8rem; color: #dce5f8; background: rgb(255 255 255 / 6%); border-radius: 10px; }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: .76rem; }
.sidebar-note small { color: #8f9db8; font-size: .68rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 auto; background: #31c48d; border-radius: 50%; box-shadow: 0 0 0 4px rgb(49 196 141 / 14%); }

.app-content { grid-column: 2; min-width: 0; }
.topbar { display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem clamp(1rem, 4vw, 3rem); background: white; border-bottom: 1px solid var(--line); }
.topbar-title { margin: 0; font-size: 1.15rem; font-weight: 750; }
.user-menu { display: flex; align-items: center; gap: .7rem; }
.avatar { display: grid; width: 38px; height: 38px; place-items: center; color: var(--navy-900); font-weight: 800; background: var(--blue-100); border-radius: 50%; }
.user-name strong, .user-name small { display: block; }
.user-name { min-width: 7rem; }
.user-name strong { font-size: .8rem; }
.user-name small { color: var(--muted); font-size: .68rem; }
.button { padding: .7rem 1rem; border: 0; border-radius: 9px; font-weight: 750; cursor: pointer; }
.button:focus-visible { outline: 3px solid rgb(40 100 220 / 30%); outline-offset: 2px; }
.button-quiet { color: var(--muted); background: #f1f3f7; }
.button-primary { color: white; background: var(--blue-600); box-shadow: 0 8px 18px rgb(40 100 220 / 22%); }
.button-primary:hover { background: #1c53c4; }
.button-full { width: 100%; }
.main-content { width: min(1440px, 100%); margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 3rem) 3rem; }

.demo-banner { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; padding: .7rem 1rem; color: #5c460f; background: #fff8df; border: 1px solid #ead38a; border-radius: 10px; }
.demo-banner p { margin: 0; font-size: .8rem; }
.demo-badge { padding: .2rem .45rem; color: white; font-size: .62rem; font-weight: 900; letter-spacing: .08em; background: var(--amber-600); border-radius: 5px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-heading h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.35rem); letter-spacing: -.035em; }
.page-heading p:last-child { margin: .5rem 0 0; color: var(--muted); }
.period-badge { display: flex; align-items: center; gap: .55rem; padding: .55rem .75rem; color: var(--green-600); font-size: .75rem; font-weight: 800; background: var(--green-100); border-radius: 999px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.summary-card { position: relative; overflow: hidden; padding: 1.2rem; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.summary-card::before { position: absolute; inset: 0 auto 0 0; width: 4px; content: ""; background: var(--blue-600); }
.summary-card p, .summary-card small { color: var(--muted); }
.summary-card p { margin: 0; font-size: .76rem; font-weight: 750; }
.summary-card strong { display: block; margin: .35rem 0 .25rem; font-size: 1.8rem; }
.summary-card small { font-size: .68rem; }
.tone-violet::before { background: var(--violet-600); }
.tone-amber::before { background: var(--amber-600); }
.tone-green::before { background: var(--green-600); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .8fr); gap: 1rem; }
.panel { min-width: 0; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 1rem; }
.panel-header .muted { font-size: .75rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .85rem 1.1rem; text-align: left; border-bottom: 1px solid #edf0f5; }
th { color: var(--muted); font-size: .67rem; letter-spacing: .04em; text-transform: uppercase; }
td { font-size: .76rem; }
tbody tr:last-child td { border-bottom: 0; }
.progress-label { margin-bottom: .25rem; color: var(--muted); font-size: .67rem; }
.progress { width: 110px; height: 5px; overflow: hidden; background: #e8ecf3; border-radius: 5px; }
.progress span { display: block; height: 100%; background: var(--blue-600); border-radius: inherit; }
.status-chip { display: inline-block; padding: .3rem .5rem; color: var(--blue-600); font-size: .65rem; font-weight: 750; background: var(--blue-100); border-radius: 999px; white-space: nowrap; }
.task-list { margin: 0; padding: .35rem 1.2rem; list-style: none; }
.task-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: .7rem; padding: 1rem 0; border-bottom: 1px solid #edf0f5; }
.task-list li:last-child { border: 0; }
.task-check { width: 17px; height: 17px; margin-top: .1rem; border: 2px solid #c8d0de; border-radius: 5px; }
.task-list strong, .task-list small { display: block; }
.task-list strong { font-size: .75rem; }
.task-list small { margin-top: .25rem; color: var(--muted); font-size: .66rem; line-height: 1.4; }
.task-priority { color: var(--muted); font-size: .63rem; font-weight: 750; white-space: nowrap; }

.auth-main { display: grid; min-height: 100vh; grid-template-columns: minmax(360px, 1.15fr) minmax(400px, .85fr); }
.auth-intro { position: relative; display: flex; overflow: hidden; flex-direction: column; padding: clamp(2rem, 5vw, 4.5rem); color: white; background: radial-gradient(circle at 80% 20%, #294a83 0, transparent 32%), linear-gradient(145deg, var(--navy-950), #1b315b); }
.auth-intro::after { position: absolute; right: -10rem; bottom: -12rem; width: 34rem; height: 34rem; content: ""; border: 1px solid rgb(255 255 255 / 9%); border-radius: 50%; box-shadow: 0 0 0 5rem rgb(255 255 255 / 3%), 0 0 0 10rem rgb(255 255 255 / 2%); }
.brand-light { align-self: flex-start; color: white; }
.brand-light small { color: #aebbd4; }
.auth-copy { position: relative; z-index: 1; width: min(620px, 100%); margin: auto 0; }
.auth-copy h1 { max-width: 13ch; margin: 0; font-size: clamp(2.3rem, 5vw, 4.7rem); line-height: 1.02; letter-spacing: -.055em; }
.auth-copy > p:not(.eyebrow) { max-width: 55ch; color: #c2cce0; line-height: 1.7; }
.feature-list { display: grid; gap: .8rem; margin: 2rem 0 0; padding: 0; list-style: none; color: #dbe4f6; }
.feature-list span { display: inline-grid; width: 24px; height: 24px; margin-right: .5rem; place-items: center; color: #7dd7b8; background: rgb(22 128 93 / 25%); border-radius: 50%; }
.auth-privacy { position: relative; z-index: 1; margin: auto 0 0; color: #93a2bd; font-size: .72rem; }
.auth-panel { display: grid; place-items: center; padding: clamp(1.5rem, 5vw, 5rem); background: #f7f8fb; }
.login-card { width: min(420px, 100%); padding: clamp(1.5rem, 4vw, 2.5rem); background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 70px rgb(16 27 53 / 12%); }
.login-card h2 { margin: 0; font-size: 2rem; letter-spacing: -.03em; }
.login-card > .muted { margin: .55rem 0 1.75rem; font-size: .85rem; }
.login-form { display: grid; gap: 1rem; }
.field label { display: block; margin-bottom: .4rem; font-size: .75rem; font-weight: 750; }
.field input { width: 100%; padding: .78rem .85rem; color: var(--ink); background: white; border: 1px solid #cfd6e2; border-radius: 9px; }
.field input:focus { border-color: var(--blue-600); outline: 3px solid rgb(40 100 220 / 13%); }
.alert { margin-bottom: 1rem; padding: .75rem; font-size: .78rem; border-radius: 8px; }
.alert-error { color: var(--red-700); background: var(--red-100); border: 1px solid #f3baba; }
.security-note { display: flex; gap: .7rem; margin-top: 1.5rem; padding-top: 1.25rem; color: var(--muted); border-top: 1px solid var(--line); }
.security-note p { margin: 0; font-size: .7rem; line-height: 1.4; }
.security-note strong { color: var(--ink); }

@media (max-width: 1000px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .auth-main { grid-template-columns: 1fr; }
  .auth-intro { min-height: 42vh; }
  .auth-copy { margin: 4rem 0; }
  .auth-copy h1 { font-size: clamp(2.2rem, 8vw, 4rem); }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; min-height: auto; }
  .primary-nav { margin-top: .75rem; }
  .nav-label, .sidebar-note { display: none; }
  .app-content { width: 100%; }
  .topbar { align-items: flex-start; }
  .user-name { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .summary-grid { grid-template-columns: 1fr; }
  .auth-intro { min-height: 34vh; padding: 1.5rem; }
  .auth-copy { margin: 3rem 0 1rem; }
  .auth-copy > p:not(.eyebrow), .feature-list, .auth-privacy { display: none; }
  .auth-panel { padding: 1rem; }
  .login-card { padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
