:root {
  --portal-ink: #172033;
  --portal-muted: #5b6c87;
  --portal-line: #d9e0eb;
  --portal-surface: #ffffff;
  --portal-bg: #f6f8fb;
  --portal-client: #146a73;
  --portal-advisor: #3d63cf;
}

body { background: var(--portal-bg); color: var(--portal-ink); letter-spacing: 0; overflow-x: hidden; }
.app-shell { display: grid; grid-template-columns: 72px 272px minmax(0, 1fr); min-height: 100vh; }
.rail { background: #101828; border-right: 1px solid #263247; }
.portal-brand { background: #d9f3ed; color: #102031; }
.rail .portal-brand { background: transparent; overflow: hidden; }
.portal-brand-logo { width: 44px; height: 44px; object-fit: contain; display: block; border-radius: inherit; }
.sidebar { background: var(--portal-surface); border-right: 1px solid var(--portal-line); }
.portal-copy { color: var(--portal-muted); line-height: 1.45; }
.panel { background: var(--portal-surface); border: 1px solid var(--portal-line); border-radius: 8px; box-shadow: 0 1px 1px rgb(16 24 40 / 0.02); }
.nav-button { border-radius: 8px; min-height: 42px; }
.nav-button.active { background: var(--portal-accent); color: #fff; box-shadow: 0 10px 18px rgb(20 92 102 / 0.12); }
.nav-button:not(.active) { color: #33425a; }
.nav-button:not(.active):hover { background: #f0f4f8; }
.nav-glyph { width: 20px; height: 20px; color: currentColor; display: grid; place-items: center; flex: 0 0 20px; }
.nav-glyph svg { width: 18px; height: 18px; stroke-width: 1.8; }
.topbar { min-height: 84px; border-bottom: 4px solid var(--portal-accent); background: rgb(246 248 251 / 0.96); }
.breadcrumb { color: var(--portal-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.portal-search { width: min(360px, 100%); background: #fff; border: 1px solid var(--portal-line); border-radius: 8px; height: 42px; padding: 0 12px; font-size: 14px; }
.topbar-controls { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; }
.topbar-controls > select { width: 210px; min-width: 120px; flex: 0 1 210px; }
.topbar-controls > .portal-search { width: 300px; min-width: 280px; flex: 1 1 300px; }
@media (max-width: 900px) { .topbar-controls { flex-wrap: wrap; } .topbar-controls > select, .topbar-controls > .portal-search { width: 100%; min-width: 0; flex: 1 1 100%; } }
.search-results { position: absolute; right: 0; top: calc(100% + 6px); width: min(420px, 100vw - 32px); max-height: 320px; overflow: auto; z-index: 20; }
.compact-table th { color: var(--portal-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; background: #f7f9fc; }
.compact-table tr:hover td { background: #fafcff; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; border: 1px solid color-mix(in srgb, currentColor 20%, transparent); border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap; }
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: 0.78; flex: 0 0 6px; }
.progress-track { height: 7px; border-radius: 999px; overflow: hidden; background: #e8edf4; }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: var(--portal-accent); }
.work-item { border: 1px solid var(--portal-line); border-radius: 8px; padding: 16px; }
.work-item + .work-item { margin-top: 12px; }
.timeline-step { position: relative; padding-left: 22px; }
.timeline-step::before { content: ''; position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--portal-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--portal-accent) 12%, white); }
.document-layout { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(0, 1.35fr); gap: 20px; align-items: start; }
.document-row { border-bottom: 1px solid #e8edf4; padding: 14px 16px; text-align: left; width: 100%; }
.document-row.active { background: #eef5f5; box-shadow: inset 3px 0 0 var(--portal-accent); }
.document-row:hover { background: #f7fafc; }
.filter-chip { border: 1px solid var(--portal-line); border-radius: 999px; padding: 6px 10px; color: #475467; font-size: 12px; font-weight: 700; }
.filter-chip.active { border-color: var(--portal-accent); background: color-mix(in srgb, var(--portal-accent) 8%, white); color: var(--portal-accent); }
.setting-switch { width: 46px; height: 26px; display: inline-flex; align-items: center; flex: 0 0 46px; cursor: pointer; }
.setting-switch > span { position: relative; display: block; width: 46px; height: 26px; border-radius: 999px; background: #d0d7e2; transition: background-color 140ms ease, box-shadow 140ms ease; }
.setting-switch > span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgb(16 24 40 / 0.28); transition: transform 140ms ease; }
.setting-switch > input:checked + span { background: var(--portal-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal-accent) 14%, transparent); }
.setting-switch > input:checked + span::after { transform: translateX(20px); }
.setting-switch > input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--portal-accent) 22%, transparent); outline-offset: 2px; }
.setting-switch > input:disabled + span { opacity: .5; cursor: not-allowed; }
.client-primary-button, .client-secondary-button, .client-text-button { font-size: 14px; font-weight: 700; line-height: 1; }
.client-primary-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border-radius: 8px; background: var(--portal-client); color: #fff; }
.client-primary-button:hover { background: #0e5961; }
.client-primary-button:disabled { opacity: .5; cursor: not-allowed; }
.client-secondary-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid var(--portal-line); border-radius: 8px; background: #fff; color: #344054; }
.client-secondary-button:hover { background: #f7fafc; border-color: #bdc7d8; }
.client-text-button { min-height: 34px; display: inline-flex; align-items: center; color: var(--portal-client); }
.client-text-button:hover { color: #0e5961; }
.advisor-primary-button, .advisor-secondary-button, .advisor-text-button, .advisor-icon-button { font-size: 14px; font-weight: 700; line-height: 1; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.advisor-primary-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border-radius: 8px; background: var(--portal-advisor); color: #fff; }
.advisor-primary-button:hover { background: #2f51b5; }
.advisor-primary-button:disabled { opacity: .5; cursor: not-allowed; }
.advisor-secondary-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid var(--portal-line); border-radius: 8px; background: #fff; color: #344054; }
.advisor-secondary-button:hover { background: #f7f9fc; border-color: #bdc7d8; }
.advisor-text-button { min-height: 34px; display: inline-flex; align-items: center; color: var(--portal-advisor); }
.advisor-text-button:hover { color: #2f51b5; }
.advisor-icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 1px solid var(--portal-line); border-radius: 8px; background: #fff; color: #475467; }
.advisor-icon-button:hover { background: #f7f9fc; }
.advisor-portal :is(button, a)[class*="bg-[#3d63cf]"][class*="text-white"], .advisor-portal :is(button, a)[class*="bg-[#145c66]"][class*="text-white"] { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--portal-advisor); color: #fff; line-height: 1; }
.advisor-portal :is(button, a)[class*="bg-[#3d63cf]"][class*="text-white"]:hover, .advisor-portal :is(button, a)[class*="bg-[#145c66]"][class*="text-white"]:hover { background: #2f51b5; }
.advisor-portal :is(button, a)[class*="bg-[#3d63cf]"][class*="text-white"]:disabled, .advisor-portal :is(button, a)[class*="bg-[#145c66]"][class*="text-white"]:disabled { opacity: .5; cursor: not-allowed; }
.advisor-portal :is(button, a)[class*="text-[#145c66]"][class*="font-bold"], .advisor-portal :is(button, a)[class*="text-[#3d63cf]"][class*="font-bold"] { min-height: 34px; display: inline-flex; align-items: center; color: var(--portal-advisor); line-height: 1; }
.advisor-portal :is(button, a)[class*="border"][class*="rounded-md"][class*="font-bold"] { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; border-color: var(--portal-line); background: #fff; color: #344054; line-height: 1; }
.advisor-portal button[class*="w-9"][class*="h-9"][class*="border"] { width: 36px; height: 36px; min-height: 36px; padding: 0; display: inline-grid; place-items: center; border-color: var(--portal-line); background: #fff; color: #475467; }
.client-workspaces { padding-top: 0; }
.client-portal .content:not(.client-workspaces) > section:nth-of-type(2), .client-portal .content:not(.client-workspaces) > section:nth-of-type(3), .client-portal .content:not(.client-workspaces) > section:nth-of-type(5), .client-portal .content:not(.client-workspaces) > section:nth-of-type(6), .client-portal .content:not(.client-workspaces) > section:nth-of-type(8), .client-portal .content:not(.client-workspaces) > section:nth-of-type(9), .client-portal .content:not(.client-workspaces) > section:nth-of-type(10) { display: none !important; }
.document-preview-wrap { min-height: 420px; background: #f7f9fc; }
.document-preview { display: block; width: 100%; min-height: 420px; border: 0; background: #fff; }
.document-preview-image { display: block; max-width: 100%; max-height: 620px; margin: 0 auto; object-fit: contain; }
.message-layout { display: grid; grid-template-columns: minmax(220px, .55fr) minmax(0, 1.45fr); min-height: 570px; }
.message-inbox { border-right: 1px solid var(--portal-line); background: #fbfcfe; }
.message-thread { display: block; width: 100%; padding: 14px 16px; border-bottom: 1px solid #e8edf4; text-align: left; }
.message-thread.active { background: #eef5f5; box-shadow: inset 3px 0 0 var(--portal-client); }
.message-stream { flex: 1; min-height: 300px; max-height: 520px; overflow: auto; padding: 20px; background: #fff; }
.message-bubble { max-width: min(88%, 640px); margin-bottom: 14px; padding: 12px 14px; border: 1px solid #e4e9f1; border-radius: 6px; background: #f8fafc; }
.message-bubble.own { margin-left: auto; border-color: #cce0e1; background: #eef8f7; }
.mobile-nav { display: none; }
.login-page { min-height: 100vh; background: var(--portal-bg); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 72px minmax(0, 1fr); }
.login-rail { background: #101828; border-right: 1px solid #263247; display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 16px; }
.login-rail-marker { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: rgb(255 255 255 / 0.1); color: #fff; font-size: 12px; font-weight: 800; }
.login-main { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.login-header { min-height: 84px; padding: 16px 28px; border-bottom: 4px solid var(--portal-client); background: rgb(246 248 251 / 0.96); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.login-language { min-width: 42px; height: 34px; border: 1px solid var(--portal-line); border-radius: 8px; background: #fff; color: #475467; font-size: 12px; font-weight: 800; }
.login-language:hover { background: #f0f4f8; }
.login-content { width: min(100%, 1040px); margin: auto; padding: 48px 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 430px); align-items: center; gap: 72px; }
.login-intro { max-width: 460px; }
.login-intro h1 { letter-spacing: 0; color: var(--portal-ink); }
.login-panel { padding: 28px; }
.login-input { width: 100%; height: 46px; border: 1px solid var(--portal-line); border-radius: 8px; padding: 0 12px; font-size: 14px; background: #fff; }
.login-input:focus { outline: 3px solid rgb(20 106 115 / 0.16); border-color: var(--portal-client); }
.login-submit { width: 100%; min-height: 46px; border-radius: 8px; background: var(--portal-client); color: #fff; font-size: 14px; font-weight: 800; }
.login-submit:hover { background: #0e5961; }
.login-submit:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 900px) { .app-shell { grid-template-columns: 64px minmax(0, 1fr); } .sidebar { display: none; } .document-layout { grid-template-columns: 1fr; } .message-layout { grid-template-columns: 1fr; } .message-inbox { border-right: 0; border-bottom: 1px solid var(--portal-line); max-height: 230px; overflow: auto; } }
@media (max-width: 720px) { .login-shell { display: block; } .login-rail { display: none; } .login-header { min-height: 76px; padding: 14px 18px; } .login-content { display: block; padding: 36px 18px; } .login-intro { margin-bottom: 28px; } .login-panel { padding: 22px; } }
@media (max-width: 640px) { .app-shell { display: block; } .rail { display: none; } .content { padding: 18px; } .topbar { position: static; padding: 18px; } .mobile-nav { display: flex; } .portal-search { width: 100%; } }
