:root {
  color-scheme: light;
  --ink: #17211f;
  --ink-soft: #344340;
  --muted: #66736f;
  --muted-2: #89938f;
  --canvas: #f5f6f3;
  --surface: #ffffff;
  --surface-soft: #f8f9f7;
  --surface-warm: #f4f1e9;
  --line: #e2e6e2;
  --line-strong: #cdd4cf;
  --accent: #1d5a54;
  --accent-hover: #154b46;
  --accent-soft: #e6f1ee;
  --accent-pale: #f1f8f6;
  --navy: #163c3a;
  --navy-deep: #102f2d;
  --success: #287454;
  --success-soft: #e8f4ed;
  --warning: #9a671d;
  --warning-soft: #fbf2df;
  --danger: #a9423f;
  --danger-soft: #faeceb;
  --info: #3b6385;
  --info-soft: #eaf1f7;
  --shadow-xs: 0 1px 2px rgb(18 47 45 / 5%);
  --shadow-sm: 0 4px 14px rgb(18 47 45 / 6%);
  --shadow-md: 0 16px 44px rgb(18 47 45 / 12%);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar-width: 248px;
  --transition: 170ms ease;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.mobile-only {
  display: none;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-weight: 650;
  transform: translateY(-140%);
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgb(29 90 84 / 25%);
  outline-offset: 2px;
}

::selection {
  background: #c7dfd9;
  color: var(--navy-deep);
}

/* Shared controls */

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled,
.icon-button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button svg {
  width: 18px;
  height: 18px;
}

.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.75;
  animation: spin 700ms linear infinite;
}

.button--primary {
  background: var(--accent);
  box-shadow: 0 1px 1px rgb(10 55 51 / 14%);
  color: #fff;
}

.button--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 5px 14px rgb(10 55 51 / 17%);
}

.button--secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
}

.button--secondary:hover:not(:disabled) {
  border-color: #acb9b3;
  background: var(--surface-soft);
}

.button--ghost {
  background: transparent;
  color: var(--muted);
}

.button--ghost:hover:not(:disabled) {
  background: var(--surface-soft);
  color: var(--ink);
}

.button--danger,
.button--danger-confirm {
  border-color: #e9c9c6;
  background: var(--danger-soft);
  color: var(--danger);
}

