:root {
  color-scheme: dark;
  --night: #081226;
  --night-raised: #0b1f3f;
  --night-high: #122b52;
  --near-black: #04070f;
  --gold: #c9a227;
  --gold-light: #e4c65b;
  --gold-soft: #f0d98c;
  --cream: #f7f1e5;
  --text: #ede6d4;
  --muted: #b9c4da;
  --success: #8fe3a8;
  --error: #ff9aa5;
  --border: rgba(228, 198, 91, .26);
  --quiet-border: rgba(185, 196, 218, .16);
  --surface: rgba(11, 31, 63, .72);
  --field: rgba(4, 7, 15, .62);
  --display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --body: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 14px;
  --ease: .35s cubic-bezier(.22, .8, .3, 1);
  --ease-quick: .18s cubic-bezier(.16, 1, .3, 1);
  --ease-arrive: .72s cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--near-black); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 54% -20%, rgba(18, 43, 82, .76), transparent 42rem),
    var(--night);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--gold-light); }
button { color: inherit; }
img, svg { display: block; }
::selection { background: var(--gold); color: var(--night); }

:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 1rem;
  max-width: calc(100vw - 2rem);
  padding: .75rem 1rem;
  border-radius: 0 0 10px 10px;
  background: var(--gold-light);
  color: var(--night);
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

