@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/montserrat-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Quattrocento";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/quattrocento-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --navy-950: #021f2d;
  --navy-900: #032839;
  --navy-800: #084e6f;
  --navy-700: #0b5f83;
  --gold-600: #966f35;
  --gold-500: #cfab68;
  --gold-300: #dfc48f;
  --gold-100: #f7efe0;
  --ink-900: #14252e;
  --ink-700: #3f515a;
  --ink-500: #728087;
  --ink-300: #a6b0b5;
  --line: #dce3e6;
  --surface: #ffffff;
  --surface-soft: #f4f7f8;
  --surface-warm: #fbf9f4;
  --green-700: #28705b;
  --green-100: #e1f2eb;
  --blue-100: #e8f0fa;
  --red-700: #a13a3a;
  --red-100: #fae8e8;
  --shadow-sm: 0 1px 2px rgb(3 40 57 / 6%), 0 8px 24px rgb(3 40 57 / 6%);
  --shadow-md: 0 22px 60px rgb(3 40 57 / 17%);
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --sidebar-width: 250px;
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--surface-soft);
}

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

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

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

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

.is-hidden {
  display: none !important;
}

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

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  color: var(--ink-500);
  background:
    linear-gradient(rgb(255 255 255 / 96%), rgb(255 255 255 / 96%)),
    url("/assets/consultores-hero.jpg") center / cover;
  transition: opacity 220ms ease;
}

.loading-screen p {
  font-size: 0.86rem;
  letter-spacing: 0.03em;
}

.loading-bar {
  width: 170px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.loading-bar span {
  display: block;
  width: 55%;
  height: 100%;
  border-radius: inherit;
  background: var(--gold-500);
  animation: loading-slide 1.1s ease-in-out infinite;
}

@keyframes loading-slide {
  from { transform: translateX(-110%); }
  to { transform: translateX(190%); }
}

.brand-lockup {
  display: flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.brand-logo--hero {
  width: min(100%, 250px);
}

.brand-logo--sidebar {
  width: min(100%, 188px);
  margin: 0 auto;
}

.brand-logo-surface {
  display: grid;
  width: 218px;
  min-height: 112px;
  padding: 18px 20px;
  place-items: center;
  background: linear-gradient(145deg, var(--navy-900), var(--navy-800));
  box-shadow: 0 16px 36px rgb(3 40 57 / 18%);
}

.brand-logo-surface img {
  display: block;
  width: 100%;
  height: auto;
}

.brand-logo-surface--loading {
  width: 190px;
  min-height: 98px;
  padding: 16px 18px;
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--gold-600);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.eyebrow--light {
  color: var(--gold-300);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 0.93fr) minmax(500px, 1.07fr);
}

.auth-brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: 56px clamp(48px, 6vw, 96px);
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(120deg, rgb(3 40 57 / 94%) 0%, rgb(3 40 57 / 82%) 56%, rgb(8 78 111 / 72%) 100%),
    url("/assets/consultores-hero.jpg") center / cover;
}

.auth-brand-panel::before,
.auth-brand-panel::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.auth-brand-panel::before {
  width: 420px;
  height: 420px;
  right: -240px;
  bottom: -230px;
  border: 1px solid rgb(207 171 104 / 24%);
  border-radius: 50%;
  box-shadow: 0 0 0 80px rgb(207 171 104 / 5%), 0 0 0 160px rgb(207 171 104 / 3%);
}

.auth-brand-panel::after {
  width: 160px;
  height: 1px;
  left: 0;
  bottom: 155px;
  background: linear-gradient(90deg, transparent, var(--gold-500));
}

.auth-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: auto 0;
  padding: 80px 0;
}

.auth-brand-copy h1 {
  max-width: 530px;
  margin-bottom: 24px;
  font-family: "Quattrocento", Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 4.6vw, 4.55rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.01em;
}

.auth-brand-copy > p:last-child {
  max-width: 500px;
  color: rgb(255 255 255 / 68%);
  font-size: 1.03rem;
  line-height: 1.75;
}