.button--danger-confirm {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.button--danger:hover:not(:disabled) {
  border-color: #dca5a2;
  background: #f8e2e0;
}

.button--danger-confirm:hover:not(:disabled) {
  background: #933633;
}

.button--wide {
  width: 100%;
}

.button--small {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition:
    color var(--transition),
    background var(--transition);
}

.icon-button:hover:not(:disabled) {
  background: var(--surface-soft);
}

.text-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.text-button:hover:not(:disabled) {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button svg {
  width: 16px;
  height: 16px;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.11em;
  line-height: 1.25;
  text-transform: uppercase;
}

.eyebrow--light {
  color: #a9cec6;
}

.icon-tile {
  display: inline-grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-tile--large {
  width: 48px;
  height: 48px;
  border-radius: 13px;
}

.icon-tile--calendar {
  align-self: start;
  background: var(--warning-soft);
  color: var(--warning);
}

.badge,
.status-badge,
.risk-badge,
.tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef1ee;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.status-badge::before,
.risk-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-badge--success,
.risk-badge--low {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge--warning,
.risk-badge--medium {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-badge--danger,
.risk-badge--high {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-badge--info {
  background: var(--info-soft);
  color: var(--info);
}

.tag {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
}

/* Forms */

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label,
.field-label-row label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.optional-label {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

input,
select {
  padding: 10px 12px;
}

textarea {
  min-height: 120px;
  padding: 12px 13px;
  line-height: 1.6;
  resize: vertical;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #acb7b2;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(29 90 84 / 11%);
}

input::placeholder,
textarea::placeholder {
  color: #99a29e;
}

select {
  padding-right: 36px;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.field-hint,
.field-error {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-error {
  color: var(--danger);
  font-weight: 600;
}

.input-with-icon {
  position: relative;
}

.input-with-icon > svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.input-with-icon input {
  padding-left: 42px;
}

.form-stack {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-label-row,
.textarea-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-label-row {
  margin-bottom: 7px;
}

.textarea-meta {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 11px;
}

.inline-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #d6e2dd;
  border-radius: 10px;
  background: var(--accent-pale);
  color: var(--ink-soft);
  font-size: 13px;
}

.inline-alert svg {
  width: 18px;
  min-width: 18px;
  height: 18px;
  color: var(--accent);
}

.inline-alert--error {
  border-color: #edcfcd;
  background: var(--danger-soft);
  color: var(--danger);
}

.inline-alert--warning {
  border-color: #ebd9b8;
  background: var(--warning-soft);
  color: #77511a;
}

/* Login */

.login-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  background: var(--surface);
}

.login-brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(34px, 5vw, 68px);
  background:
    radial-gradient(circle at 84% 17%, rgb(112 166 153 / 22%), transparent 31%),
    radial-gradient(circle at 10% 92%, rgb(208 191 151 / 14%), transparent 29%),
    linear-gradient(145deg, var(--navy), var(--navy-deep));
  color: #fff;
}

.login-brand-panel::after {
  position: absolute;
  right: -160px;
  bottom: -205px;
  width: 430px;
  height: 430px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 50%;
  box-shadow:
    0 0 0 55px rgb(255 255 255 / 2.5%),
    0 0 0 115px rgb(255 255 255 / 1.5%);
  content: "";
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  stroke: none;
}

.brand > span:last-child {
  display: grid;
  line-height: 1.05;
}

.brand strong {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand--light .brand-mark {
  background: rgb(255 255 255 / 12%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 12%);
}

.brand--light small {
  color: #a9c3be;
}

.login-promise {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 80px 0;
}

.login-promise h1 {
  margin-bottom: 22px;
  color: #fff;
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 620;
  letter-spacing: -0.045em;
}

.login-promise > p:not(.eyebrow) {
  max-width: 47ch;
  margin-bottom: 31px;
  color: #c4d4d0;
  font-size: 17px;
  line-height: 1.65;
}

.promise-list {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.promise-list li {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #e8efed;
  font-size: 13px;
  font-weight: 550;
}

.promise-list svg {
  width: 18px;
  height: 18px;
  padding: 3px;
  border-radius: 50%;
  background: rgb(142 198 185 / 18%);
  color: #8ec6b9;
  stroke-width: 2.5;
}

.login-footnote {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #8ca7a2;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.login-form-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 48px;
}

.login-card {
  width: min(100%, 430px);
}

.login-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 17px;
  margin-bottom: 34px;
}

.login-card-heading h2 {
  margin-bottom: 9px;
  font-size: 30px;
}

.login-card-heading p:last-child {
  margin: 0;
  color: var(--muted);
}

.login-card .field-group {
  margin-bottom: 23px;
}

.login-card .button {
  min-height: 48px;
}

.security-note,
.privacy-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 25px;
  padding-top: 21px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.security-note > svg,
.privacy-callout > svg {
  width: 19px;
  min-width: 19px;
  height: 19px;
  color: var(--success);
}

.security-note p,
.privacy-callout p {
  display: grid;
  gap: 2px;
  margin: 0;
  font-size: 12px;
}

.security-note strong,
.privacy-callout strong {
  color: var(--ink-soft);
  font-size: 12px;
}

/* Workspace shell */

.workspace {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 17px 17px;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}

.sidebar-header {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
}

.sidebar-close {
  display: none;
}

.environment-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 24px 7px 19px;
  padding: 8px 10px;
  border: 1px solid #e5e1d5;
  border-radius: 9px;
  background: #f8f5ed;
  color: #695e43;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.environment-pill > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b5944d;
  box-shadow: 0 0 0 3px rgb(181 148 77 / 12%);
}

.environment-pill small {
  margin-left: auto;
  color: #9c8f70;
  font-size: 8px;
}

.primary-nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
  transition:
    color var(--transition),
    background var(--transition);
}

.nav-item svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.7;
}

.nav-item:hover {
  background: #f0f3f0;
  color: var(--ink-soft);
}

.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.nav-item.is-active svg {
  stroke-width: 2;
}

.nav-count {
  min-width: 21px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--surface);
  color: var(--accent);
  font-size: 10px;
  text-align: center;
}

.sidebar-divider {
  height: 1px;
  margin: 22px 7px;
  background: var(--line);
}

.ai-sidebar-card {
  margin: 0 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.ai-sidebar-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 5px;
}

.ai-sidebar-heading > div {
  display: grid;
  line-height: 1.25;
}

.ai-sidebar-heading strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.ai-sidebar-heading small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.status-orb {
  width: 9px;
  min-width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 4px rgb(137 147 143 / 12%);
}

.ai-sidebar-card.is-on .status-orb {
  background: var(--success);
  box-shadow: 0 0 0 4px rgb(40 116 84 / 12%);
}

.ai-sidebar-card.is-off .status-orb {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgb(154 103 29 / 12%);
}

.ai-sidebar-card .text-button {
  min-height: 28px;
  font-size: 11px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 16px 5px 0;
  border-top: 1px solid var(--line);
}

.user-summary {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.user-summary > div {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.user-summary strong,
.user-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-summary strong {
  color: var(--ink-soft);
  font-size: 11px;
}

.user-summary small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  text-transform: capitalize;
}

.sidebar-footer .icon-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  color: var(--muted);
}

.workspace-column {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.mobile-header {
  display: none;
}

.main-content {
  min-height: 100vh;
  padding: 36px clamp(24px, 4vw, 56px) 64px;
}

.route-outlet {
  width: min(100%, 1360px);
  margin: 0 auto;
}

/* Page structure */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 29px;
}

.page-header h1 {
  margin-bottom: 7px;
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 650;
  letter-spacing: -0.04em;
}

.page-header p {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.date-context {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.date-context svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-size: 17px;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section-count {
  color: var(--muted);
  font-size: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.card--padded {
  padding: 21px;
}

.card--soft {
  background: var(--surface-soft);
}

.divider {
  height: 1px;
  margin: 20px 0;
  background: var(--line);
}

/* Loading, empty and error states */

.loading-page {
  display: grid;
  gap: 24px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  background: #e8ece8;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 62%), transparent);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.35s infinite;
}

.skeleton--title {
  width: 230px;
  height: 34px;
}

.skeleton--text {
  width: 340px;
  max-width: 80%;
  height: 14px;
}

.skeleton--panel {
  height: 360px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.skeleton-card {
  height: 126px;
  border-radius: var(--radius);
}

.empty-state,
.error-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  padding: 45px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.empty-state__content,
.error-state__content {
  display: grid;
  max-width: 410px;
  justify-items: center;
}

.empty-state .icon-tile,
.error-state .icon-tile {
  width: 52px;
  height: 52px;
  margin-bottom: 17px;
  border-radius: 15px;
}

.empty-state h2,
.empty-state h3,
.error-state h2 {
  margin-bottom: 8px;
  font-size: 19px;
}

.empty-state p,
.error-state p {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
}

.error-state .icon-tile {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Dashboard */

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 16px;
  margin-bottom: 22px;
}

.briefing-card {
  position: relative;
  overflow: hidden;
  padding: 25px 27px;
  border: 0;
  background:
    radial-gradient(circle at 93% 12%, rgb(143 196 184 / 20%), transparent 31%),
    linear-gradient(135deg, var(--navy), #1b4945);
  color: #fff;
}

.briefing-card::after {
  position: absolute;
  right: -45px;
  bottom: -90px;
  width: 210px;
  height: 210px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 50%;
  box-shadow: 0 0 0 33px rgb(255 255 255 / 2%);
  content: "";
}

.briefing-card .eyebrow {
  color: #9fc7be;
}

.briefing-card h2 {
  max-width: 640px;
  margin-bottom: 13px;
  color: #fff;
  font-size: clamp(21px, 2.3vw, 28px);
  font-weight: 600;
}

.briefing-card > p {
  max-width: 66ch;
  margin-bottom: 22px;
  color: #c5d7d3;
  font-size: 13px;
  line-height: 1.65;
}

.briefing-points {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.briefing-point {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 8px;
  background: rgb(255 255 255 / 7%);
  color: #e2ece9;
  font-size: 11px;
}

.briefing-point strong {
  color: #fff;
  font-size: 12px;
}

.capture-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  background: var(--surface);
}

.capture-card .icon-tile {
  margin-bottom: 18px;
}

.capture-card h2 {
  margin-bottom: 7px;
  font-size: 18px;
}

.capture-card p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
}

.capture-actions {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
}

.capture-actions .icon-button {
  border: 1px solid var(--line-strong);
  color: var(--accent);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.metric-card {
  padding: 17px 18px;
}

.metric-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.metric-card__top > span:first-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.metric-card__icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.metric-card__icon svg {
  width: 16px;
  height: 16px;
}

.metric-card__value {
  margin-bottom: 5px;
  font-size: 27px;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
  letter-spacing: -0.04em;
  line-height: 1;
}

.metric-card__caption {
  color: var(--muted-2);
  font-size: 10px;
}

.metric-card.is-alert .metric-card__value {
  color: var(--danger);
}

.metric-card.is-alert .metric-card__icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.75fr);
  gap: 18px;
}

.work-list,
.overdue-list,
.case-list,
.audit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-list-item,
.overdue-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 70px;
  padding: 13px 17px;
  border-top: 1px solid var(--line);
  transition: background var(--transition);
}

.work-list-item:first-child,
.overdue-item:first-child {
  border-top: 0;
}

.work-list-item:hover,
.overdue-item:hover {
  background: var(--surface-soft);
}

.work-list-item > a,
.overdue-item > a {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.task-marker {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.task-marker svg {
  width: 17px;
  height: 17px;
}

.task-marker--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.work-list-main,
.overdue-main {
  min-width: 0;
}

.work-list-main strong,
.overdue-main strong {
  display: block;
  overflow: hidden;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-list-main span,
.overdue-main span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-list-time,
.overdue-time {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.overdue-time {
  color: var(--danger);
}

.card-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px;
  border-bottom: 1px solid var(--line);
}

.card-list-header h2 {
  margin: 0;
  font-size: 16px;
}

.compact-empty {
  padding: 35px 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Cases */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.search-field {
  position: relative;
  flex: 1;
  max-width: 390px;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.search-field input {
  padding-left: 39px;
  background: var(--surface);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  transition:
    color var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: #b9cdc7;
  background: var(--accent-soft);
  color: var(--accent);
}

.cases-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(450px, 1.22fr);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.case-queue {
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}

.case-queue-header {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.case-list-item {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background var(--transition);
}

.case-list-item:hover,
.case-list-item.is-active {
  background: var(--surface);
}

.case-list-item.is-active::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  content: "";
}

.case-list-item > a {
  display: block;
  padding: 16px 17px;
}

.case-list-top,
.case-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.case-list-top {
  margin-bottom: 7px;
}

.case-list-top strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-list-action {
  overflow: hidden;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-list-meta {
  color: var(--muted-2);
  font-size: 10px;
}

.priority-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--muted-2);
}

.priority-dot--high {
  background: var(--danger);
}

.priority-dot--urgent {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgb(169 66 63 / 10%);
}

.priority-dot--normal {
  background: var(--info);
}

.priority-dot--low {
  background: var(--success);
}

.case-detail-panel {
  min-width: 0;
  background: var(--surface);
}

.case-detail-empty {
  display: grid;
  min-height: 610px;
  place-items: center;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.case-detail-empty .icon-tile {
  margin-bottom: 14px;
}

.case-detail-empty h2 {
  margin-bottom: 7px;
  font-size: 18px;
}

.case-detail-empty p {
  max-width: 320px;
  margin: 0;
  font-size: 12px;
}

.case-detail {
  padding: 26px;
}

.case-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.case-detail-header h2 {
  margin: 5px 0 8px;
  font-size: 23px;
}

.case-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.case-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.case-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.case-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 20px 0;
}

.summary-field {
  min-width: 0;
  padding: 13px;
  border-radius: 9px;
  background: var(--surface-soft);
}

.summary-field span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.summary-field strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.summary-field.is-danger strong {
  color: var(--danger);
}

.next-action-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px;
  border: 1px solid #d9e7e2;
  border-radius: 10px;
  background: var(--accent-pale);
}

.next-action-card > svg {
  width: 19px;
  min-width: 19px;
  height: 19px;
  color: var(--accent);
}

.next-action-card p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.detail-section {
  padding-top: 22px;
}

.activity-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 18px;
}

.activity-item:not(:last-child)::before {
  position: absolute;
  top: 28px;
  bottom: 0;
  left: 13px;
  width: 1px;
  background: var(--line);
  content: "";
}

.activity-dot {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
}

.activity-dot svg {
  width: 13px;
  height: 13px;
}

.activity-copy strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 12px;
}

.activity-copy p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
}

.activity-copy time {
  color: var(--muted-2);
  font-size: 9px;
}

/* Mini CRM */

.crm-dashboard-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid #d9e7e2;
  border-radius: var(--radius);
  background: var(--accent-pale);
  transition:
    border-color var(--transition),
    background var(--transition);
}

.crm-dashboard-link:hover {
  border-color: #b9d2ca;
  background: #ebf5f2;
}

.crm-dashboard-link > div {
  display: grid;
  min-width: 0;
}

.crm-dashboard-link strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.crm-dashboard-link span,
.crm-dashboard-link small {
  color: var(--muted);
  font-size: 11px;
}

.crm-dashboard-link > svg {
  width: 17px;
  color: var(--accent);
}

.crm-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.crm-overview > div {
  display: grid;
  gap: 4px;
  padding: 15px 17px;
  border-left: 1px solid var(--line);
}

.crm-overview > div:first-child {
  border-left: 0;
}

.crm-overview span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.crm-overview strong {
  color: var(--ink-soft);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.crm-toolbar {
  margin-top: 0;
}

.clients-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(590px, 1.55fr);
  min-height: 720px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.client-directory {
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}

.client-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.client-list-item {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.client-list-item.is-active {
  background: var(--surface);
}

.client-list-item.is-active::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  content: "";
}

.client-list-item > a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 15px 14px 15px 17px;
  transition: background var(--transition);
}

.client-list-item > a:hover {
  background: var(--surface);
}

.client-avatar {
  width: 39px;
  min-width: 39px;
  height: 39px;
  background: #dfece8;
  color: var(--accent);
}

.client-list-copy {
  display: grid;
  min-width: 0;
}

.client-list-copy > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.client-list-copy strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-list-copy .status-badge {
  flex: none;
  padding: 2px 6px;
  font-size: 8px;
}

.client-list-copy > span,
.client-list-copy > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-list-copy > span {
  margin-top: 4px;
}

.client-list-copy > small {
  margin-top: 2px;
  color: var(--muted-2);
}

.client-list-signal {
  display: grid;
  justify-items: end;
  color: var(--muted-2);
}

.client-list-signal strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.client-list-signal span {
  font-size: 8px;
}

.client-list-signal.has-attention strong {
  color: var(--warning);
}

.client-detail-panel {
  min-width: 0;
}

.client-detail-empty {
  min-height: 720px;
}

.client-detail {
  padding: 25px 27px 32px;
}

.client-profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 19px;
}

.client-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.avatar--large {
  width: 53px;
  min-width: 53px;
  height: 53px;
  background: var(--navy);
  font-size: 14px;
}

.client-identity h2 {
  margin: 3px 0 7px;
  font-size: 23px;
}

.tag--safe {
  border-color: #d4e6de;
  background: var(--success-soft);
  color: var(--success);
}

.client-contact-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.client-contact-bar span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}

.client-contact-bar svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.company-link-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid #e6dfcf;
  border-radius: 9px;
  background: var(--surface-warm);
}

.company-link-card > svg {
  width: 19px;
  min-width: 19px;
  color: #806b3c;
}

.company-link-card > div {
  display: grid;
}

.company-link-card span,
.company-link-card small {
  color: #81765d;
  font-size: 9px;
}

.company-link-card strong {
  color: #554c38;
  font-size: 12px;
}

.client-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  padding: 17px 0;
}

.client-metric-grid article {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px;
  border-radius: 9px;
  background: var(--surface-soft);
}

.client-metric-grid span,
.client-metric-grid small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-metric-grid strong {
  color: var(--ink-soft);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.crm-next-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-bottom: 17px;
  padding: 13px;
  border: 1px solid #d5e7e1;
  border-radius: 10px;
  background: var(--accent-pale);
}

.crm-next-action > svg {
  width: 19px;
  color: var(--accent);
}

.crm-next-action > div {
  display: grid;
}

.crm-next-action span,
.crm-next-action small {
  color: var(--muted);
  font-size: 9px;
}

.crm-next-action strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.client-work-grid,
.client-records-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 13px;
}

