:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --brand-blue: #0f4c81;
  --brand-secondary: #1f7fb6;
  --brand-accent: #2cb1bc;
  --success: #0f9f6e;
  --ink: #102033;
  --muted: #64748b;
  --line: #dbe4ee;
  --surface: #ffffff;
  --page: #f1f5f9;
  --tly-sidebar-width: 204px;
  --tly-mobile-sidebar-width: 276px;
  --tly-topbar-height: 62px;
  --tly-nav-blue: #0f6fdc;
  --tly-nav-blue-dark: #0759b8;
  --tly-nav-border: #e7edf5;
  --tly-nav-hover: #f4f8fc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
}

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

button {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.boot-screen,
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot-card,
.login-card {
  width: min(100%, 440px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 47, 79, 0.13);
}

.boot-card {
  padding: 32px;
  text-align: center;
}

.boot-logo,
.login-logo {
  display: block;
  width: min(230px, 70%);
  height: auto;
  margin: 0 auto;
}

.login-card {
  padding: 34px;
}

.login-brand {
  text-align: center;
  margin-bottom: 26px;
}

.login-kicker {
  margin: 10px 0 0;
  color: var(--brand-blue);
  font-weight: 750;
}

.login-form {
  display: grid;
  gap: 15px;
}

.login-form h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.login-copy,
.status {
  margin: 0;
  color: var(--muted);
}

.status {
  min-height: 20px;
  font-size: 14px;
}

.status.is-error {
  color: #b42318;
}

label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  color: var(--ink);
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px 13px;
}

.login-form button {
  background: var(--brand-blue);
  color: #fff;
  padding: 11px 14px;
}

.login-form .text-link-button {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--brand-blue);
  padding: 0;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

.login-form .text-link-button:hover {
  text-decoration: underline;
}

.auth-shell-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 76, 129, 0.08), rgba(44, 177, 188, 0.08)),
    var(--page);
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-shell {
  width: min(100%, 1040px);
  min-height: min(720px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.05fr);
  overflow: hidden;
  border: 1px solid rgba(219, 228, 238, 0.95);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 47, 79, 0.15);
}

.auth-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 24px;
  padding: 42px;
  background: linear-gradient(150deg, #f8fbff 0%, #eef7fb 100%);
  border-right: 1px solid var(--line);
}

.auth-logo {
  display: block;
  width: min(282px, 84%);
  height: auto;
  margin-top: 16px;
}

.auth-brand-copy {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.auth-eyebrow,
.auth-form-header p,
.trial-plan {
  margin: 0;
  color: var(--brand-secondary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-brand-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.02;
}

.auth-headline-primary {
  color: var(--brand-blue);
}

.auth-headline-accent {
  color: var(--brand-blue);
}

.auth-brand-copy p:not(.auth-eyebrow) {
  margin: 0;
  max-width: 440px;
  color: #43566f;
  font-size: 17px;
  line-height: 1.55;
}

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

.auth-benefits li {
  display: grid;
  gap: 3px;
}

.auth-benefits strong {
  color: var(--brand-blue);
  font-size: 14px;
  line-height: 1.25;
}

.auth-benefits span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.capability-panel span {
  border: 1px solid #d7e8f3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #24445f;
  font-size: 13px;
  font-weight: 850;
  padding: 8px 11px;
}

.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 42px;
}

.auth-form-header {
  display: grid;
  gap: 8px;
}

.auth-form-header h2 {
  margin: 0;
  color: var(--brand-blue);
  font-size: 32px;
  line-height: 1.1;
}

.auth-form-header span {
  color: var(--muted);
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  color: #24364b;
  font-size: 13px;
  font-weight: 850;
}

.auth-form input,
.auth-form select {
  min-height: 45px;
  font-size: 14px;
}

.primary-action,
.secondary-action {
  min-height: 43px;
  padding: 10px 15px;
}

.primary-action {
  background: var(--brand-blue);
  color: #ffffff;
}

.primary-action:hover {
  background: #0b3f6e;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #16304a;
}

.text-link-button {
  border: 0;
  background: transparent;
  color: var(--brand-blue);
  padding: 0;
  font-size: 14px;
  font-weight: 850;
  text-align: left;
}

.text-link-button:hover {
  text-decoration: underline;
}

.form-status {
  min-height: 19px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form-status.is-error {
  color: #b42318;
}

.form-status.is-success {
  color: var(--success);
}

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

.password-toggle {
  min-height: 45px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--brand-blue);
  padding: 0 13px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

.form-grid.address {
  grid-template-columns: minmax(150px, 1fr) 92px minmax(98px, 0.55fr);
}

.form-actions,
.form-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-actions {
  justify-content: flex-end;
}

.form-link-row,
.auth-switch {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.onboarding-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}

.onboarding-progress li {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #8290a3;
  font-size: 12px;
  font-weight: 850;
}

.onboarding-progress span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e9eef5;
  color: #5d6d80;
  font-size: 11px;
}

.onboarding-progress li.active {
  color: var(--brand-blue);
}

.onboarding-progress li.active span {
  background: var(--brand-blue);
  color: #ffffff;
}

.capability-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.trial-card {
  border: 1px solid #cfe7f1;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fcff 0%, #eff9fb 100%);
  padding: 18px;
}

.trial-card strong {
  display: block;
  margin-top: 8px;
  color: #0f2238;
  font-size: 34px;
  line-height: 1;
}

.trial-card strong span {
  color: var(--muted);
  font-size: 15px;
}

.trial-card p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--tly-sidebar-width) minmax(0, 1fr);
  background: #f5f7fb;
}

