:root {
  color: #172033;
  background: #f4f6fa;
  font-family: Inter, Aptos, "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --navy: #10182b;
  --navy-soft: #263149;
  --blue: #3856e8;
  --teal: #00a58c;
  --pink: #ef315e;
  --purple: #8b5cf6;
  --amber: #f59e0b;
  --surface: #fff;
  --line: #e3e7ee;
  --muted: #687287;
  --shadow: 0 12px 34px rgba(28, 39, 67, 0.07);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #f4f6fa; }
body { min-width: 320px; min-height: 100vh; margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.58; }

.app-shell {
  min-height: 100vh;
  background: radial-gradient(circle at 92% 0%, rgba(56, 86, 232, 0.08), transparent 26rem), #f4f6fa;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 24, 43, 0.97);
  color: #fff;
  backdrop-filter: blur(12px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1480px, calc(100% - 48px));
  min-height: 70px;
  margin: 0 auto;
}

.brand-lockup { display: flex; align-items: center; gap: 9px; font-size: 1.05rem; font-weight: 740; letter-spacing: -0.015em; }
.brand-divider { color: #727d93; font-weight: 450; }
.c3-logo-crop { display: inline-block; flex: 0 0 42px; width: 42px; height: 25px; overflow: hidden; border-radius: 4px; background: #fff; }
.c3-logo-crop img { display: block; width: 42px; max-width: none; height: auto; transform: translateY(-1px); }
.brand-product { margin-left: 2px; padding: 4px 8px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; color: #b9c1d1; font-size: .75rem; font-weight: 600; }

.account-actions { display: flex; align-items: center; gap: 14px; }
.account-copy { display: grid; gap: 2px; text-align: right; }
.account-copy span { color: #9ca7ba; font-size: .72rem; }
.account-copy strong { max-width: 260px; overflow: hidden; font-size: .82rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { display: inline-grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: rgba(255,255,255,.07); color: #fff; }
.icon-button:hover { background: rgba(255,255,255,.12); }

.dashboard { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 28px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.eyebrow, .panel-kicker { color: var(--blue); font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.page-heading h1, .login-copy h1 { margin: 7px 0 6px; color: var(--navy); font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1.04; letter-spacing: -.045em; }
.page-heading h1 { font-size: clamp(2rem, 3vw, 2.7rem); }
.page-heading p, .login-copy p { max-width: 690px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.heading-actions { display: flex; gap: 10px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; font-size: .88rem; font-weight: 680; transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button svg, .icon-button svg, .security-note svg, .filter-title svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button--primary { background: var(--blue); box-shadow: 0 8px 18px rgba(56,86,232,.22); color: #fff; }
.button--primary:hover:not(:disabled) { background: #2e49d0; box-shadow: 0 10px 22px rgba(56,86,232,.28); }
.button--secondary { border-color: #d6dbe5; background: #fff; color: #354057; }
.button--dark { min-height: 40px; background: var(--navy); color: #fff; }
.button--large { width: 100%; min-height: 52px; font-size: .95rem; }

.filter-bar { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 22px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 16px rgba(26,37,62,.04); }
.filter-title { display: flex; align-items: center; align-self: center; gap: 8px; margin-right: 4px; color: var(--navy); font-size: .9rem; font-weight: 700; }
.filter-bar label { display: grid; gap: 5px; }
.filter-bar label span { color: var(--muted); font-size: .72rem; font-weight: 650; }
.filter-bar input { min-height: 40px; padding: 0 11px; border: 1px solid #d9dee7; border-radius: 9px; background: #fbfcfe; color: var(--navy); }
.filter-bar input:focus { border-color: var(--blue); outline: 3px solid rgba(56,86,232,.12); }
.freshness { display: flex; align-items: center; align-self: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: .8rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #14a87b; box-shadow: 0 0 0 4px rgba(20,168,123,.12); }

.inline-alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 13px 15px; border: 1px solid #ffd0da; border-radius: 11px; background: #fff3f6; color: #a41c3f; font-size: .88rem; line-height: 1.45; }
.inline-alert svg { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.inline-alert[hidden] { display: none; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { display: flex; align-items: flex-start; gap: 14px; min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.stat-card > div:last-child { min-width: 0; }
.stat-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 11px; }
.stat-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.stat-icon--blue { background: #edf0ff; color: var(--blue); }
.stat-icon--teal { background: #e9faf6; color: var(--teal); }
.stat-icon--pink { background: #fff0f4; color: var(--pink); }
.stat-icon--purple { background: #f2edff; color: var(--purple); }
.stat-card span { display: block; color: var(--muted); font-size: .76rem; font-weight: 650; }
.stat-card strong { display: block; margin: 6px 0 4px; overflow: hidden; color: var(--navy); font-size: clamp(1.35rem,2.2vw,1.85rem); line-height: 1; text-overflow: ellipsis; }
.stat-card small { color: #8a93a5; font-size: .72rem; }

.main-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,.75fr); gap: 20px; margin-bottom: 20px; }
.lower-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 20px; }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-header h2 { margin: 4px 0 0; color: var(--navy); font-size: 1.08rem; letter-spacing: -.015em; }
.panel-note { color: var(--muted); font-size: .76rem; }

.area-chart { width: 100%; min-height: 300px; }
.area-chart svg { display: block; width: 100%; height: 300px; overflow: visible; }
.chart-grid-line { stroke: #e9ecf2; stroke-width: 1; }
.chart-label { fill: #7b8496; font-size: 11px; }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#areaGradient); }
.chart-point { fill: #fff; stroke: var(--blue); stroke-width: 2; }

.donut-wrap { display: grid; place-items: center; min-height: 210px; }
.donut { position: relative; display: grid; width: 175px; height: 175px; place-items: center; border-radius: 50%; }
.donut::after { position: absolute; width: 104px; height: 104px; border-radius: 50%; background: #fff; content: ""; }
.donut-center { position: relative; z-index: 1; display: grid; gap: 3px; text-align: center; }
.donut-center strong { color: var(--navy); font-size: 1.35rem; }
.donut-center span { color: var(--muted); font-size: .7rem; }
.legend { display: grid; gap: 10px; margin-top: 4px; }
.legend-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; font-size: .77rem; }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; }
.legend-label { overflow: hidden; color: #4c566c; text-overflow: ellipsis; white-space: nowrap; }
.legend-value { color: var(--navy); font-weight: 700; }

.project-list { display: grid; gap: 14px; }
.project-row { display: grid; gap: 7px; }
.project-copy { display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: .78rem; }
.project-copy span { overflow: hidden; color: #4c566c; text-overflow: ellipsis; white-space: nowrap; }
.project-copy strong { color: var(--navy); font-size: .76rem; }
.project-track { height: 9px; overflow: hidden; border-radius: 999px; background: #edf0f5; }
.project-track i { display: block; min-width: 3px; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--blue),#7890ff); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th { padding: 0 12px 11px; color: #7b8497; font-size: .68rem; font-weight: 750; letter-spacing: .04em; text-align: right; text-transform: uppercase; }
th:first-child, td:first-child { padding-left: 0; text-align: left; }
td { padding: 12px; border-top: 1px solid #edf0f4; color: #505a70; text-align: right; white-space: nowrap; }
td:first-child { max-width: 280px; overflow: hidden; color: var(--navy); font-weight: 650; text-overflow: ellipsis; }
.empty-chart { display: grid; min-height: 220px; place-items: center; color: #8790a1; font-size: .84rem; text-align: center; }

.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(350px,520px) minmax(420px,1fr); background: #fff; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(36px,7vw,92px); }
.brand-lockup--login { margin-bottom: clamp(72px,12vh,130px); color: var(--navy); }
.login-copy { margin-bottom: 28px; }
.login-copy h1 { max-width: 470px; }
.login-copy p { max-width: 440px; }
.security-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.security-note svg { flex: 0 0 18px; color: var(--teal); }
.login-aside { position: relative; overflow: hidden; min-height: 100vh; background: radial-gradient(circle at 72% 30%, rgba(239,49,94,.46), transparent 24rem), radial-gradient(circle at 20% 74%, rgba(56,86,232,.62), transparent 29rem), #11192c; }
.login-aside::before, .login-aside::after { position: absolute; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; content: ""; }
.login-aside::before { top: -18vw; right: -13vw; width: 44vw; height: 44vw; }
.login-aside::after { bottom: -22vw; left: -15vw; width: 50vw; height: 50vw; }
.login-visual-card { position: absolute; z-index: 2; width: min(330px,42%); padding: 25px; border: 1px solid rgba(255,255,255,.13); border-radius: 19px; background: rgba(255,255,255,.1); box-shadow: 0 28px 70px rgba(0,0,0,.24); color: #fff; backdrop-filter: blur(18px); }
.login-visual-card > span { display: block; margin-bottom: 7px; color: rgba(255,255,255,.62); font-size: .73rem; }
.login-visual-card > strong { font-size: 1.32rem; }
.login-visual-card--one { top: 22%; left: 17%; transform: rotate(-3deg); }
.login-visual-card--two { right: 12%; bottom: 21%; transform: rotate(3deg); }
.mini-chart { display: flex; align-items: flex-end; gap: 8px; height: 105px; margin-top: 25px; }
.mini-chart i { flex: 1; border-radius: 5px 5px 2px 2px; background: linear-gradient(#ff809b,#ef315e); }
.scope-pill { margin-top: 22px; padding: 11px 13px; border-radius: 9px; background: rgba(0,165,140,.24); color: #b8fff1; font-size: .75rem; font-weight: 700; }
.scope-pill--muted { margin-top: 8px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); }

.state-screen { display: grid; min-height: 100vh; place-content: center; justify-items: center; gap: 18px; background: #f4f6fa; color: var(--muted); }
.loading-orbit { width: 38px; height: 38px; border: 3px solid #dce2ee; border-top-color: var(--blue); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .main-grid, .lower-grid { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: minmax(340px,500px) 1fr; }
  .login-visual-card { width: 58%; }
}

@media (max-width: 760px) {
  .topbar-inner, .dashboard { width: min(100% - 28px,1480px); }
  .account-copy, .brand-product, .brand-divider { display: none; }
  .dashboard { padding-top: 28px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar label, .filter-bar input { width: 100%; }
  .freshness { margin: 4px 0 0; }
  .stats-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .login-shell { display: block; }
  .login-panel { min-height: 100vh; padding: 34px 24px; }
  .brand-lockup--login { margin-bottom: 72px; }
  .login-aside { display: none; }
}

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