.crm-section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.crm-section + .crm-section,
.crm-contracts-section {
  margin-bottom: 13px;
}

.client-work-grid .crm-section,
.client-records-grid .crm-section {
  margin-bottom: 0;
}

.crm-section-header {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fcfdfc;
}

.crm-section-header h3 {
  margin: 0;
  font-size: 14px;
}

.crm-section-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.crm-action-list,
.crm-date-list,
.crm-document-list,
.crm-note-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.crm-action-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
}

.crm-action-list li:first-child,
.crm-date-list li:first-child,
.crm-document-list li:first-child,
.crm-note-list li:first-child {
  border-top: 0;
}

.crm-action-list .task-marker {
  width: 29px;
  height: 29px;
}

.crm-action-list .task-marker svg {
  width: 14px;
}

.crm-action-list div,
.crm-date-list div,
.crm-document-list div {
  display: grid;
  min-width: 0;
}

.crm-action-list strong,
.crm-date-list strong,
.crm-document-list strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-action-list span,
.crm-date-list span,
.crm-document-list span,
.crm-document-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-action-list time {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.crm-action-list li.is-overdue time {
  color: var(--danger);
}

.crm-date-list li {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
}

.crm-date-list time {
  display: grid;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.crm-date-list time strong {
  font-size: 9px;
}

.contract-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.contract-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.contract-card--life {
  border-color: #eadcde;
  background: #fdf8f8;
}

.contract-card--property {
  border-color: #dbe4eb;
  background: #f7fafc;
}

.contract-card header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.contract-card header > div {
  display: grid;
  min-width: 0;
}

.contract-card header span:not(.contract-icon, .status-badge) {
  color: var(--muted);
  font-size: 8px;
}

.contract-card header strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-icon,
.file-type-icon {
  display: grid;
  width: 31px;
  min-width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
}

.contract-icon svg,
.file-type-icon svg {
  width: 15px;
  height: 15px;
}

.contract-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 9px;
}

.contract-card dl div {
  min-width: 0;
}

.contract-card dt {
  color: var(--muted-2);
  font-size: 8px;
}

.contract-card dd {
  overflow: hidden;
  margin: 1px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-card > p {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 9px;
}

.contract-card > p svg {
  width: 12px;
  height: 12px;
}

.contract-card > small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.crm-document-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 61px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
}

.crm-note-list li {
  padding: 11px 13px;
  border-top: 1px solid var(--line);
}

.crm-note-list p {
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.crm-note-list span {
  color: var(--muted-2);
  font-size: 8px;
}

.crm-case-links {
  display: grid;
}

.crm-case-links a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
}

.crm-case-links a:first-child {
  border-top: 0;
}

.crm-case-links a:hover {
  background: var(--surface-soft);
}

.crm-case-links a > div {
  display: grid;
  min-width: 0;
}

.crm-case-links strong {
  color: var(--ink-soft);
  font-size: 10px;
}

.crm-case-links span:not(.status-badge) {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-case-links > a > svg {
  width: 14px;
  color: var(--muted);
}

.client-detail-loading {
  display: grid;
  gap: 9px;
  padding: 25px 0;
  color: var(--muted);
  font-size: 10px;
}

.form-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Proposals */

.approval-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid #e6dbc0;
  border-radius: 10px;
  background: #fbf7ee;
}

.approval-summary > svg {
  width: 20px;
  min-width: 20px;
  height: 20px;
  color: var(--warning);
}

.approval-summary p {
  margin: 0;
  color: #6f5a32;
  font-size: 12px;
}

.approval-summary strong {
  color: #59461f;
}

.proposal-stack {
  display: grid;
  gap: 17px;
}

.proposal-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.proposal-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.proposal-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.proposal-title-row .icon-tile {
  width: 38px;
  min-width: 38px;
  height: 38px;
}

.proposal-title-row h2,
.proposal-title-row h3 {
  margin: 1px 0 4px;
  font-size: 16px;
}

.proposal-title-row p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.proposal-card__body {
  padding: 20px;
}

.proposal-context-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  gap: 13px;
  margin-bottom: 18px;
}