.sidebar-shell {
  position: sticky;
  top: 0;
  align-self: start;
  width: var(--tly-sidebar-width);
  height: 100vh;
  max-height: 100vh;
  padding: 0;
  border-right: 1px solid var(--tly-nav-border);
  background: #ffffff;
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.02);
  overflow-y: auto;
  overflow-x: hidden;
}

.main-shell {
  min-width: 0;
}

.product-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 68px;
  padding: 12px 12px 8px;
}

.product-logo-frame {
  width: 172px;
  height: 42px;
  display: flex;
  align-items: center;
}

.product-logo {
  display: block;
  width: 164px;
  height: auto;
  max-width: 100%;
  max-height: 40px;
  object-fit: contain;
}

.product-subtitle {
  margin: 2px 0 0 2px;
  color: #8b9aae;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
}

.company-block {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 8px;
  padding: 8px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
}

.company-fallback {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #e8f3ff;
  color: var(--tly-nav-blue-dark);
  font-size: 11px;
  font-weight: 900;
}

.company-meta {
  min-width: 0;
}

.company-name {
  color: #172033;
  font-size: 13.5px;
  font-weight: 900;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-subtitle {
  margin-top: 1px;
  color: #7d8ca1;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 2px 8px 14px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 28px;
  padding: 6px 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7d8ca1;
  cursor: pointer;
  font-size: 10.75px;
  font-weight: 900;
  letter-spacing: 0.09em;
  line-height: 1;
  text-align: left;
  text-transform: uppercase;
}

.nav-group-toggle:hover {
  background: var(--tly-nav-hover);
  color: #405066;
}

.nav-group-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-group-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  opacity: 0.78;
  transform: rotate(45deg);
}

.nav-group.collapsed .nav-group-chevron {
  transform: rotate(-45deg);
}

.nav-group-items {
  display: grid;
  gap: 2px;
  max-height: 280px;
  overflow: hidden;
  padding: 1px 0 5px;
}

.nav-group.collapsed .nav-group-items {
  max-height: 0;
  padding: 0;
  pointer-events: none;
}

.nav-btn {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 33px;
  padding: 5px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #46566b;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 780;
  line-height: 1.15;
  text-align: left;
}

.nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef3f8;
  color: #64748b;
  font-size: 8.5px;
  font-weight: 950;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-btn:hover {
  background: var(--tly-nav-hover);
  color: #172033;
}

.nav-btn.active {
  background: #e8f3ff;
  color: #064c9c;
  font-weight: 950;
  box-shadow: inset 3px 0 0 var(--tly-nav-blue);
}

