:root {
  color-scheme: light;
  --canvas: #f6f7fa;
  --surface: #ffffff;
  --surface-soft: #f9fafc;
  --surface-blue: #f2f6ff;
  --text: #172033;
  --muted: #697386;
  --subtle: #98a2b3;
  --line: #e7eaf0;
  --line-strong: #d7dce5;
  --primary: #2256d9;
  --primary-dark: #173fa9;
  --primary-soft: #eaf0ff;
  --success: #17795b;
  --success-soft: #eaf8f2;
  --warning: #9a5b08;
  --warning-soft: #fff6df;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --violet: #6c48c5;
  --violet-soft: #f2edff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 12px rgba(16, 24, 40, .035);
  --shadow-md: 0 16px 44px rgba(16, 24, 40, .10);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(34, 86, 217, .22); outline-offset: 2px; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.connection-banner { position: fixed; z-index: 100; top: 0; left: 0; right: 0; padding: 9px 16px; text-align: center; color: #fff; background: var(--danger); font-size: 13px; font-weight: 700; }
.brand-lockup { display: flex; align-items: center; gap: 12px; letter-spacing: .02em; }
.brand-lockup strong, .brand-lockup small { display: block; }
.brand-lockup strong { font-size: 14px; letter-spacing: .12em; }
.brand-lockup small { margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .22em; }
.brand-mark { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #2d67ec, #153da9); box-shadow: 0 8px 20px rgba(34, 86, 217, .23); font-size: 13px; font-weight: 800; letter-spacing: -.02em; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(420px, .85fr); }
.login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 54px clamp(48px, 7vw, 108px); color: #fff; background: radial-gradient(circle at 12% 86%, rgba(68, 120, 249, .34), transparent 37%), radial-gradient(circle at 92% 8%, rgba(78, 110, 206, .25), transparent 31%), #101d3e; }
.login-brand::after { position: absolute; right: -160px; bottom: -140px; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.018); content: ""; }
.login-brand .brand-lockup { position: relative; z-index: 1; }
.login-brand .brand-lockup small { color: #aebbd8; }
.login-brand .brand-mark { color: #173668; background: #fff; box-shadow: none; }
.login-message { position: relative; z-index: 1; max-width: 650px; }
.environment-pill { display: inline-flex; padding: 7px 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: #c7d6fb; background: rgba(255,255,255,.06); font-size: 11px; font-weight: 750; letter-spacing: .13em; }
.login-message h1 { margin: 24px 0 18px; font-size: clamp(42px, 5vw, 68px); font-weight: 680; letter-spacing: -.055em; line-height: 1.02; }
.login-message p { max-width: 560px; margin: 0; color: #b5c1dc; font-size: 17px; line-height: 1.7; }
.login-feature-row { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 20px; color: #aebbd8; font-size: 12px; }
.login-feature-row span { display: flex; align-items: center; gap: 8px; }
.login-feature-row span::before { width: 6px; height: 6px; border-radius: 50%; background: #60a5fa; content: ""; }
.login-panel { display: grid; place-items: center; padding: 40px; background: #fbfcfe; }
.login-card { width: min(430px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-md); }
.mobile-brand { display: none; margin-bottom: 38px; }
.eyebrow { color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.login-card h2 { margin: 12px 0 9px; font-size: 34px; letter-spacing: -.035em; }
.login-card > p { margin: 0; color: var(--muted); line-height: 1.6; }
.google-button { min-height: 46px; margin-top: 28px; }
.form-message { min-height: 21px; margin-top: 12px !important; font-size: 13px; }
.form-message.is-error { color: var(--danger); }
.security-note { display: flex; gap: 10px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.security-note svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--success); fill: currentColor; stroke: none; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 700; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button--primary { color: #fff; background: var(--primary); box-shadow: 0 5px 14px rgba(34,86,217,.18); }
.button--primary:hover { background: var(--primary-dark); }
.button--secondary { border-color: var(--line-strong); background: var(--surface); }
.button--ghost { color: var(--muted); background: transparent; }
.button--wide { width: 100%; margin-top: 26px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: sticky; z-index: 30; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px 18px; border-right: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(16px); }
.sidebar-brand { padding: 0 8px 19px; }
.environment-strip { display: flex; align-items: center; gap: 7px; margin: 0 8px 19px; padding: 8px 10px; border-radius: 8px; color: #6d7788; background: #f4f6f9; font-size: 10px; font-weight: 800; letter-spacing: .095em; }
.environment-strip span { width: 7px; height: 7px; border-radius: 50%; background: #d99720; box-shadow: 0 0 0 3px #fff3d7; }
.primary-nav { display: grid; gap: 3px; }
.nav-item { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 10px; color: #5f6b7d; background: transparent; cursor: pointer; text-align: left; font-size: 13px; font-weight: 650; }
.nav-item:hover { color: var(--text); background: #f5f7fa; }
.nav-item.is-active { color: var(--primary); background: var(--primary-soft); }
.nav-item svg { width: 19px; height: 19px; }
.nav-item .nav-badge { min-width: 22px; margin-left: auto; padding: 2px 6px; border-radius: 999px; color: var(--primary); background: #fff; font-size: 10px; text-align: center; }
.sidebar-profile { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.profile-button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; }
.profile-button:hover { background: #f6f7f9; }
.profile-copy { min-width: 0; flex: 1; }
.profile-copy strong, .profile-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.profile-button > svg { width: 16px; height: 16px; color: var(--subtle); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #1e5ae4, #173da1); font-size: 11px; font-weight: 800; }
.logout-button { width: calc(100% - 16px); margin: 5px 8px 0; padding: 7px; border: 0; color: var(--muted); background: transparent; cursor: pointer; text-align: left; font-size: 11px; }
.logout-button:hover { color: var(--danger); }

.app-main { min-width: 0; }
.topbar { position: sticky; z-index: 20; top: 0; height: 74px; display: flex; align-items: center; gap: 18px; padding: 0 clamp(20px, 4vw, 48px); border-bottom: 1px solid rgba(231,234,240,.88); background: rgba(246,247,250,.9); backdrop-filter: blur(15px); }
.topbar-title { min-width: 0; display: flex; flex-direction: column; }
.topbar-title span { color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.topbar-title strong { margin-top: 2px; font-size: 17px; letter-spacing: -.01em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; box-shadow: var(--shadow-sm); }
.icon-button:hover { border-color: var(--line-strong); }
.menu-button { display: none; }
.notification-button { position: relative; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: #f04438; box-sizing: content-box; }
.search-trigger { min-width: 260px; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--surface); cursor: pointer; box-shadow: var(--shadow-sm); text-align: left; font-size: 12px; }
.search-trigger span { flex: 1; }
.search-trigger kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--subtle); background: var(--surface-soft); font-size: 10px; }
.page-content { width: min(1480px, 100%); margin: auto; padding: 34px clamp(20px, 4vw, 48px) 56px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-heading h1 { margin: 5px 0 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.04em; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.section-label { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.summary-card { position: relative; overflow: hidden; min-height: 145px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; transition: .18s ease; }
.summary-card:hover { transform: translateY(-2px); border-color: #d9deea; box-shadow: 0 10px 28px rgba(16,24,40,.075); }
.summary-card::after { position: absolute; right: -20px; bottom: -28px; width: 90px; height: 90px; border-radius: 50%; background: var(--card-tint, #eef3ff); content: ""; }
.summary-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.summary-card-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--card-color, var(--primary)); background: var(--card-tint, var(--primary-soft)); }
.summary-card-icon svg { width: 19px; height: 19px; }
.summary-card .trend { color: var(--success); font-size: 10px; font-weight: 800; }
.summary-value { position: relative; z-index: 1; margin-top: 18px; font-size: 30px; font-weight: 760; letter-spacing: -.04em; }
.summary-title { position: relative; z-index: 1; margin-top: 3px; color: var(--muted); font-size: 12px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 18px; margin-top: 18px; }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-header h2 { margin: 0; font-size: 15px; letter-spacing: -.015em; }
.panel-link { border: 0; color: var(--primary); background: transparent; cursor: pointer; font-size: 11px; font-weight: 750; }
.case-list { display: grid; gap: 10px; }
.case-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: .15s ease; }
.case-card:hover { border-color: #d4d9e4; box-shadow: var(--shadow-sm); }
.case-reference { color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.case-title { margin: 5px 0 4px; font-size: 14px; }
.case-meta { display: flex; flex-wrap: wrap; gap: 7px 12px; color: var(--muted); font-size: 11px; }
.case-meta span { display: inline-flex; align-items: center; gap: 5px; }
.case-meta span::before { width: 4px; height: 4px; border-radius: 50%; background: #a8b0bf; content: ""; }
.case-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 10px; }
.status-pill { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 999px; color: var(--pill-color, var(--primary)); background: var(--pill-bg, var(--primary-soft)); font-size: 9px; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.next-action { color: var(--muted); font-size: 11px; }
.case-card-action { align-self: center; }
.case-card-action .button { min-height: 36px; padding: 0 13px; font-size: 11px; }
.activity-list { display: grid; gap: 4px; }
.activity-item { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 9px 0; }
.activity-item:not(:last-child)::after { position: absolute; left: 15px; top: 41px; bottom: -4px; width: 1px; background: var(--line); content: ""; }
.activity-dot { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.activity-dot svg { width: 15px; height: 15px; }
.activity-copy strong { display: block; margin-top: 1px; font-size: 11px; }
.activity-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 18px; }
.quick-action { min-height: 68px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); cursor: pointer; }
.quick-action strong { font-size: 11px; }
.quick-action span { color: var(--muted); font-size: 9px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.segmented { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.segment { min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.segment.is-active { color: var(--primary); background: var(--primary-soft); }
.filter-input { min-height: 42px; flex: 1 1 260px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.placeholder-screen { display: grid; place-items: center; min-height: 430px; padding: 40px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: rgba(255,255,255,.55); text-align: center; }
.placeholder-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: auto; border-radius: 16px; color: var(--primary); background: var(--primary-soft); }
.placeholder-screen h2 { margin: 18px 0 7px; font-size: 19px; }
.placeholder-screen p { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.phase-chip { display: inline-flex; margin-top: 18px; padding: 7px 10px; border-radius: 999px; color: var(--warning); background: var(--warning-soft); font-size: 10px; font-weight: 800; }
.wizard { max-width: 920px; margin: auto; }
.wizard-progress { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin: 20px 0 26px; }
.wizard-progress span { height: 4px; border-radius: 999px; background: #e5e8ee; }
.wizard-progress span.is-active { background: var(--primary); }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 20px; }
.choice-card { min-height: 132px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; text-align: left; }
.choice-card:hover { border-color: #b9c9f2; box-shadow: var(--shadow-sm); }
.choice-card strong { display: block; margin-top: 15px; }
.choice-card span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.search-hero { max-width: 820px; margin: 48px auto 0; text-align: center; }
.search-hero h1 { font-size: 30px; letter-spacing: -.035em; }
.search-box-large { width: 100%; height: 58px; margin-top: 20px; padding: 0 20px; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 14px; }
.search-examples { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 10px; }
.empty-state { padding: 34px; color: var(--muted); text-align: center; font-size: 12px; }
.loading-skeleton { overflow: hidden; position: relative; min-height: 90px; border-radius: 12px; background: #edf0f5; }
.loading-skeleton::after { position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); animation: shimmer 1.25s infinite; content: ""; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.toast-region { position: fixed; z-index: 120; right: 20px; bottom: 20px; display: grid; gap: 9px; }
.toast { max-width: 340px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-md); font-size: 12px; }

@media (max-width: 1120px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr 1fr; }
  .login-brand { padding: 48px; }
  .login-message h1 { font-size: 46px; }
}

@media (max-width: 820px) {
  .login-layout { display: block; padding: 24px; background: var(--canvas); }
  .login-brand { display: none; }
  .login-panel { min-height: calc(100vh - 48px); padding: 0; background: transparent; }
  .mobile-brand { display: flex; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(290px, 86vw); transition: transform .2s ease; box-shadow: var(--shadow-md); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 25; inset: 0; display: block; background: rgba(11,18,34,.4); backdrop-filter: blur(2px); }
  .menu-button { display: grid; }
  .topbar { padding: 0 18px; }
  .search-trigger { min-width: 42px; width: 42px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .page-content { padding: 24px 18px 42px; }
}

@media (max-width: 600px) {
  .login-layout { padding: 0; }
  .login-panel { min-height: 100vh; }
  .login-card { min-height: 100vh; padding: 36px 24px; border: 0; border-radius: 0; box-shadow: none; }
  .topbar { height: 66px; }
  .topbar-title span { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .summary-card { min-height: 127px; padding: 15px; }
  .summary-value { margin-top: 13px; font-size: 25px; }
  .summary-title { font-size: 10px; }
  .panel { padding: 16px; }
  .case-card { grid-template-columns: 1fr; gap: 13px; }
  .case-card-action .button { width: 100%; }
  .quick-actions, .choice-grid { grid-template-columns: 1fr; }
  .toolbar .segmented { width: 100%; overflow-x: auto; }
  .segment { flex: 1 0 auto; }
  .wizard-progress { gap: 4px; }
  .toast-region { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: 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; }
}