.source-box,
.match-box,
.calendar-summary-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.context-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.context-label svg {
  width: 13px;
  height: 13px;
}

.source-quote {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-style: italic;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.source-quote + .text-button {
  margin-top: 7px;
}

.match-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.match-main strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 12px;
}

.match-main span {
  color: var(--muted);
  font-size: 10px;
}

.confidence-ring {
  position: relative;
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  color: var(--success);
  font-size: 9px;
  font-weight: 750;
}

.confidence-ring span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--ink-soft);
}

.confidence-chart {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
  overflow: visible;
  transform: rotate(-90deg);
}

.confidence-chart circle {
  fill: none;
  stroke: #e5e9e6;
  stroke-width: 3;
}

.confidence-chart .confidence-chart__value {
  stroke: var(--success);
  stroke-linecap: round;
}

.actions-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
}

.actions-heading h3 {
  margin: 0;
  font-size: 13px;
}

.actions-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.select-controls {
  display: flex;
  gap: 10px;
}

.proposal-actions {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.proposal-action {
  display: grid;
  grid-template-columns: 20px 36px minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--transition);
}

.proposal-action:first-child {
  border-top: 0;
}

.proposal-action:hover {
  background: var(--surface-soft);
}

.proposal-action.is-disabled {
  cursor: default;
  opacity: 0.68;
}

