:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #edf7f6;
  --ink: #101828;
  --muted: #627086;
  --line: #d9e2ec;
  --teal: #2563eb;
  --teal-dark: #1d4ed8;
  --indigo: #2563eb;
  --blue-soft: #eef4ff;
  --red: #eb3f37;
  --orange: #f06a21;
  --green: #10b981;
  --shadow: 0 22px 55px rgba(15, 33, 55, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  overflow-x: hidden;
}

html,
body,
#app {
  max-width: 100%;
}

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

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

.icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
}

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

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

nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #26354b;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px 10px;
  border-radius: 8px;
  text-align: left;
  font-weight: 600;
}

.nav-item.active {
  color: var(--teal);
  background: var(--surface-soft);
}

.nav-item b {
  background: #ff4f54;
  color: #fff;
  font-size: 12px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.verification {
  margin-top: auto;
  border: 1px dashed #7dbbb9;
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
}

.verification strong {
  display: block;
  color: var(--teal);
  margin-bottom: 12px;
}

.verification p {
  color: #334155;
  line-height: 1.55;
  margin: 0 0 12px;
}

.verification span {
  color: var(--muted);
}

.verification em {
  float: right;
  color: var(--green);
  background: #e8f8ef;
  border: 1px solid #b7e7ca;
  font-style: normal;
  padding: 2px 7px;
  border-radius: 6px;
}

a {
  color: var(--indigo);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.main {
  min-width: 0;
}

.topbar {
  height: 76px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.switch-block,
.top-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.switch-block span {
  color: #344255;
  font-size: 14px;
  font-weight: 600;
}

.segmented {
  border: 1px solid #a9c8ca;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  height: 39px;
}

.segmented button {
  border: 0;
  background: #fff;
  padding: 0 18px;
  font-weight: 700;
  color: #1d2939;
}

.segmented .selected {
  background: var(--teal);
  color: #fff;
}

.org-picker,
.role-picker select,
.panel-head select {
  height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  color: #1d2939;
}

.org-picker {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
}

.role-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #596579;
  font-size: 14px;
}

.role-picker select {
  color: var(--green);
  font-weight: 800;
  padding: 0 8px;
  background: #e7f8ee;
  border-color: #bce6ce;
}

.workspace-chip {
  min-height: 39px;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid #bfd2e5;
  border-radius: 8px;
  background: #fff;
  color: #1c365d !important;
}

.owner-badge {
  min-height: 34px;
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border-radius: 8px;
  color: #0c684e !important;
  background: #e8f8ef;
  border: 1px solid #bce6ce;
  font-size: 13px !important;
  font-weight: 800 !important;
}

.top-icons button {
  border: 0;
  background: transparent;
  height: 40px;
  min-width: 40px;
  display: grid;
  place-items: center;
  position: relative;
}

.top-icons .home-button {
  width: auto;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 800;
}

.bell i {
  position: absolute;
  top: 1px;
  right: 2px;
  background: #ff4b48;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.avatar {
  background: transparent !important;
  display: flex !important;
  gap: 8px;
  color: var(--teal);
  font-weight: 800;
}

.workspace {
  padding: 32px 30px 38px;
}

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

.page-head > *,
.head-actions,
.metric > div,
.panel,
td,
th {
  min-width: 0;
}

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

h1 {
  font-size: 28px;
  line-height: 1.15;
  margin-bottom: 7px;
}

.page-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.head-actions {
  display: flex;
  gap: 12px;
}

.button {
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #203049;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.button.primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal-dark);
  box-shadow: 0 12px 22px rgba(0, 121, 119, 0.18);
}

.button.danger {
  color: #b42318;
  background: #fff4f2;
  border-color: #fecdca;
  box-shadow: none;
}

.small-action {
  width: 100%;
  height: 40px;
  margin-top: 14px;
}

.button.outline {
  width: 100%;
  color: var(--teal);
  border-color: var(--teal);
}

.button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.button.blocked-action {
  opacity: 0.58;
  cursor: not-allowed;
  box-shadow: none;
}

.button.compact-button {
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.metric p,
.metric strong,
.metric small,
.panel h2,
.page-head h1,
.page-head p,
.info-row strong,
td,
th,
.toast,
.modal-panel {
  overflow-wrap: break-word;
  word-break: normal;
}

.metric-icon {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.metric-icon svg {
  width: 27px;
  height: 27px;
}

.metric-icon.teal {
  background: #e6f5f4;
  color: var(--teal);
}

.metric-icon.indigo {
  background: #eef0ff;
  color: var(--indigo);
}

.metric-icon.orange {
  background: #fff0e9;
  color: var(--orange);
}

.metric-icon.red {
  background: #ffeded;
  color: var(--red);
}

.metric p {
  margin: 0 0 8px;
  color: #46546a;
  font-size: 14px;
  font-weight: 700;
}

.metric strong {
  display: block;
  font-size: 23px;
  color: var(--teal);
  margin-bottom: 7px;
}

.metric small {
  color: #6c7788;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(460px, 1fr) 360px 320px;
  gap: 24px;
  align-items: start;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.quick-actions {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.quick-actions h2 {
  margin: 0 0 6px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  color: #344255;
  border-radius: 7px;
  min-height: 38px;
  padding: 0 13px;
  font-weight: 700;
}

.filter-tabs button.selected {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.list-toolbar {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.list-toolbar input,
.list-toolbar select {
  min-height: 42px;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
  background: #fff;
  padding: 0 12px;
}

.list-toolbar input {
  flex: 1;
}

.person-list {
  display: grid;
}

.person-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 36px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #edf1f4;
}

.person-row p {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.person-row > span:nth-child(3) {
  color: #46546a;
  font-size: 13px;
  font-weight: 700;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #536176;
  display: grid;
  place-items: center;
  font-size: 21px;
}

.danger-text {
  color: #b42318;
}

.left-stack,
.right-rail {
  display: grid;
  gap: 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

.panel h2 {
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 14px;
}

.panel-head {
  height: 64px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-head h2 {
  margin: 0;
}

.panel-head button {
  border: 0;
  background: transparent;
  color: #1d2939;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  color: #536176;
  text-align: left;
  font-size: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf1f4;
  color: #253349;
  vertical-align: middle;
}

.debt-row {
  cursor: pointer;
}

.debt-row:hover {
  background: #f6fafc;
}

.debt-row:focus {
  outline: 2px solid rgba(0, 122, 115, 0.22);
  outline-offset: -2px;
}

td strong {
  display: block;
  font-size: 14px;
}

td span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.status {
  display: inline-flex;
  align-items: center;
  height: 27px;
  padding: 0 9px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 12px;
}

.status.en-retard {
  color: #d92d20;
  background: #fff0ef;
  border: 1px solid #ffd0cb;
}

.status.overdue,
.status.long-overdue {
  color: #d92d20;
  background: #fff0ef;
  border: 1px solid #ffd0cb;
}

.status.a-venir {
  color: #b85604;
  background: #fff6e8;
  border: 1px solid #fedda8;
}

.status.actif,
.status.active,
.status.partial,
.status.recu,
.status.paye,
.status.paid {
  color: #087443;
  background: #e9f8ef;
  border: 1px solid #bce8cc;
}

.status.archived {
  color: #475467;
  background: #f2f4f7;
  border: 1px solid #d0d5dd;
}

.positive {
  color: #079455;
  font-weight: 800;
}

.negative {
  color: #e02d24;
  font-weight: 800;
}

.flow {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.flow.in {
  background: #e9f8ef;
  color: var(--green);
}

.flow.out {
  background: #ffeceb;
  color: var(--red);
}

.drawer {
  padding-bottom: 18px;
  box-shadow: var(--shadow);
}

.drawer label {
  display: block;
  color: #3c495d;
  font-size: 14px;
  font-weight: 700;
  margin: 14px 18px 8px;
}

.drawer input,
.drawer select,
.drawer textarea {
  width: calc(100% - 36px);
  margin: 0 18px;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
  height: 42px;
  padding: 0 12px;
  color: #233047;
  background: #fff;
}

.drawer textarea {
  padding-top: 10px;
  min-height: 80px;
  resize: vertical;
}

.person-action {
  width: calc(100% - 36px);
  margin: 10px 18px 0;
}

.radio-row {
  display: flex;
  gap: 10px;
  margin: 0 18px;
}

.radio {
  height: 34px;
  border: 0;
  background: transparent;
  color: #5b6779;
  display: flex;
  align-items: center;
  gap: 8px;
}

.radio::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 1px solid #b8c2cf;
  border-radius: 50%;
}

.radio.active::before {
  border: 4px solid var(--teal);
}

.radio:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fixed-account-note {
  margin: 0 18px;
  border: 1px solid #c7d7fe;
  background: #f3f7ff;
  border-radius: 8px;
  padding: 12px;
}

.fixed-account-note strong,
.fixed-account-note span {
  display: block;
}

.fixed-account-note strong {
  color: #183b77;
  margin-bottom: 5px;
}

.fixed-account-note span {
  color: #596579;
  font-size: 13px;
  line-height: 1.4;
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px 18px 0;
}

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

.right-rail .panel {
  padding: 18px;
}

.right-rail .panel-head {
  height: auto;
  padding: 0 0 14px;
  margin-bottom: 8px;
}

.member-row {
  display: grid;
  grid-template-columns: 35px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
}

.member-avatar.green { background: #11a36c; }
.member-avatar.violet { background: #8455da; }
.member-avatar.blue { background: #3374d6; }
.member-avatar.orange { background: #f97316; }
.member-avatar.amber { background: #eaaa08; }

.member-row strong {
  font-size: 14px;
}

.member-row em {
  font-style: normal;
  background: #eef4ff;
  color: #345bd9;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 11px 0;
  color: #596579;
  font-size: 14px;
}

.info-row strong {
  color: #233047;
}

.verify-card {
  display: flex;
  gap: 14px;
  color: var(--teal);
}

.owner-card {
  display: flex;
  gap: 14px;
  color: #123f77;
  background: #f3f7ff !important;
  border-color: #c7d7fe !important;
}

.rail-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.owner-card h2 {
  margin: 0 0 6px;
  color: #172b4d;
}

.owner-card p {
  margin: 0;
  color: #46546a;
  font-size: 13px;
  line-height: 1.45;
}

.verify-card h2 {
  margin: 0 0 5px;
  color: var(--ink);
}

.verify-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.compact {
  padding: 26px;
  color: #4b5870;
}

.compact svg {
  color: var(--teal);
}

.back-link {
  border: 0;
  background: transparent;
  color: var(--indigo);
  font-weight: 800;
  padding: 0;
  margin-bottom: 10px;
}

.detail-summary {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.empty-state {
  color: var(--muted);
  padding: 22px;
  margin: 0;
}

.payment-form {
  box-shadow: var(--shadow);
}

.landing {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 34rem),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 48%, #ffffff 100%);
  color: #1e293b;
}

.landing-nav {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(18px);
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1e293b;
  font-size: 18px;
  font-weight: 900;
}

.logo-proposal {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #2563eb;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.logo-proposal svg {
  width: 26px;
  height: 26px;
}

.logo-proposal rect {
  fill: transparent;
  stroke: currentColor;
}

.logo-proposal .mark-check {
  stroke-width: 2.6;
}

.logo-proposal .mark-line {
  opacity: 0.72;
}

.logo-proposal.large {
  width: 54px;
  height: 54px;
}

.logo-proposal.large svg {
  width: 34px;
  height: 34px;
}

.landing-links {
  display: none;
  gap: 24px;
}

.landing-links a {
  color: #475569;
  font-size: 14px;
  font-weight: 750;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-nav-head,
.mobile-menu-button {
  display: none;
}

.mobile-menu-button {
  width: 42px;
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  padding: 10px;
  place-items: center;
  gap: 4px;
}

.mobile-menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.landing-language {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 12px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 800;
}

.landing-language .icon {
  color: #2563eb;
}

.landing-language select {
  min-width: 58px;
  height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #fff;
  color: #1d4ed8;
  padding: 0 7px;
  font-weight: 900;
}

.nav-signin {
  display: none;
  height: 40px;
}

.landing-hero {
  width: min(1180px, calc(100% - 32px));
  max-width: 100%;
  margin: 0 auto;
  padding: 44px 0 42px;
  display: grid;
  gap: 30px;
}

.landing-hero > *,
.hero-copy,
.hero-preview,
.preview-window,
.preview-metrics,
.preview-metrics article,
.preview-list,
.preview-list div {
  min-width: 0;
}

.hero-copy h1 {
  max-width: 740px;
  font-size: clamp(42px, 12vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
  margin-bottom: 22px;
  color: #0f172a;
}

.hero-copy p {
  max-width: 680px;
  color: #475569;
  font-size: clamp(17px, 4vw, 21px);
  line-height: 1.55;
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions .button {
  min-width: 155px;
}

.button.ghost {
  background: #fff;
  border-color: #cbd5e1;
  color: #1e293b;
  box-shadow: none;
}

.quick-proofs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 24px;
}

.quick-proofs span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.quick-proofs .icon {
  color: #10b981;
}

.hero-preview {
  min-width: 0;
}

.preview-window {
  background: #fff;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.preview-toolbar {
  height: 50px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}

.preview-toolbar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd5e1;
}

.preview-toolbar span:first-child {
  background: #ef4444;
}

.preview-toolbar span:nth-child(2) {
  background: #f59e0b;
}

.preview-toolbar span:nth-child(3) {
  background: #10b981;
}

.preview-toolbar strong {
  margin-left: auto;
  color: #1e293b;
}

.preview-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 16px;
  background: #f8fafc;
}

.preview-metrics article {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
}

.preview-metrics small {
  color: #64748b;
  font-weight: 750;
}

.preview-metrics strong {
  display: block;
  color: #2563eb;
  font-size: 22px;
  margin-top: 5px;
  overflow-wrap: break-word;
}

.preview-list {
  display: grid;
  padding: 10px 16px 16px;
}

.preview-list div {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #edf2f7;
}

.preview-list div:last-child {
  border-bottom: 0;
}

.preview-list strong {
  color: #1e293b;
}

.preview-list em {
  grid-column: 2;
  color: #64748b;
  font-style: normal;
  font-size: 13px;
}

.preview-list b {
  grid-column: 3;
  grid-row: 1 / span 2;
  color: #0f172a;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2563eb;
}

.status-dot.success {
  background: #10b981;
}

.status-dot.warning {
  background: #f59e0b;
}

.status-dot.blue {
  background: #2563eb;
}

.auth-panel {
  background: #fff;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-panel h2 {
  margin-bottom: 16px;
  font-size: 22px;
}

.auth-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 14px 0 0;
}

.auth-panel label {
  display: block;
  color: #344255;
  font-size: 13px;
  font-weight: 800;
  margin: 13px 0 7px;
}

.auth-panel input {
  width: 100%;
  height: 44px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  padding: 0 12px;
  color: #233047;
  background: #fff;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tabs button {
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 850;
}

.auth-tabs button.selected {
  border-color: #2563eb;
  background: #eef4ff;
  color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-message {
  border-radius: 8px;
  padding: 11px 12px;
  font-weight: 750;
  margin: 0 0 14px;
}

.auth-message.error {
  background: #fff4f2;
  border: 1px solid #fecdca;
  color: #b42318;
}

.auth-message.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.auth-switch {
  width: 100%;
  margin-bottom: 14px;
}

.form-message {
  margin: 16px 18px 0;
}

.empty-panel {
  padding: 28px;
  display: grid;
  gap: 14px;
  justify-items: start;
}

.empty-dashboard {
  grid-template-columns: minmax(360px, 1fr) 320px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.42);
  display: grid;
  place-items: center;
  padding: 18px;
}

.confirmation-backdrop {
  z-index: 40;
}

.confirmation-panel {
  max-width: 440px;
  padding-bottom: 18px;
}

.confirmation-panel > p {
  color: #46546a;
  padding: 20px 18px 0;
  margin: 0;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  max-width: 360px;
  border-radius: 8px;
  padding: 13px 16px;
  color: #fff;
  background: #087443;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.debt-dates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 20px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.debt-dates .info-row {
  margin: 0;
}

.toast.error {
  background: #b42318;
}

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

.settings-panel {
  padding: 20px;
}

.settings-panel .button {
  margin-top: 16px;
}

.about-panel {
  max-width: 760px;
  padding: 24px;
}

.about-panel strong {
  display: block;
  margin-bottom: 18px;
}

.about-panel p {
  line-height: 1.65;
}

.app-footer {
  padding: 22px 30px 28px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  overflow-wrap: break-word;
}

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

.modal-panel {
  width: min(100%, 480px);
  max-height: calc(100vh - 36px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.modal-form {
  border: 0;
  box-shadow: none;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}

.launch-button {
  width: 100%;
  margin-top: 6px;
}

.landing-features,
.app-preview-section,
.account-section,
.final-cta {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.trust-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  gap: 14px;
  align-items: center;
  background: #ffffff;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

.trust-section div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trust-section span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #10b981;
  background: #ecfdf5;
  flex: 0 0 auto;
}

.trust-section h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.1;
  letter-spacing: 0;
}

.trust-section p {
  margin: 0;
  color: #475569;
  font-size: 16px;
  line-height: 1.55;
}

.section-head {
  max-width: 680px;
  margin-bottom: 24px;
}

.section-head h2,
.final-cta h2 {
  font-size: clamp(30px, 7vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
  color: #0f172a;
  margin-bottom: 12px;
}

.section-head p,
.final-cta p {
  color: #64748b;
  font-size: 17px;
  line-height: 1.55;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.feature-grid article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.feature-grid span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--indigo);
  margin-bottom: 16px;
}

.feature-grid h3 {
  margin: 0 0 8px;
  color: #172b4d;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.product-showcase {
  display: grid;
  gap: 24px;
  align-items: center;
  background: #fff;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.08);
}

.phone-preview {
  width: min(100%, 320px);
  margin: 0 auto;
  background: #0f172a;
  color: #fff;
  border-radius: 28px;
  padding: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12), 0 22px 45px rgba(15, 23, 42, 0.18);
}

.phone-top {
  width: 72px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.35);
  margin: 0 auto 20px;
}

.phone-preview h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.phone-card {
  background: #2563eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}

.phone-card span {
  display: block;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
}

.phone-card strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.phone-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.phone-row b {
  font-size: 14px;
}

.phone-row em {
  font-style: normal;
  color: #93c5fd;
  font-size: 13px;
}

.phone-preview .button {
  width: 100%;
  margin-top: 8px;
}

.showcase-copy h3 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #0f172a;
}

.showcase-copy p {
  color: #64748b;
  line-height: 1.6;
}

.logo-card {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
  font-size: 20px;
  font-weight: 900;
  color: #1e293b;
}

.account-section {
  display: grid;
  gap: 24px;
}

.account-panel {
  max-width: 500px;
  width: 100%;
}

.final-cta {
  text-align: center;
  padding-bottom: 86px;
}

.final-cta .hero-actions {
  justify-content: center;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .brand strong,
  .nav-item span,
  .verification {
    display: none;
  }

  .nav-item {
    grid-template-columns: 1fr;
    place-items: center;
  }

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

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

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

  .right-rail {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (min-width: 760px) {
  .landing-links {
    display: flex;
  }

  .nav-signin {
    display: inline-flex;
  }

  .landing-hero {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 500px);
    align-items: center;
    padding: 78px 0 64px;
  }

  .quick-proofs {
    grid-template-columns: repeat(3, max-content);
  }

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

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

  .product-showcase {
    grid-template-columns: 360px 1fr;
    padding: 34px;
  }

  .account-section {
    grid-template-columns: minmax(0, 1fr) 500px;
    align-items: start;
  }

  .trust-section {
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
    padding: 28px 34px;
  }
}

@media (max-width: 760px) {
  .landing,
  .landing-nav,
  .landing-hero,
  .landing-features,
  .trust-section,
  .app-preview-section,
  .account-section,
  .final-cta,
  .hero-copy,
  .hero-preview,
  .preview-window,
  .product-showcase {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: auto;
    padding: 8px 10px;
    gap: 0;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar nav {
    display: none;
  }

  .sidebar.mobile-menu-open nav {
    display: grid;
  }

  .sidebar .nav-item span {
    display: inline;
  }

  .sidebar .verification {
    display: none;
  }

  .sidebar > .brand {
    display: none;
  }

  .topbar {
    height: auto;
    align-items: flex-start;
    padding: 14px;
    gap: 12px;
  }

  .switch-block {
    flex-wrap: wrap;
    gap: 10px;
  }

  .top-icons {
    margin-left: auto;
  }

  .workspace {
    padding: 20px 14px;
  }

  .app-footer {
    padding: 20px 14px 24px;
  }

  .page-head,
  .head-actions {
    display: grid;
    width: 100%;
  }

  .head-actions .button,
  .drawer-actions .button {
    width: 100%;
    min-height: 46px;
    height: auto;
    padding-top: 11px;
    padding-bottom: 11px;
    white-space: normal;
    line-height: 1.25;
  }

  .summary-grid,
  .detail-summary,
  .right-rail,
  .settings-grid,
  .debt-dates {
    grid-template-columns: 1fr;
  }

  .list-toolbar {
    display: grid;
  }

  .person-row {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
  }

  .person-row > span:nth-child(3) {
    display: none;
  }

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

  .table-panel {
    overflow-x: auto;
  }

  table {
    min-width: 720px;
  }

  .landing-nav {
    padding: 14px 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand toggle"
      "actions actions"
      "links links";
    gap: 10px;
  }

  .landing-brand {
    grid-area: brand;
  }

  .landing-nav > .mobile-menu-button {
    grid-area: toggle;
  }

  .landing-links {
    display: none;
    grid-area: links;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    gap: 6px;
  }

  .landing-links.mobile-menu-open {
    display: grid;
  }

  .landing-links a {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 7px;
  }

  .landing-links a:hover,
  .landing-links a:focus-visible {
    background: var(--surface-soft);
  }

  .landing-nav-actions {
    grid-area: actions;
    width: 100%;
    margin-left: 0;
    min-width: 0;
    justify-content: space-between;
  }

  .hero-copy h1 {
    width: 100%;
    max-width: 100%;
    font-size: 36px;
    line-height: 1.05;
  }

  .hero-copy p {
    width: 100%;
    max-width: 100%;
    font-size: 17px;
  }

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

  .hero-actions .button {
    width: 100%;
    max-width: 100%;
  }

  .landing-hero,
  .landing-features,
  .app-preview-section,
  .account-section,
  .final-cta {
    padding-left: 16px;
    padding-right: 16px;
  }

  .trust-section,
  .product-showcase {
    padding-left: 16px;
    padding-right: 16px;
  }

  .preview-window,
  .preview-toolbar,
  .preview-metrics,
  .preview-list {
    max-width: calc(100vw - 32px);
  }

  .preview-toolbar strong {
    max-width: 180px;
    text-align: right;
  }

  .landing-brand strong {
    font-size: 16px;
    overflow-wrap: break-word;
  }

  .role-picker {
    font-size: 12px;
  }

  .landing-language {
    flex: 1;
    max-width: 190px;
  }

  .hero-copy,
  .hero-copy h1,
  .hero-copy p,
  .preview-toolbar strong,
  .preview-list strong,
  .preview-list b {
    overflow-wrap: break-word;
  }

  .preview-list div {
    grid-template-columns: 14px minmax(0, 1fr) auto;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111827;
    --surface-soft: #172033;
    --ink: #e5edf8;
    --muted: #9aa8bd;
    --line: #263348;
    --blue-soft: #14254a;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  }

  body {
    background: var(--bg);
    color: var(--ink);
  }

  .landing {
    background:
      radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 32%),
      linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
  }

  .landing-nav {
    background: rgba(11, 17, 32, 0.82);
  }

  .sidebar,
  .topbar,
  .panel,
  .metric,
  .drawer,
  .modal-panel,
  .auth-panel,
  .feature-grid article,
  .preview-window,
  .preview-metrics article,
  .trust-section,
  .product-showcase,
  .logo-card {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
  }

  .preview-metrics,
  .logo-card,
  .table-panel,
  .auth-tabs button,
  .button.ghost,
  .fixed-account-note,
  .verification {
    background: var(--surface-soft);
    border-color: var(--line);
  }

  .hero-copy h1,
  .section-head h2,
  .final-cta h2,
  .trust-section h2,
  .showcase-copy h3,
  .landing-brand,
  .preview-toolbar strong,
  .feature-grid h3,
  .panel h2,
  .page-head h1,
  .metric strong,
  .auth-panel h2,
  .brand,
  .nav-item,
  .logo-card,
  table,
  th {
    color: var(--ink);
  }

  .hero-copy p,
  .section-head p,
  .final-cta p,
  .trust-section p,
  .showcase-copy p,
  .feature-grid p,
  .quick-proofs span,
  .panel p,
  .page-head p,
  td,
  .auth-panel label,
  .preview-metrics small,
  .verification p,
  .verification span {
    color: var(--muted);
  }

  .landing-links a,
  a {
    color: #93c5fd;
  }

  input,
  select,
  textarea,
  .auth-panel input,
  .drawer input,
  .drawer select,
  .drawer textarea,
  .role-picker select,
  .panel-head select {
    background: #0f172a;
    border-color: var(--line);
    color: var(--ink);
  }

  input::placeholder,
  textarea::placeholder {
    color: #718096;
  }

  .button.ghost,
  .nav-signin {
    color: var(--ink);
  }

  .auth-tabs button {
    color: var(--muted);
  }

  .auth-tabs button.selected {
    background: #14254a;
    color: #93c5fd;
    border-color: #2563eb;
  }

  .auth-message.error {
    background: rgba(180, 35, 24, 0.14);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fca5a5;
  }

  .auth-message.success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
  }

  .preview-toolbar,
  .preview-list div,
  table th,
  table td,
  .sidebar,
  .topbar {
    border-color: var(--line);
  }

  .phone-preview {
    background: #030712;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 22px 45px rgba(0, 0, 0, 0.42);
  }

  .trust-section span,
  .feature-grid span {
    background: rgba(16, 185, 129, 0.12);
  }
}

/* V1 mobile layout: compact navigation and card-based data tables. */
@media (max-width: 768px) {
  html,
  body,
  #app,
  .app-shell,
  .main,
  .workspace,
  .panel,
  .table-panel {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  .sidebar {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    overflow: hidden;
  }

  .mobile-nav-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-brand {
    display: flex;
    min-width: 0;
    font-size: 17px;
  }

  .mobile-brand .brand-mark {
    width: 38px;
    height: 38px;
  }

  .mobile-menu-button {
    display: grid;
    flex: 0 0 42px;
  }

  .sidebar nav {
    width: 100%;
    max-width: 100%;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .sidebar.mobile-menu-open nav {
    display: grid;
  }

  .sidebar .nav-item {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px 9px;
    gap: 7px;
    justify-content: flex-start;
    font-size: 13px;
    overflow: hidden;
  }

  .sidebar .nav-item .icon {
    width: 18px;
    height: 18px;
  }

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

  .topbar {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 10px 12px;
    gap: 8px;
  }

  .switch-block {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
  }

  .role-picker {
    min-width: 0;
    gap: 5px;
    font-size: 12px;
  }

  .role-picker select {
    height: 36px;
    max-width: 62px;
  }

  .owner-badge {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .info-row {
    min-width: 0;
    align-items: flex-start;
    gap: 10px;
  }

  .info-row span {
    flex: 0 0 auto;
  }

  .info-row strong {
    min-width: 0;
    max-width: 68%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
  }

  .top-icons {
    min-width: 0;
    margin-left: 0;
    gap: 0;
  }

  .top-icons .home-button {
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .top-icons .avatar {
    display: none !important;
  }

  .workspace {
    padding: 18px 12px 24px;
  }

  .page-head {
    gap: 14px;
    margin-bottom: 18px;
  }

  .head-actions {
    gap: 8px;
  }

  .head-actions .button,
  .drawer-actions .button {
    min-height: 42px;
    padding: 9px 12px;
    font-size: 15px;
  }

  .summary-grid,
  .detail-summary {
    gap: 10px;
    margin-bottom: 16px;
  }

  .metric {
    width: 100%;
    padding: 14px;
    gap: 12px;
  }

  .metric-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
  }

  .metric strong {
    font-size: 20px;
  }

  .filter-tabs {
    width: 100%;
    gap: 6px;
  }

  .filter-tabs button {
    min-width: 0;
    min-height: 34px;
    padding: 6px 9px;
    font-size: 12px;
    white-space: normal;
  }

  .table-panel {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .table-panel table,
  .table-panel thead,
  .table-panel tbody,
  .table-panel tr,
  .table-panel td {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .table-panel table {
    min-width: 0;
  }

  .table-panel thead {
    display: none;
  }

  .table-panel tbody {
    display: grid;
    gap: 10px;
  }

  .table-panel tr {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
  }

  .table-panel td {
    padding: 7px 0;
    border: 0;
    font-size: 13px;
    overflow-wrap: break-word;
  }

  .table-panel td + td {
    border-top: 1px solid var(--line);
  }

  .table-panel td .button {
    width: 100%;
  }

  .panel-head {
    min-height: 54px;
    height: auto;
    padding: 10px 14px;
  }

  .modal-backdrop {
    padding: 12px;
    overflow: hidden;
  }

  .modal-panel {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    overflow: hidden;
  }

  .modal-form {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 24px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .drawer input,
  .drawer select,
  .drawer textarea {
    max-width: calc(100% - 36px);
  }

  .drawer-actions {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px 18px 0;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}

@media (max-width: 420px) {
  .landing-language span {
    display: none;
  }

  .landing-language {
    flex: 0 0 auto;
    padding-left: 9px;
  }
}

@media (max-width: 480px) {
  h1,
  .page-head h1 {
    font-size: 28px;
    line-height: 1.15;
  }

  h2,
  .panel h2 {
    font-size: 22px;
  }

  .button {
    font-size: 15px;
  }

  .owner-badge {
    font-size: 11px !important;
  }

  .top-icons .home-button {
    padding: 0 8px;
    font-size: 12px;
  }
}