.nav-btn.active .nav-icon {
  background: var(--tly-nav-blue);
  color: #ffffff;
}

.topbar {
  height: var(--tly-topbar-height);
  padding: 10px 18px;
  border-bottom: 1px solid var(--tly-nav-border);
  background: rgba(255, 255, 255, 0.94);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left,
.topbar-right,
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-wrap {
  height: 38px;
  min-width: min(45vw, 420px);
  border: 1px solid #e3eaf3;
  border-radius: 11px;
  background: #f8fafc;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-search {
  border: 0;
  background: transparent;
  padding: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
}

.topbar-icon-btn,
.mobile-menu-btn,
.topbar-user-btn {
  min-height: 38px;
  border: 1px solid #e3eaf3;
  border-radius: 11px;
  background: #ffffff;
  color: #172033;
}

.topbar-icon-btn,
.mobile-menu-btn {
  width: 38px;
  padding: 0;
}

.topbar-user-btn {
  padding: 4px 8px;
}

.topbar-user-name {
  color: #172033;
  font-size: 13px;
  font-weight: 800;
}

.topbar-user-role {
  color: var(--muted);
  font-size: 10px;
}

.topbar-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--tly-nav-blue);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.user-dropdown-menu {
  display: none;
}

.page-content {
  margin: 0;
  padding: 18px;
  background: #f5f7fb;
  min-height: calc(100vh - var(--tly-topbar-height));
}

.page-title-row {
  margin-bottom: 18px;
}

.page-title-row h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.page-title-row p,
.panel-heading span,
.activity-item span,
.empty {
  color: var(--muted);
}

.page-title-row p {
  margin: 4px 0 0;
}

.module-root {
  display: grid;
  gap: 18px;
}

.module-loading,
.module-panel,
.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.module-loading,
.module-panel {
  padding: 20px;
}

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

.metric-card {
  padding: 16px;
  display: grid;
  gap: 8px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  font-size: 24px;
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-heading h2,
.module-panel h2 {
  margin: 0;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 861px) {
  .mobile-menu-btn {
    display: none;
  }
}

@media (max-width: 860px) {
  :root {
    --tly-sidebar-width: var(--tly-mobile-sidebar-width);
  }

  .auth-shell-page {
    padding: 16px;
  }

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

  .auth-brand-panel {
    gap: 18px;
    padding: 26px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .auth-logo {
    width: min(238px, 70%);
    margin-top: 6px;
  }

  .auth-brand-copy {
    margin-top: 4px;
  }

  .auth-brand-copy h1 {
    font-size: 34px;
  }

  .auth-form-panel {
    padding: 26px;
  }

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

  .sidebar-shell {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1001;
    width: var(--tly-mobile-sidebar-width);
    transform: translateX(-104%);
    transition: transform 0.22s ease;
    box-shadow: 12px 0 42px rgba(15, 23, 42, 0.18);
  }

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

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

@media (max-width: 560px) {
  .login-card {
    padding: 26px 22px;
  }

  .auth-shell-page {
    padding: 0;
    place-items: stretch;
  }

  .auth-shell {
    min-height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .auth-brand-panel,
  .auth-form-panel {
    padding: 22px;
  }

  .auth-logo {
    width: 210px;
    max-width: 72%;
  }

  .auth-brand-copy h1 {
    font-size: 29px;
  }

  .auth-brand-copy p:not(.auth-eyebrow) {
    font-size: 15px;
  }

  .auth-form-header h2 {
    font-size: 27px;
  }

  .form-grid.two,
  .form-grid.address,
  .onboarding-progress {
    grid-template-columns: 1fr;
  }

  .password-row,
  .promo-row {
    grid-template-columns: 1fr;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions button,
  .promo-row button {
    width: 100%;
  }

  .topbar {
    align-items: stretch;
    height: auto;
    flex-direction: column;
  }

  .topbar-left,
  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .search-wrap {
    min-width: 0;
    flex: 1;
  }

  .page-content {
    padding: 14px;
  }

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

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