.proposal-action.is-disabled:hover {
  background: transparent;
}

.proposal-action.is-external {
  background: #fdf9f0;
}

.proposal-action.is-external:hover {
  background: #fcf6e9;
}

.proposal-action input {
  margin-top: 8px;
}

.action-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.action-icon svg {
  width: 16px;
  height: 16px;
}

.proposal-action.is-external .action-icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.action-copy strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 12px;
}

.action-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.action-copy code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  padding: 1px 4px;
  border-radius: 4px;
  background: #edf0ed;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 10px;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.separate-approval-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  color: var(--warning);
  font-size: 9px;
  font-weight: 650;
}

.separate-approval-note svg {
  width: 12px;
  height: 12px;
}

.proposal-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fcfdfb;
}

.proposal-selection-count {
  color: var(--muted);
  font-size: 10px;
}

.proposal-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transcript-editor {
  margin-top: 15px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.transcript-editor header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.transcript-editor h3 {
  margin: 0;
  font-size: 13px;
}

.transcript-editor textarea {
  min-height: 145px;
  background: var(--surface);
  font-size: 12px;
}

.transcript-editor footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
}

.transcript-version {
  color: var(--muted-2);
  font-size: 10px;
}

.proposal-result {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 20px;
  border-top: 1px solid #cce1d4;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12px;
}