.icon { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }
.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--quiet-border);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--ease-quick), border-color var(--ease-quick), background var(--ease-quick), transform var(--ease-quick);
}
.icon-button:hover { color: var(--cream); border-color: var(--border); background: rgba(18, 43, 82, .45); }
.icon-button:active { transform: scale(.96); }

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 220px minmax(620px, 1fr) 360px;
  transition: grid-template-columns var(--ease);
}
.app-shell.inspector-collapsed { grid-template-columns: 220px minmax(620px, 1fr) 0; }

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 100vh;
  max-height: 100vh;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--quiet-border);
  background: rgba(4, 11, 25, .88);
}
.sidebar-brand {
  display: flex;
  min-height: 112px;
  align-items: center;
  gap: .8rem;
  padding: 1.25rem 1.15rem;
  border-bottom: 1px solid var(--quiet-border);
}
.sidebar-brand img { filter: drop-shadow(0 8px 22px rgba(201, 162, 39, .16)); }
.sidebar-brand div { min-width: 0; }
.sidebar-brand strong {
  display: block;
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 400;
  letter-spacing: .045em;
  line-height: 1.05;
}
.sidebar-brand span { display: block; margin-top: .3rem; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.sidebar nav { display: grid; gap: .28rem; padding: 1.25rem .75rem; }
.sidebar nav a {
  position: relative;
  display: grid;
  min-height: 48px;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: .75rem;
  padding: .7rem .72rem;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  transition: color var(--ease), background var(--ease);
}
.sidebar nav a .icon { transition: transform var(--ease-quick), color var(--ease-quick); }
.sidebar nav a::before {
  content: '';
  position: absolute;
  left: -.75rem;
  width: 1px;
  height: 70%;
  background: var(--gold-light);
  transform: scaleY(0);
  transition: transform var(--ease);
}
.sidebar nav a:hover { color: var(--cream); background: rgba(18, 43, 82, .4); }
.sidebar nav a:hover .icon { transform: translateX(2px); }
.sidebar nav a[aria-current='page'] { color: var(--gold-light); background: rgba(18, 43, 82, .54); }
.sidebar nav a[aria-current='page']::before { transform: scaleY(1); }
.sidebar nav a span { min-width: 0; }
.sidebar nav a span small {
  display: block;
  margin-top: .06rem;
  color: #93a0ba;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.sidebar nav a.event-nav-link { background: linear-gradient(90deg, rgba(201, 162, 39, .08), transparent 86%); }
.sidebar nav a.event-nav-link[aria-current='page'] { background: rgba(201, 162, 39, .12); }
.sidebar nav b {
  min-width: 1.55rem;
  padding: .15rem .4rem;
  border-radius: 999px;
  background: rgba(201, 162, 39, .14);
  color: var(--gold-soft);
  font-size: .75rem;
  text-align: center;
}

.future-module {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: .75rem;
  margin: auto .75rem 1rem;
  padding: .9rem .72rem;
  border-top: 1px solid var(--quiet-border);
  color: var(--muted);
}
.future-module strong { display: block; color: var(--text); font-size: .875rem; }
.future-module span { display: block; margin-top: .18rem; font-size: .75rem; line-height: 1.4; }

.sidebar-account {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin: 0 .75rem;
  padding: .9rem 0;
  border-top: 1px solid var(--quiet-border);
}
.client-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(228, 198, 91, .38);
  border-radius: 50%;
  background: var(--night-high);
  color: var(--gold-soft);
  font-weight: 800;
}
.client-avatar { width: 38px; height: 38px; font-size: .8rem; }
.owner-copy { min-width: 0; }
.owner-copy strong, .owner-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-copy strong { color: var(--cream); font-size: .82rem; }
.owner-copy span { margin-top: .08rem; color: var(--muted); font-size: .7rem; }
.logout-action {
  display: inline-flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  gap: .35rem;
  padding: .45rem .55rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  text-decoration: none;
  transition: color var(--ease-quick), background var(--ease-quick);
}
.logout-action .icon { width: 1rem; height: 1rem; }
.logout-action:hover { color: var(--cream); background: rgba(18, 43, 82, .4); }

.workspace { min-width: 0; padding: 1.5rem clamp(1rem, 2vw, 2rem) 2rem; }
.topbar {
  display: grid;
  grid-template-columns: 1fr minmax(270px, 500px) 44px;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}
.topbar h1 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(1.45rem, 1.1rem + 1vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.15;
}
.topbar p { margin: .3rem 0 0; color: var(--muted); font-size: .875rem; }
.menu-button { display: none; }
.inspector-toggle[aria-expanded='true'] { color: var(--gold-light); border-color: var(--border); background: rgba(18, 43, 82, .45); }

.global-search { position: relative; display: block; }
.global-search .icon { position: absolute; top: 50%; left: 1rem; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.global-search input {
  width: 100%;
  min-height: 48px;
  padding: .72rem 1rem .72rem 3rem;
  border: 1px solid var(--quiet-border);
  border-radius: 12px;
  outline: none;
  background: rgba(4, 7, 15, .46);
  color: var(--text);
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
.global-search input::placeholder { color: #aab6cd; }
.global-search input:focus { border-color: var(--gold); background: rgba(4, 7, 15, .72); box-shadow: 0 0 0 3px rgba(201, 162, 39, .2); }

.demo-banner {
  margin: 0 0 1rem;
  padding: .62rem .9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(201, 162, 39, .1);
  color: var(--gold-soft);
  font-size: .8rem;
  font-weight: 700;
  text-align: center;
}

.summary-strip {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--quiet-border);
  border-radius: var(--radius);
  background: rgba(11, 31, 63, .58);
}
.summary-strip::after {
  content: '';
  position: absolute;
  z-index: 2;
  top: 0;
  left: -32%;
  width: 28%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  filter: drop-shadow(0 4px 8px rgba(228, 198, 91, .42));
  pointer-events: none;
  animation: ledger-light-scan var(--ease-arrive) .12s both;
}
.summary-strip button {
  display: grid;
  min-height: 86px;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-content: center;
  gap: .15rem 1rem;
  padding: 1rem 1.2rem;
  border: 0;
  border-right: 1px solid var(--quiet-border);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background var(--ease);
}
.summary-strip button:last-child { border-right: 0; }
.summary-strip button:hover { background: rgba(18, 43, 82, .46); }
.summary-strip span { color: var(--cream); font-size: .9rem; font-weight: 700; }
.summary-strip strong { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--gold-light); font-family: var(--display); font-size: 1.8rem; font-weight: 400; transition: transform var(--ease-quick), color var(--ease-quick), text-shadow var(--ease-quick); }
.summary-strip button:hover strong { color: var(--gold-soft); text-shadow: 0 6px 16px rgba(201, 162, 39, .24); transform: translateY(-1px); }
.summary-strip small { color: var(--muted); font-size: .75rem; }

.client-book {
  overflow: hidden;
  border: 1px solid var(--quiet-border);
  border-radius: var(--radius);
  background: rgba(11, 31, 63, .56);
}
.book-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.25rem 0;
  border-bottom: 1px solid var(--quiet-border);
}
.book-header h2 { margin: 0; color: var(--cream); font-family: var(--display); font-size: 1.7rem; font-weight: 400; letter-spacing: .04em; }
.book-header p { margin: .22rem 0 1rem; color: var(--muted); font-size: .8rem; }
.filter-tabs { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.filter-tabs button {
  position: relative;
  min-height: 48px;
  padding: .75rem .8rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.filter-tabs button::after {
  content: '';
  position: absolute;
  right: .8rem;
  bottom: 0;
  left: .8rem;
  height: 2px;
  background: var(--gold-light);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--ease);
}
.filter-tabs button:hover, .filter-tabs button.is-active { color: var(--gold-light); }
.filter-tabs button.is-active::after { transform: scaleX(1); }

.table-wrap { min-height: 330px; overflow-x: hidden; }
table { width: 100%; table-layout: fixed; border-collapse: collapse; }
th:nth-child(1) { width: 27%; }
th:nth-child(2) { width: 13%; }
th:nth-child(3) { width: 16%; }
th:nth-child(4) { width: 21%; }
th:nth-child(5) { width: 20%; }
th:nth-child(6) { width: 3%; }
thead { background: rgba(18, 43, 82, .42); }
th {
  padding: .76rem .85rem;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .055em;
  text-align: left;
  text-transform: uppercase;
}
td { padding: .82rem .85rem; border-top: 1px solid var(--quiet-border); color: var(--text); font-size: .8rem; vertical-align: middle; }
tbody tr { transition: background var(--ease); }
tbody tr:hover, tbody tr[aria-selected='true'] { background: rgba(18, 43, 82, .45); }
tbody tr[aria-selected='true'] { box-shadow: inset 1px 0 var(--gold-light); }
.client-link {
  display: flex;
  width: 100%;
  min-width: 180px;
  align-items: center;
  gap: .7rem;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.client-link .client-avatar { transition: transform var(--ease-quick), border-color var(--ease-quick), background var(--ease-quick); }
tbody tr:hover .client-avatar, tbody tr[aria-selected='true'] .client-avatar { border-color: var(--gold-light); background: #173563; transform: scale(1.04); }
.client-link strong, .client-link small, .table-main, td > small { display: block; }
.client-link strong { color: var(--cream); font-size: .82rem; }
.client-link small, td > small { max-width: 220px; margin-top: .12rem; overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.table-main { color: var(--text); font-weight: 600; white-space: nowrap; }
.row-arrow { width: 42px; color: var(--muted); }
.row-arrow .icon { width: 1rem; height: 1rem; transition: color var(--ease-quick), transform var(--ease-quick); }
tbody tr:hover .row-arrow .icon, tbody tr[aria-selected='true'] .row-arrow .icon { color: var(--gold-light); transform: translateX(3px); }

.status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: .2rem .55rem;
  border: 1px solid var(--quiet-border);
  border-radius: 999px;
  background: rgba(18, 43, 82, .42);
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
}
.status--contact { border-color: rgba(228, 198, 91, .34); background: rgba(201, 162, 39, .1); color: var(--gold-soft); }
.status--enrolled, .status--completed { border-color: rgba(143, 227, 168, .3); background: rgba(63, 143, 86, .12); color: var(--success); }
.status--archived { opacity: .7; }

.table-empty td { height: 260px; text-align: center; }
.table-empty strong, .table-empty span { display: block; }
.table-empty strong { color: var(--cream); font-size: 1rem; }
.table-empty span { max-width: 48ch; margin: .45rem auto 0; color: var(--muted); }
.table-loading { opacity: .52; pointer-events: none; }

.book-footer {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1.25rem;
  border-top: 1px solid var(--quiet-border);
  color: var(--muted);
  font-size: .75rem;
}
.book-footer a { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; text-decoration: none; }
.book-footer .icon { width: 1rem; height: 1rem; }

.inspector {
  position: sticky;
  top: 0;
  z-index: 15;
  min-width: 0;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--quiet-border);
  background: rgba(5, 16, 35, .93);
  transition: transform var(--ease), opacity var(--ease), border-color var(--ease);
}
.app-shell.inspector-collapsed .inspector {
  visibility: hidden;
  overflow: hidden;
  border-left: 0;
  opacity: 0;
  pointer-events: none;
  transform: none;
}
.inspector-panel-close {
  position: absolute;
  top: .9rem;
  right: .9rem;
  z-index: 2;
  background: rgba(5, 16, 35, .88);
}
.inspector-body { min-height: 100%; }
.inspector-content { min-height: 100%; }
.inspector-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  min-height: 100px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.4rem;
  border-bottom: 1px solid var(--quiet-border);
  background: rgba(5, 16, 35, .96);
}
.inspector-header h2 { margin: 0 0 .55rem; color: var(--cream); font-size: 1.2rem; line-height: 1.2; }
.inspector-section { padding: 1.15rem 1.4rem; border-bottom: 1px solid var(--quiet-border); }
.inspector-section h3 { margin: 0 0 .9rem; color: var(--cream); font-size: .9rem; font-weight: 700; }

.contact-list a, .contact-list p { display: flex; align-items: flex-start; gap: .65rem; margin: 0 0 .65rem; color: var(--muted); font-size: .78rem; line-height: 1.45; text-decoration: none; }
.contact-list a:hover { color: var(--gold-light); }
.contact-list .icon { width: 1rem; height: 1rem; margin-top: .08rem; }

.journey {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.journey::before {
  content: '';
  position: absolute;
  top: 13px;
  right: 8%;
  left: 8%;
  height: 1px;
  background: var(--quiet-border);
}
.journey li { position: relative; z-index: 1; display: grid; justify-items: center; gap: .35rem; min-width: 0; color: var(--muted); }
.journey li > span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid rgba(185, 196, 218, .3);
  border-radius: 50%;
  background: #07152d;
  font-size: .64rem;
  font-weight: 800;
}
.journey li small { font-size: .7rem; line-height: 1.2; text-align: center; }
.journey li.is-complete > span, .journey li.is-current > span { border-color: var(--gold-light); color: var(--gold-soft); }
.journey li.is-complete > span { background: rgba(201, 162, 39, .15); }
.journey li.is-current > span { background: var(--gold); color: var(--night); box-shadow: 0 6px 18px rgba(201, 162, 39, .26); }

.client-details { display: grid; gap: .65rem; margin: 0; }
.client-details div { display: grid; grid-template-columns: minmax(100px, 1fr) 1.2fr; gap: .8rem; }
.client-details dt { color: var(--muted); font-size: .75rem; }
.client-details dd { margin: 0; color: var(--text); font-size: .75rem; text-align: right; }
.client-goal { margin: 1rem 0 0; padding-top: .85rem; border-top: 1px solid var(--quiet-border); }
.client-goal strong, .client-goal span { display: block; }
.client-goal strong { color: var(--gold-light); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.client-goal span { margin-top: .4rem; color: var(--muted); font-size: .78rem; line-height: 1.55; }

.client-update-form, .note-form { display: grid; gap: .72rem; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.client-update-form label, .login-form label { display: grid; gap: .34rem; }
.client-update-form label > span, .login-form label > span { color: var(--gold-light); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--quiet-border);
  border-radius: 10px;
  outline: none;
  background: var(--field);
  color: var(--text);
  transition: border-color var(--ease), box-shadow var(--ease);
}
input, select { min-height: 42px; padding: .6rem .7rem; }
textarea { min-height: 92px; resize: vertical; padding: .7rem; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, .2); }
textarea::placeholder, input::placeholder { color: #9eaac2; }

.button {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  padding: .65rem 1rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .025em;
  cursor: pointer;
  transition: transform var(--ease), background var(--ease), color var(--ease), box-shadow var(--ease);
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button--primary { background: var(--gold-light); color: var(--night); }
.button--primary:hover { background: var(--gold-soft); box-shadow: 0 10px 28px rgba(201, 162, 39, .22); }
.button--secondary { background: transparent; color: var(--gold-light); }
.button--secondary:hover { background: rgba(201, 162, 39, .1); }
.button--compact { justify-self: end; min-height: 38px; padding: .55rem .9rem; }
.form-feedback { min-height: 1.2em; margin: 0; color: var(--muted); font-size: .72rem; }
.form-feedback.is-error { color: var(--error); }
.form-feedback.is-success { color: var(--success); }

.notes-list { display: grid; gap: .65rem; margin-top: 1rem; }
.note { padding: .75rem 0 0; border-top: 1px solid var(--quiet-border); }
.note p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.note time { display: block; margin-top: .45rem; color: #93a0ba; font-size: .68rem; }
.empty-copy { margin: 0; color: var(--muted); font-size: .78rem; }
.inspector-empty { display: grid; min-height: 100vh; place-content: center; justify-items: center; padding: 2rem; text-align: center; }
.inspector-empty .icon { width: 2.3rem; height: 2.3rem; color: var(--gold-light); }
.inspector-empty h2 { margin: 1rem 0 .5rem; color: var(--cream); font-size: 1.1rem; }
.inspector-empty p { max-width: 30ch; margin: 0; color: var(--muted); font-size: .8rem; }

.notice { padding: .8rem .9rem; border-radius: 10px; font-size: .78rem; line-height: 1.5; }
.notice strong, .notice span { display: block; }
.notice span { margin-top: .2rem; }
.notice--warning { border: 1px solid var(--border); background: rgba(201, 162, 39, .1); color: var(--gold-soft); }
.notice--error { border: 1px solid rgba(255, 154, 165, .32); background: rgba(149, 40, 53, .13); color: var(--error); }
.page-notice { margin-bottom: 1rem; }
.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  max-width: min(360px, calc(100vw - 2rem));
  padding: .8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0d2447;
  box-shadow: 0 16px 42px rgba(0, 0, 0, .35);
  color: var(--cream);
  font-size: .8rem;
}
.toast:not([hidden]) { animation: toast-arrive .28s cubic-bezier(.16, 1, .3, 1) both; }

@keyframes ledger-light-scan {
  0% { opacity: 0; transform: translateX(0); }
  18% { opacity: .9; }
  78% { opacity: .72; }
  100% { opacity: 0; transform: translateX(470%); }
}

@keyframes toast-arrive {
  from { opacity: 0; filter: blur(2px); transform: translateY(7px) scale(.985); }
  to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}

/* Login: la marca acompaña, el formulario sigue siendo el único trabajo. */
.login-page { display: grid; place-items: center; padding: clamp(1rem, 4vw, 3rem); }
.login-shell {
  display: grid;
  width: min(950px, 100%);
  grid-template-columns: 1.08fr .92fr;
  overflow: hidden;
  border: 1px solid var(--quiet-border);
  border-radius: 16px;
  background: rgba(6, 19, 42, .86);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .36);
}
.login-brand, .login-panel { padding: clamp(1.6rem, 5vw, 3.6rem); }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--quiet-border); background: rgba(11, 31, 63, .64); }
.login-brand > div { margin-top: 1rem; }
.brand-name { margin: 0; color: var(--gold-light); font-family: var(--display); font-size: 1.55rem; letter-spacing: .05em; }
.brand-context { margin: .2rem 0 0; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.login-brand h1 { max-width: 14ch; margin: 2.7rem 0 1rem; color: var(--cream); font-family: var(--display); font-size: clamp(2.4rem, 5vw, 4.5rem); font-weight: 400; letter-spacing: .02em; line-height: .98; }
.login-brand > p { max-width: 48ch; margin: 0; color: var(--muted); }
.login-panel { display: flex; flex-direction: column; justify-content: center; }
.login-panel h2 { margin: 0; color: var(--cream); font-size: 1.5rem; }
.login-panel > p { margin: .45rem 0 1.4rem; color: var(--muted); font-size: .82rem; }
.login-form { display: grid; gap: 1rem; margin-top: 1.2rem; }
.login-form input { min-height: 50px; }
.login-form .button { min-height: 50px; margin-top: .25rem; }
.login-help { margin: 1rem 0 0 !important; font-size: .75rem !important; }
.demo-label { color: var(--gold-soft) !important; font-weight: 700; }

@media (max-width: 1260px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .app-shell.inspector-collapsed { grid-template-columns: 210px minmax(0, 1fr); }
  .inspector {
    position: fixed;
    right: 0;
    z-index: 50;
    width: min(390px, 100vw);
    background: #051023;
    transform: translateX(100%);
    transition: transform var(--ease), box-shadow var(--ease), opacity var(--ease);
  }
  .app-shell.inspector-collapsed .inspector { visibility: visible; overflow-y: auto; border-left: 1px solid var(--quiet-border); opacity: 1; pointer-events: auto; transform: translateX(100%); }
  .inspector.is-open { transform: translateX(0); box-shadow: -24px 0 60px rgba(0, 0, 0, .4); }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    left: 0;
    width: min(280px, 86vw);
    transform: translateX(-102%);
    transition: transform var(--ease), box-shadow var(--ease);
  }
  .sidebar.is-open { transform: translateX(0); box-shadow: 24px 0 60px rgba(0, 0, 0, .44); }
  .workspace { padding: 1rem; }
  .topbar { grid-template-columns: 44px 1fr 44px; gap: .8rem; }
  .menu-button { display: inline-grid; }
  .global-search { grid-column: 1 / -1; }
  .book-header { align-items: flex-start; flex-direction: column; padding-bottom: 0; }
  .filter-tabs { width: 100%; }
  .summary-strip button { padding: .9rem; }
  .summary-strip strong { font-size: 1.55rem; }
}

@media (max-width: 680px) {
  body { font-size: 14px; }
  .topbar h1 { font-size: 1.35rem; }
  .summary-strip { grid-template-columns: 1fr; }
  .summary-strip button { min-height: 68px; border-right: 0; border-bottom: 1px solid var(--quiet-border); }
  .summary-strip button:last-child { border-bottom: 0; }
  .table-wrap { overflow: visible; }
  table, tbody { display: block; }
  table { table-layout: auto; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: .85rem; padding: .85rem 1rem; border-top: 1px solid var(--quiet-border); }
  tbody td { display: block; min-width: 0; padding: .45rem 0; border: 0; }
  tbody td:first-child { grid-column: 1 / -1; }
  tbody td::before { content: attr(data-label); display: block; margin-bottom: .18rem; color: #93a0ba; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  tbody td:first-child::before, tbody .row-arrow { display: none; }
  .client-link { min-width: 0; }
  .client-link span:last-child { min-width: 0; }
  .client-link small { max-width: calc(100vw - 8.5rem); }
  .table-main { overflow-wrap: anywhere; white-space: normal; }
  td > small { max-width: 100%; overflow: visible; text-overflow: clip; white-space: normal; }
  .filter-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .filter-tabs button { min-width: 0; padding-right: .3rem; padding-left: .3rem; font-size: .72rem; }
  .book-footer { align-items: flex-start; flex-direction: column; }
  .form-pair { grid-template-columns: 1fr; }
  .login-page { padding: 0; }
  .login-shell { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .login-brand { min-height: 42vh; border-right: 0; border-bottom: 1px solid var(--quiet-border); }
  .login-brand h1 { margin-top: 1.8rem; font-size: clamp(2.6rem, 14vw, 4.2rem); }
}

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