.auth-security-note {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgb(255 255 255 / 57%);
  font-size: 0.77rem;
}

.auth-security-note svg {
  width: 1.1rem;
  color: var(--gold-300);
}

.auth-form-panel {
  display: grid;
  min-height: 100vh;
  padding: 50px;
  place-items: center;
  background:
    linear-gradient(rgb(255 255 255 / 96%), rgb(255 255 255 / 96%)),
    repeating-linear-gradient(135deg, transparent 0 30px, rgb(3 40 57 / 4%) 30px 31px);
}

.login-card {
  position: relative;
  width: min(100%, 480px);
  padding: 48px 46px 42px;
  border: 1px solid rgb(3 40 57 / 10%);
  background: #fff;
  box-shadow: 0 24px 70px rgb(3 40 57 / 11%);
}

.login-card::before {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 108px;
  height: 4px;
  content: "";
  background: var(--gold-500);
}

.mobile-brand {
  display: none;
  align-items: center;
  margin-bottom: 38px;
}

.login-card h2 {
  margin-bottom: 10px;
  font-family: "Quattrocento", Georgia, "Times New Roman", serif;
  color: var(--navy-900);
  font-size: 2.45rem;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.005em;
}

.form-intro {
  margin-bottom: 36px;
  color: var(--ink-500);
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field > span:first-child {
  color: var(--ink-700);
  font-size: 0.78rem;
  font-weight: 680;
}

.field input,
.field select,
.field textarea,
.search-field,
.select-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--ink-900);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input,
.field select {
  height: 46px;
  padding: 0 13px;
}

.field textarea {
  min-height: 90px;
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field:focus-within,
.select-field select:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgb(184 144 73 / 14%);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap > svg {
  position: absolute;
  left: 14px;
  width: 1.12rem;
  color: var(--ink-300);
}

.input-wrap input {
  height: 50px;
  padding-left: 44px;
  padding-right: 46px;
}

.login-card .field + .field {
  margin-top: 20px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  width: 38px;
  height: 38px;
  color: var(--ink-500);
}

.form-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--red-700);
  border-radius: 4px;
  color: var(--red-700);
  background: var(--red-100);
  font-size: 0.8rem;
}

.button {
  display: inline-flex;
  min-height: 43px;
  padding: 0 17px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 720;
  transition: transform 130ms ease, background 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
}

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