.proposal-result.is-rejected {
  border-color: #ead0cf;
  background: var(--danger-soft);
  color: var(--danger);
}

.proposal-result svg {
  width: 18px;
  min-width: 18px;
  height: 18px;
}

/* Audit */

.audit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.audit-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.audit-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.audit-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.audit-legend span:nth-child(2) i {
  background: var(--warning);
}

.audit-legend span:nth-child(3) i {
  background: var(--info);
}

.audit-card {
  padding: 7px 22px;
}

.audit-day {
  padding: 17px 0 9px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audit-event {
  position: relative;
  display: grid;
  grid-template-columns: 78px 34px minmax(0, 1fr) auto;
  gap: 11px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.audit-event:last-child {
  border-bottom: 0;
}

.audit-time {
  padding-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.audit-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.audit-icon svg {
  width: 15px;
  height: 15px;
}

.audit-icon--approval {
  background: var(--warning-soft);
  color: var(--warning);
}

.audit-icon--system {
  background: var(--info-soft);
  color: var(--info);
}

.audit-copy strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 12px;
}

.audit-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.audit-copy code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.audit-result {
  align-self: start;
}

.audit-trace-details {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.audit-trace-details summary {
  width: max-content;
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.audit-trace-details dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 10px;
  margin: 8px 0 0;
}

.audit-trace-details dt {
  color: var(--muted-2);
}

.audit-trace-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.outbox-card {
  margin-top: 18px;
  padding: 7px 22px;
}

.outbox-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.outbox-event:last-child {
  border-bottom: 0;
}

.outbox-event strong,
.outbox-event span,
.outbox-event code {
  display: block;
}

.outbox-event strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.outbox-event span,
.outbox-event code {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.outbox-event code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Dialogs */

.dialog {
  width: min(calc(100vw - 32px), 570px);
  max-height: min(88vh, 850px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.dialog--wide {
  width: min(calc(100vw - 32px), 680px);
}

.dialog::backdrop {
  background: rgb(9 30 28 / 48%);
  backdrop-filter: blur(3px);
}

.dialog[open] {
  animation: dialog-in 180ms ease-out;
}

.dialog-surface {
  display: flex;
  max-height: min(88vh, 850px);
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-header > div:not(.icon-tile) {
  min-width: 0;
  flex: 1;
}

.dialog-header h2 {
  margin-bottom: 6px;
  font-size: 21px;
}

.dialog-header p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.dialog-header .icon-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  margin: -7px -7px 0 auto;
  color: var(--muted);
}

.dialog-body {
  display: grid;
  gap: 19px;
  padding: 21px 24px;
  overflow-y: auto;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #fcfdfb;
}

.source-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border-radius: 10px;
  background: #eff2ef;
}

.source-tab {
  display: flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.source-tab svg {
  width: 16px;
  height: 16px;
}

.source-tab.is-active {
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--accent);
}

.recorder-card {
  padding: 15px;
  border: 1px solid #c9ddd7;
  border-radius: 12px;
  background: var(--accent-pale);
  transition:
    border-color var(--transition),
    background var(--transition);
}

.recorder-card.is-recording {
  border-color: #d7aaa7;
  background: #fff7f6;
}

.recorder-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.recorder-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}

.recorder-icon svg {
  width: 19px;
  height: 19px;
}

.recorder-copy {
  min-width: 0;
}

.recorder-copy strong,
.recorder-copy span {
  display: block;
}

.recorder-copy strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.recorder-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.recording-indicator {
  width: 14px;
  height: 14px;
  margin: 14px;
  border: 3px solid #f1c4c1;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 5px rgb(169 66 63 / 9%);
  animation: recording-pulse 1.5s ease-in-out infinite;
}

.audio-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 13px 0;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.audio-divider::before,
.audio-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.upload-zone {
  display: grid;
  min-height: 185px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: pointer;
  text-align: center;
  transition:
    border-color var(--transition),
    background var(--transition);
}

.upload-zone:hover,
.upload-zone.is-dragover,
.upload-zone:focus-within {
  border-color: var(--accent);
  background: var(--accent-pale);
}

.upload-zone--compact {
  min-height: 118px;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  place-items: start;
  align-content: center;
  column-gap: 12px;
  padding: 17px 20px;
  text-align: left;
}

.upload-zone--compact .upload-icon {
  grid-row: 1 / span 2;
  margin: 0;
}

.upload-zone--compact strong {
  align-self: end;
}

.upload-zone--compact > span:last-of-type {
  align-self: start;
}

.upload-zone.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.upload-zone strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.upload-zone > span:last-of-type {
  color: var(--muted);
  font-size: 10px;
}

.upload-icon {
  display: grid;
  width: 45px;
  height: 45px;
  margin-bottom: 3px;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.file-summary {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.file-summary__inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-summary__copy {
  min-width: 0;
  flex: 1;
}

.file-summary__copy strong,
.file-summary__copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-summary__copy strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.file-summary__copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.audio-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.audio-preview audio {
  width: 100%;
  min-width: 0;
  height: 38px;
}

.audio-preview .text-button {
  white-space: nowrap;
}

.privacy-callout {
  margin: 0;
  padding: 13px;
  border: 0;
  border-radius: 9px;
  background: var(--accent-pale);
}

.ai-control-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.ai-control-card h3 {
  margin-bottom: 4px;
  font-size: 14px;
}

.ai-control-card p {
  max-width: 370px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 48px;
  min-width: 48px;
  height: 28px;
  align-items: center;
  padding: 3px;
  border: 0;
  border-radius: 99px;
  background: #b7bfbb;
  cursor: pointer;
  transition: background var(--transition);
}

.switch::after {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 18%);
  content: "";
  transition: transform var(--transition);
}

.switch[aria-checked="true"] {
  background: var(--success);
}

.switch[aria-checked="true"]::after {
  transform: translateX(20px);
}

.ai-capability-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-capability-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}

.ai-capability-list svg {
  width: 16px;
  height: 16px;
  color: var(--success);
}

.ai-capability-list li.is-off svg {
  color: var(--muted-2);
}

.calendar-summary-box {
  display: grid;
  gap: 8px;
  background: #fdf9f0;
}

.calendar-summary-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.calendar-summary-row > svg {
  width: 17px;
  min-width: 17px;
  height: 17px;
  color: var(--warning);
}

.calendar-summary-row strong,
.calendar-summary-row span {
  display: block;
}

.calendar-summary-row strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.calendar-summary-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.calendar-alternative-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.calendar-alternative-list legend {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
}

.calendar-alternative-list > p {
  margin: -3px 0 2px;
  color: var(--muted);
  font-size: 10px;
}

.calendar-alternative-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
}

.calendar-alternative-option:has(input:checked) {
  border-color: #b9cdc7;
  background: var(--accent-soft);
}

.calendar-alternative-option span,
.calendar-alternative-option strong,
.calendar-alternative-option small {
  display: block;
}

.draft-safety-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.draft-safety-row strong,
.draft-safety-row small {
  display: block;
}

.draft-safety-row strong {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 13px;
}

.draft-safety-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.proposal-action-utility {
  margin: -4px 0 4px 60px;
}

.calendar-alternative-option strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.calendar-alternative-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.confirmation-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 13px;
  border-radius: 9px;
  background: var(--warning-soft);
  color: #6f531d;
  cursor: pointer;
  font-size: 11px;
}

.confirmation-check input {
  margin-top: 1px;
}

/* Toasts */

.toast-region {
  position: fixed;
  z-index: 60;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: min(calc(100vw - 32px), 360px);
  gap: 9px;
}

.toast {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 30px;
  align-items: start;
  gap: 9px;
  padding: 13px 12px 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: toast-in 190ms ease-out;
}

.toast > svg {
  width: 20px;
  height: 20px;
  padding: 3px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  stroke-width: 2.4;
}

.toast.is-error > svg {
  background: var(--danger-soft);
  color: var(--danger);
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 12px;
}

.toast span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.toast .icon-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  margin: -5px -4px 0 0;
}

.toast .icon-button svg {
  width: 15px;
  height: 15px;
}

/* Responsive */

@media (max-width: 1120px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-columns {
    grid-template-columns: 1fr;
  }

  .cases-layout {
    grid-template-columns: minmax(275px, 0.7fr) minmax(390px, 1.3fr);
  }

  .clients-layout {
    grid-template-columns: minmax(285px, 0.65fr) minmax(470px, 1.35fr);
  }

  .client-work-grid,
  .client-records-grid {
    grid-template-columns: 1fr;
  }

  .case-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 264px;
  }

  .sidebar {
    box-shadow: var(--shadow-md);
    transform: translateX(-104%);
    transition: transform 220ms ease-out;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: grid;
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 25;
    inset: 0;
    background: rgb(9 30 28 / 40%);
    backdrop-filter: blur(2px);
  }

  .workspace-column {
    margin-left: 0;
  }

  .mobile-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    height: 62px;
    align-items: center;
    justify-content: space-between;
    padding: 7px 15px;
    border-bottom: 1px solid var(--line);
    background: rgb(255 255 255 / 92%);
    backdrop-filter: blur(12px);
  }

  .brand--compact {
    gap: 8px;
  }

  .brand--compact .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .brand--compact .brand-mark svg {
    width: 23px;
    height: 23px;
  }

  .brand--compact strong {
    font-size: 17px;
  }

  .main-content {
    padding-top: 27px;
  }

  .cases-layout {
    display: block;
  }

  .clients-layout {
    display: block;
  }

  .case-queue {
    border-right: 0;
  }

  .client-directory {
    border-right: 0;
  }

  .case-detail-panel {
    display: none;
  }

  .client-detail-panel {
    display: none;
  }

  .cases-layout.is-detail-open .case-queue {
    display: none;
  }

  .clients-layout.is-detail-open .client-directory {
    display: none;
  }

  .cases-layout.is-detail-open .case-detail-panel {
    display: block;
  }

  .clients-layout.is-detail-open .client-detail-panel {
    display: block;
  }

  .case-detail {
    min-height: 620px;
  }

  .client-detail {
    min-height: 620px;
  }

  .mobile-only {
    display: inline-flex;
    margin-bottom: 8px;
  }

  .login-screen {
    grid-template-columns: minmax(350px, 0.8fr) minmax(450px, 1.2fr);
  }

  .login-brand-panel {
    padding: 38px;
  }

  .login-form-panel {
    padding: 38px;
  }
}

@media (max-width: 720px) {
  .login-screen {
    display: block;
    background: var(--surface);
  }

  .login-brand-panel {
    min-height: auto;
    padding: 28px 24px 30px;
  }

  .login-promise {
    margin: 48px 0 0;
  }

  .login-promise h1 {
    margin-bottom: 14px;
    font-size: 35px;
  }

  .login-promise > p:not(.eyebrow),
  .promise-list,
  .login-footnote {
    display: none;
  }

  .login-form-panel {
    min-height: auto;
    padding: 34px 24px 48px;
  }

  .login-card-heading .icon-tile {
    display: none;
  }

  .page-header {
    display: grid;
    gap: 16px;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .crm-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-overview > div:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .crm-overview > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .client-metric-grid,
  .contract-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capture-card {
    min-height: 210px;
  }

  .proposal-context-grid {
    grid-template-columns: 1fr;
  }

  .proposal-card__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .proposal-footer-actions {
    width: 100%;
  }

  .proposal-footer-actions .button--primary {
    flex: 1;
  }

  .audit-event {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .audit-time {
    grid-column: 2;
    grid-row: 2;
    padding-top: 0;
    text-align: left;
  }

  .audit-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .audit-copy {
    grid-column: 2;
  }

  .audit-result {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 560px) {
  .main-content {
    padding: 22px 15px 48px;
  }

  .page-header {
    margin-bottom: 22px;
  }

  .page-header h1 {
    font-size: 27px;
  }

  .header-actions,
  .header-actions .button {
    width: 100%;
  }

  .header-actions .button {
    flex: 1;
  }

  .crm-dashboard-link {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .crm-dashboard-link > small {
    display: none;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .metric-card {
    padding: 14px;
  }

  .metric-card__value {
    font-size: 24px;
  }

  .briefing-card {
    padding: 21px;
  }

  .briefing-points {
    display: grid;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    max-width: none;
  }

  .case-detail {
    padding: 19px 15px;
  }

  .client-detail {
    padding: 19px 15px;
  }

  .client-profile-header {
    display: grid;
  }

  .client-profile-header .case-detail-actions {
    justify-content: flex-start;
  }

  .client-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contract-grid {
    grid-template-columns: 1fr;
  }

  .crm-next-action {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .crm-next-action .button {
    grid-column: 2;
    justify-self: start;
  }

  .form-grid--three {
    grid-template-columns: 1fr;
  }

  .case-detail-header {
    display: grid;
  }

  .case-detail-actions {
    justify-content: flex-start;
  }

  .case-summary-grid {
    grid-template-columns: 1fr;
  }

  .proposal-card__header,
  .proposal-card__body,
  .proposal-card__footer {
    padding-right: 14px;
    padding-left: 14px;
  }

  .proposal-card__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .proposal-action {
    grid-template-columns: 20px 30px minmax(0, 1fr);
    padding: 12px 10px;
  }

  .proposal-action > .risk-badge {
    grid-column: 3;
    justify-self: start;
  }

  .action-icon {
    width: 30px;
    height: 30px;
  }

  .select-controls {
    display: none;
  }

  .proposal-footer-actions {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .dialog,
  .dialog--wide {
    width: 100vw;
    max-width: none;
    max-height: 94vh;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }

  .dialog-surface {
    max-height: 94vh;
  }

  .dialog-header,
  .dialog-body,
  .dialog-footer {
    padding-right: 17px;
    padding-left: 17px;
  }

  .dialog-footer .button {
    flex: 1;
  }

  .recorder-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .recorder-row .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .audio-preview {
    grid-template-columns: 1fr;
  }

  .audio-preview .text-button {
    justify-self: start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .textarea-meta span:first-child {
    display: none;
  }

  .toast-region {
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
  }

  .audit-card {
    padding: 4px 14px;
  }
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

@keyframes recording-pulse {
  50% {
    box-shadow: 0 0 0 9px rgb(169 66 63 / 5%);
    transform: scale(0.92);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@media print {
  .sidebar,
  .mobile-header,
  .header-actions,
  .button,
  .toast-region {
    display: none !important;
  }

  .workspace-column {
    margin: 0;
  }

  .main-content {
    padding: 0;
  }

  .card,
  .proposal-card,
  .audit-card {
    break-inside: avoid;
    box-shadow: none;
  }
}