.button:focus-visible,
.icon-button:focus-visible,
.nav-item:focus-visible,
.account-button:focus-visible {
  outline: 3px solid rgb(184 144 73 / 30%);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button--primary {
  color: var(--navy-900);
  background: var(--gold-500);
  box-shadow: 0 7px 18px rgb(159 123 63 / 18%);
}

.button--primary:hover:not(:disabled) {
  background: var(--gold-300);
  box-shadow: 0 10px 24px rgb(159 123 63 / 23%);
}

.button--secondary {
  border-color: var(--gold-500);
  color: var(--navy-900);
  background: #fff;
}

.button--secondary:hover:not(:disabled) {
  border-color: var(--gold-600);
  background: var(--gold-100);
}

.button--text {
  min-height: 36px;
  padding: 0 10px;
  color: var(--navy-700);
  background: transparent;
}

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

.login-card .button--full {
  min-height: 52px;
  margin-top: 26px;
}

.login-card .button--full svg {
  width: 1.15rem;
}

.login-help {
  margin-top: 22px;
  color: var(--ink-500);
  font-size: 0.74rem;
  text-align: center;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

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

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: var(--sidebar-width);
  padding: 28px 20px 24px;
  flex-direction: column;
  color: #fff;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 54%, var(--navy-800) 145%);
}

.sidebar-brand {
  display: grid;
  min-height: 96px;
  padding: 3px 8px 26px;
  place-items: center;
  border-bottom: 1px solid rgb(207 171 104 / 24%);
}

.sidebar-nav {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

.nav-item {
  display: flex;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: var(--radius-sm);
  color: rgb(255 255 255 / 62%);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
}

.nav-item svg {
  width: 1.15rem;
}

.nav-item:hover,
.nav-item.is-active {
  color: #fff;
  background: rgb(255 255 255 / 8%);
}

.nav-item.is-active {
  color: var(--navy-900);
  background: var(--gold-500);
  box-shadow: none;
}

.sidebar-footer {
  margin-top: auto;
  color: rgb(255 255 255 / 35%);
  font-size: 0.65rem;
}

.sidebar-secure {
  display: flex;
  margin-bottom: 22px;
  padding: 13px 12px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 9px;
  color: rgb(255 255 255 / 70%);
  background: rgb(255 255 255 / 3%);
}

.sidebar-secure div {
  display: grid;
}

.sidebar-secure strong {
  font-size: 0.69rem;
  font-weight: 650;
}

.sidebar-secure small {
  color: rgb(255 255 255 / 35%);
  font-size: 0.6rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #67c49a;
  box-shadow: 0 0 0 4px rgb(103 196 154 / 12%);
}

.sidebar-footer > p {
  margin: 0 8px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  height: 72px;
  padding: 0 36px;
  align-items: center;
  border-bottom: 1px solid rgb(207 171 104 / 36%);
  background: rgb(255 255 255 / 93%);
  backdrop-filter: blur(12px);
}

.topbar-title {
  display: grid;
}

.topbar-kicker {
  color: var(--ink-500);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.topbar-title strong {
  color: var(--navy-900);
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

.mobile-menu-button {
  display: none;
  margin-right: 8px;
}

.account-menu-wrap {
  position: relative;
  margin-left: auto;
}

.account-button {
  display: flex;
  padding: 5px 8px 5px 5px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
}

.account-button:hover {
  background: var(--surface-soft);
}

.account-button > svg {
  width: 1rem;
  color: var(--ink-500);
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--navy-900), var(--navy-800));
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.account-copy {
  display: grid;
  min-width: 125px;
}

.account-copy strong {
  overflow: hidden;
  max-width: 170px;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy small {
  color: var(--ink-500);
  font-size: 0.65rem;
  text-transform: capitalize;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  width: 215px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.account-menu button {
  display: flex;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 0.75rem;
  text-align: left;
}

.account-menu button:hover {
  background: var(--surface-soft);
}

.account-menu svg {
  width: 1rem;
  color: var(--ink-500);
}

.content {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 36px clamp(24px, 3.5vw, 52px) 60px;
}

.page-heading {
  display: flex;
  margin-bottom: 28px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-heading h1 {
  margin-bottom: 7px;
  color: var(--navy-900);
  font-family: "Quattrocento", Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.page-heading > div > p:last-child {
  margin-bottom: 0;
  color: var(--ink-500);
  font-size: 0.85rem;
}

.heading-actions {
  display: flex;
  gap: 10px;
}

.metrics-grid {
  display: grid;
  margin-bottom: 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric-card {
  display: flex;
  min-height: 118px;
  padding: 22px;
  align-items: center;
  gap: 17px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold-500);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.metric-card > div {
  display: grid;
  gap: 2px;
}

.metric-card span:not(.metric-icon) {
  color: var(--ink-500);
  font-size: 0.71rem;
}

.metric-card strong {
  color: var(--navy-900);
  font-family: "Quattrocento", Georgia, "Times New Roman", serif;
  font-size: 1.95rem;
  font-weight: 400;
  line-height: 1.1;
}

.metric-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
}

.metric-icon svg {
  width: 1.35rem;
}

.metric-icon--navy { color: var(--navy-800); background: var(--blue-100); }
.metric-icon--green { color: var(--green-700); background: var(--green-100); }
.metric-icon--gold { color: var(--gold-600); background: var(--gold-100); }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.panel + .panel {
  margin-top: 22px;
}

.panel-heading {
  display: flex;
  min-height: 78px;
  padding: 20px 24px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin-bottom: 2px;
  color: var(--navy-900);
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  font-size: 1.13rem;
  font-weight: 600;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--ink-500);
  font-size: 0.7rem;
}

.recent-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recent-item {
  display: grid;
  min-width: 0;
  padding: 18px 22px;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  border: 0;
  border-right: 1px solid var(--line);
  color: inherit;
  background: #fff;
  text-align: left;
}

.recent-item:hover {
  background: #fbfcfd;
}

.recent-item:nth-child(3n),
.recent-item:last-child {
  border-right: 0;
}

.recent-item:nth-child(n + 4) {
  border-top: 1px solid var(--line);
}

.recent-dot {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 0 2px var(--gold-100);
}

.recent-item strong,
.recent-item span,
.recent-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item strong {
  font-size: 0.76rem;
}

.recent-item span {
  color: var(--ink-500);
  font-size: 0.68rem;
}

.recent-item small {
  margin-top: 5px;
  color: var(--gold-600);
  font-size: 0.62rem;
}

.recent-empty {
  grid-column: 1 / -1;
  padding: 30px;
  color: var(--ink-500);
  font-size: 0.78rem;
  text-align: center;
}

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

.search-field {
  display: flex;
  width: min(280px, 34vw);
  height: 40px;
  padding: 0 11px;
  align-items: center;
  gap: 8px;
}

.search-field svg {
  width: 1rem;
  flex: 0 0 auto;
  color: var(--ink-300);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink-900);
  background: transparent;
  font-size: 0.76rem;
}

.search-field input::placeholder {
  color: var(--ink-300);
}

.select-field select {
  height: 40px;
  padding: 0 31px 0 11px;
  font-size: 0.74rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 12px 18px;
  color: var(--navy-900);
  background: #edf3f5;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-700);
  font-size: 0.72rem;
  vertical-align: middle;
}

.data-table tbody tr:first-child td {
  border-top: 0;
}

.data-table tbody tr:hover td {
  background: #fbfcfd;
}

.client-cell {
  display: grid;
  gap: 1px;
}

.client-cell strong {
  color: var(--ink-900);
  font-size: 0.75rem;
}

.client-cell small {
  color: var(--ink-500);
  font-size: 0.65rem;
}

.radicado {
  color: var(--navy-700);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
}

.status-badge {
  display: inline-flex;
  min-height: 27px;
  padding: 0 9px;
  align-items: center;
  border-radius: 999px;
  color: var(--navy-700);
  background: var(--blue-100);
  font-size: 0.64rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge--green { color: var(--green-700); background: var(--green-100); }
.status-badge--gold { color: #7e5d23; background: var(--gold-100); }
.status-badge--gray { color: var(--ink-500); background: #edf0f3; }
.status-badge--red { color: var(--red-700); background: var(--red-100); }

.row-action {
  width: 34px;
  height: 34px;
  color: var(--navy-700);
}

.row-action svg {
  width: 1rem;
}

.pagination {
  display: flex;
  min-height: 58px;
  padding: 10px 18px;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.pagination span {
  color: var(--ink-500);
  font-size: 0.68rem;
}

.empty-state {
  padding: 50px 20px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-500);
  background: var(--surface-soft);
}

.empty-state h3 {
  margin-bottom: 5px;
  color: var(--navy-900);
  font-size: 0.9rem;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--ink-500);
  font-size: 0.74rem;
}

.mobile-case-list {
  display: none;
}

.client-ledger-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.segmented-control button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: var(--ink-500);
  background: transparent;
  font-size: 0.67rem;
  font-weight: 700;
}

.segmented-control button.is-active {
  color: #fff;
  background: var(--navy-800);
  box-shadow: 0 2px 8px rgb(3 40 57 / 18%);
}

.client-ledger-table-wrap {
  max-height: min(68vh, 760px);
  overflow: auto;
}

.client-ledger-table {
  min-width: 980px;
}

.client-ledger-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.money-cell {
  color: var(--navy-800) !important;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}

.mobile-client-list {
  display: none;
}

.mobile-client-card {
  display: grid;
  padding: 17px 18px;
  gap: 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.mobile-client-card:first-child {
  border-top: 0;
}

.mobile-client-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mobile-client-card h3,
.mobile-client-card p {
  margin-bottom: 0;
}

.mobile-client-card h3 {
  color: var(--navy-900);
  font-size: 0.8rem;
}

.mobile-client-card p,
.mobile-client-card small {
  color: var(--ink-500);
  font-size: 0.65rem;
}

.mobile-client-card__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mobile-client-card__grid span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.mobile-client-card__grid strong {
  overflow-wrap: anywhere;
  color: var(--ink-700);
  font-size: 0.68rem;
  font-weight: 650;
}

.users-list {
  display: grid;
}

.user-row {
  display: grid;
  min-height: 78px;
  padding: 15px 22px;
  grid-template-columns: minmax(220px, 1.5fr) minmax(120px, 0.7fr) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
}

.user-row:first-child {
  border-top: 0;
}

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

.user-identity .avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  color: var(--navy-800);
  background: var(--blue-100);
}

.user-identity div {
  display: grid;
  min-width: 0;
}

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

.user-identity strong {
  font-size: 0.76rem;
}

.user-identity small,
.user-client,
.last-login {
  color: var(--ink-500);
  font-size: 0.66rem;
}

.user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.small-action {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--navy-700);
  background: #fff;
  font-size: 0.65rem;
  font-weight: 650;
}

.small-action:hover {
  border-color: var(--gold-300);
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgb(10 25 43 / 42%);
  backdrop-filter: blur(2px);
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 100;
  width: min(540px, 100vw);
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -20px 0 60px rgb(10 25 43 / 18%);
  transform: translateX(105%);
  transition: transform 220ms ease;
}

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

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  min-height: 84px;
  padding: 20px 24px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(10px);
}

.drawer-header h2 {
  margin-bottom: 0;
  color: var(--navy-900);
  font-family: "Quattrocento", Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  font-weight: 400;
}

.drawer-content {
  padding: 24px;
}

.drawer-summary {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-warm);
}

.drawer-client {
  display: flex;
  margin-bottom: 18px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.drawer-client h3 {
  margin-bottom: 2px;
  color: var(--navy-900);
  font-family: "Quattrocento", Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 400;
}

.drawer-client p {
  margin-bottom: 0;
  color: var(--ink-500);
  font-size: 0.7rem;
}

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

.detail-item {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.detail-item--wide {
  grid-column: 1 / -1;
}

.detail-item span {
  color: var(--ink-500);
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-item strong {
  overflow-wrap: anywhere;
  color: var(--ink-700);
  font-size: 0.73rem;
  font-weight: 650;
}

.drawer-actions {
  display: flex;
  margin: 18px 0 26px;
  gap: 9px;
}

.next-step {
  margin-bottom: 26px;
  padding: 16px 18px;
  border-left: 3px solid var(--gold-500);
  border-radius: 6px;
  background: var(--gold-100);
}

.next-step span {
  color: var(--gold-600);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.next-step strong {
  display: block;
  margin-top: 3px;
  color: var(--ink-900);
  font-size: 0.76rem;
}

.next-step small {
  color: var(--ink-500);
  font-size: 0.66rem;
}

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

.timeline-heading h3 {
  margin-bottom: 0;
  color: var(--navy-900);
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0;
}

.timeline::before {
  position: absolute;
  top: 8px;
  bottom: 20px;
  left: 5px;
  width: 1px;
  content: "";
  background: var(--line);
}

.timeline-item {
  position: relative;
  display: grid;
  padding: 0 0 22px 25px;
}

.timeline-dot {
  position: absolute;
  top: 5px;
  left: 1px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 0 2px var(--gold-100);
}

.timeline-date {
  color: var(--gold-600);
  font-size: 0.63rem;
  font-weight: 700;
}

.timeline-item strong {
  margin-top: 2px;
  color: var(--ink-900);
  font-size: 0.75rem;
}

.timeline-item p {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 0.7rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.timeline-item small {
  margin-top: 5px;
  color: var(--ink-300);
  font-size: 0.6rem;
}

.timeline-empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--ink-500);
  font-size: 0.72rem;
  text-align: center;
}

.modal {
  width: min(580px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  box-shadow: var(--shadow-md);
}

.modal--large {
  width: min(780px, calc(100vw - 28px));
}

.modal::backdrop {
  background: rgb(10 25 43 / 55%);
  backdrop-filter: blur(3px);
}

.modal-card {
  display: flex;
  max-height: calc(100vh - 32px);
  flex-direction: column;
  background: #fff;
}

.modal-header,
.modal-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.modal-header {
  min-height: 78px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin-bottom: 0;
  color: var(--navy-900);
  font-family: "Quattrocento", Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  font-weight: 400;
}

.modal-header .eyebrow {
  margin-bottom: 4px;
}

.modal-body {
  overflow-y: auto;
  padding: 22px;
}

.modal-footer {
  min-height: 70px;
  padding: 13px 22px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

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

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

.field--wide {
  grid-column: 1 / -1;
}

.info-box {
  display: flex;
  margin: 0;
  padding: 12px 14px;
  align-items: flex-start;
  gap: 10px;
  border-radius: 8px;
  color: var(--navy-700);
  background: var(--blue-100);
  font-size: 0.72rem;
}

.info-box svg {
  width: 1rem;
  flex: 0 0 auto;
  margin-top: 1px;
}

.info-box p {
  margin: 0;
}

.password-rules {
  margin: -7px 0 0;
  color: var(--ink-500);
  font-size: 0.66rem;
}

.credential-body {
  text-align: center;
}

.credential-body > p {
  max-width: 430px;
  margin: 0 auto 22px;
  color: var(--ink-500);
  font-size: 0.76rem;
}

.success-seal {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 4px auto 14px;
  place-items: center;
  border-radius: 50%;
  color: var(--green-700);
  background: var(--green-100);
}

.credential-row {
  display: flex;
  min-height: 46px;
  padding: 10px 13px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border: 1px solid var(--line);
  border-bottom: 0;
  text-align: left;
}

.credential-row:nth-of-type(2) {
  border-bottom: 1px solid var(--line);
}

.credential-row span {
  color: var(--ink-500);
  font-size: 0.68rem;
}

.credential-row strong {
  overflow-wrap: anywhere;
  color: var(--navy-900);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.73rem;
  text-align: right;
}

.credential-body .button {
  margin-top: 16px;
}

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

.toast {
  display: flex;
  padding: 13px 15px;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green-700);
  border-radius: 9px;
  color: var(--ink-700);
  background: #fff;
  box-shadow: var(--shadow-md);
  font-size: 0.75rem;
  animation: toast-in 180ms ease;
}

.toast--error {
  border-left-color: var(--red-700);
}

.toast svg {
  width: 1.05rem;
  flex: 0 0 auto;
  color: var(--green-700);
}

.toast--error svg {
  color: var(--red-700);
}

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

.skeleton-block {
  min-height: 80px;
  background: linear-gradient(90deg, #fff 20%, #f4f6f8 40%, #fff 60%);
  background-size: 200% 100%;
  animation: skeleton 1.3s infinite;
}

.skeleton-block--drawer {
  min-height: 220px;
}

@keyframes skeleton {
  to { background-position-x: -200%; }
}

@media (max-width: 1120px) {
  .auth-shell {
    grid-template-columns: minmax(360px, 0.85fr) minmax(440px, 1.15fr);
  }

  .auth-brand-panel {
    padding: 46px 48px;
  }

  .auth-brand-copy h1 {
    font-size: 3.4rem;
  }

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

  .recent-item:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .recent-item:nth-child(2n) {
    border-right: 0;
  }

  .recent-item:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .user-row {
    grid-template-columns: minmax(210px, 1.4fr) minmax(100px, 0.7fr) auto;
  }

  .user-client {
    display: none;
  }

  .client-ledger-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .client-ledger-controls .search-field {
    width: 100%;
  }
}

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

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-form-panel {
    min-height: 100vh;
    padding: 36px 24px;
  }

  .login-card {
    padding: 44px 40px 40px;
  }

  .mobile-brand {
    display: flex;
  }

  .mobile-brand .brand-logo-surface {
    width: 188px;
    min-height: 96px;
    padding: 15px 17px;
  }

  .sidebar {
    transform: translateX(-102%);
    transition: transform 200ms ease;
  }

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

  .app-main {
    margin-left: 0;
  }

  .mobile-menu-button {
    display: grid;
  }

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

  .metric-card {
    padding: 18px;
  }

  .metric-icon {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 720px) {
  .topbar {
    height: 64px;
    padding: 0 15px;
  }

  .topbar-title {
    display: none;
  }

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

  .account-copy strong {
    max-width: 120px;
  }

  .content {
    padding: 25px 15px 45px;
  }

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

  .heading-actions {
    width: 100%;
  }

  .heading-actions .button {
    flex: 1 1 0;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .metric-card {
    min-height: 86px;
  }

  .metric-card strong {
    font-size: 1.55rem;
  }

  .recent-actions {
    grid-template-columns: 1fr;
  }

  .recent-item,
  .recent-item:nth-child(3n),
  .recent-item:nth-child(2n) {
    border-right: 0;
  }

  .recent-item:nth-child(n + 2) {
    border-top: 1px solid var(--line);
  }

  .panel-heading--responsive {
    align-items: stretch;
    flex-direction: column;
  }

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

  .search-field {
    width: 100%;
  }

  .select-field select {
    width: 100%;
  }

  .data-table {
    display: none;
  }

  .mobile-case-list {
    display: grid;
  }

  .client-ledger-table {
    display: none;
  }

  .client-ledger-table-wrap {
    max-height: none;
  }

  .mobile-client-list {
    display: grid;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1 1 0;
  }

  .mobile-case-card {
    display: grid;
    padding: 17px 18px;
    gap: 12px;
    border: 0;
    border-top: 1px solid var(--line);
    color: inherit;
    background: #fff;
    text-align: left;
  }

  .mobile-case-card:first-child {
    border-top: 0;
  }

  .mobile-case-card-header,
  .mobile-case-card-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-case-card h3 {
    margin-bottom: 2px;
    font-size: 0.8rem;
  }

  .mobile-case-card p,
  .mobile-case-card small {
    margin-bottom: 0;
    color: var(--ink-500);
    font-size: 0.66rem;
  }

  .mobile-case-card .radicado {
    color: var(--navy-700);
  }

  .mobile-case-card-footer {
    align-items: center;
  }

  .pagination {
    justify-content: space-between;
  }

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

  .field--wide {
    grid-column: auto;
  }

  .modal-footer .button {
    flex: 1 1 0;
  }

  .user-row {
    padding: 16px;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .user-row > .status-badge,
  .user-row > .last-login {
    display: none;
  }

  .user-actions {
    flex-direction: column;
  }

  .drawer-content {
    padding: 18px;
  }

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

  .detail-item--wide {
    grid-column: auto;
  }
}

@media (max-width: 430px) {
  .auth-form-panel {
    padding: 28px 19px;
  }

  .mobile-brand {
    margin-bottom: 32px;
  }

  .login-card {
    padding: 40px 24px 34px;
  }

  .mobile-brand .brand-logo-surface {
    width: 172px;
    min-height: 88px;
  }

  .login-card h2 {
    font-size: 2rem;
  }

  .account-copy {
    display: none;
  }

  .heading-actions {
    flex-direction: column;
  }

  .page-heading h1 {
    font-size: 2rem;
  }

  .panel-heading {
    padding: 17px;
  }

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

  .credential-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .credential-row strong {
    text-align: left;
  }

  .mobile-client-card__grid {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-client-card__grid span:first-child {
    grid-column: 1 / -1;
  }
}

@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;
  }
}
