/* ==========================================================================
   DZCloud — Comptabilité Algérienne
   Premium accounting UI · deep navy + single emerald accent · French SCF
   Mobile-first, no external assets, no Unicode icon glyphs.
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-mono: "SFMono-Regular", ui-monospace, "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --navy-950: #060c16;
  --navy-900: #0a1526;
  --navy-850: #0d1b30;
  --navy-800: #10213a;
  --navy-700: #1a3151;
  --navy-600: #29466b;
  --ink: #142033;
  --ink-soft: #33445a;
  --muted: #5c6b7f;
  --muted-2: #5f6e82;
  --canvas: #f2f5f8;
  --canvas-deep: #e9eef4;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f2f6fa;
  --line: #e1e8f0;
  --line-strong: #c9d5e2;
  --accent: #0e7c66;
  --accent-strong: #09604e;
  --accent-bright: #16a085;
  --accent-ink: #0a4d3f;
  --accent-soft: #e7f4f0;
  --accent-soft-2: #d2ebe4;
  --danger: #b4233a;
  --danger-soft: #fbeaec;
  --danger-line: #f0c4ca;
  --warning: #8a5600;
  --warning-soft: #fdf3e1;
  --warning-line: #efd9ad;
  --info-soft: #eef4fb;
  --info-line: #cfdfef;
  --info-ink: #29466b;
  --white: #ffffff;

  --shadow-xs: 0 1px 2px rgba(16, 33, 58, 0.05);
  --shadow-sm: 0 1px 2px rgba(16, 33, 58, 0.06), 0 2px 6px rgba(16, 33, 58, 0.04);
  --shadow-md: 0 14px 30px -18px rgba(16, 33, 58, 0.35), 0 2px 6px rgba(16, 33, 58, 0.05);
  --shadow-lg: 0 32px 70px -28px rgba(6, 12, 22, 0.55), 0 8px 20px rgba(6, 12, 22, 0.12);

  --radius-xs: 7px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --sidebar-w: 272px;
  --topbar-h: 76px;
  --content-max: 1460px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

button {
  cursor: pointer;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.08em 0.34em;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent-soft-2);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

.sidebar :focus-visible,
.bottom-nav :focus-visible,
.btn-primary:focus-visible {
  outline-color: #7fe0c9;
  outline-offset: 2px;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--white);
  color: var(--navy-900);
  font-weight: 700;
  box-shadow: var(--shadow-md);
  transform: translateY(-160%);
  transition: transform 160ms var(--ease);
}

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

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

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite symbol {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--sidebar-w);
  color: #d8e2ef;
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(22, 160, 133, 0.2), transparent 55%),
    radial-gradient(90% 50% at 100% 100%, rgba(41, 70, 107, 0.42), transparent 60%),
    linear-gradient(180deg, #0b1728 0%, #070f1c 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.024) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 22px);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 78%);
}

.sidebar-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 16px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 2px;
  border-radius: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  display: block;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-mark--small {
  width: 32px;
  height: 32px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1;
  letter-spacing: -0.015em;
  color: #f7f5ef;
}

.brand-tag {
  margin-top: 4px;
  font-size: 0.64rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #8fa3bb;
  font-weight: 650;
}

.company-card {
  margin: 22px 4px 8px;
  padding: 14px 14px 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.company-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #7fd3bf;
  font-weight: 700;
}

.company-card strong {
  font-size: 0.76rem;
  line-height: 1.42;
  letter-spacing: 0.035em;
  color: #edf2f8;
  font-weight: 650;
}

.company-meta {
  font-size: 0.68rem;
  color: #8095ae;
  line-height: 1.4;
}

.nav {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group-label {
  margin: 18px 12px 7px;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6d8199;
  font-weight: 700;
}

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

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #aebdd0;
  font-size: 0.86rem;
  font-weight: 550;
  letter-spacing: 0.005em;
  transition: background 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}

.nav-link .icon {
  width: 19px;
  height: 19px;
  color: #7e93ac;
  transition: color 160ms var(--ease);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #f0f4f9;
}

.nav-link:hover .icon {
  color: #b9c9db;
}

.nav-link[aria-current="page"] {
  background: rgba(22, 160, 133, 0.14);
  color: #f4f8fb;
  font-weight: 650;
}

.nav-link[aria-current="page"] .icon {
  color: #5fd4ba;
}

.nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-bright);
  box-shadow: 0 0 14px rgba(22, 160, 133, 0.55);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sidebar-api {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  color: #dfe8f3;
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.sidebar-api:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}

.sidebar-api > .icon {
  margin-left: auto;
  width: 17px;
  height: 17px;
  color: #7f93ab;
}

.sidebar-api-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.sidebar-api-label {
  font-size: 0.61rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7f93ab;
  font-weight: 650;
}

.sidebar-api [data-api-text] {
  font-size: 0.76rem;
  font-weight: 600;
  color: #e6eef7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-legal {
  padding: 0 4px;
  font-size: 0.66rem;
  line-height: 1.45;
  color: #71849b;
}

.sidebar-version {
  padding: 0 4px;
  font-size: 0.61rem;
  letter-spacing: 0.06em;
  color: #56687e;
}

.main-wrap {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-w);
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(14, 124, 102, 0.055), transparent 70%),
    var(--canvas);
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(242, 245, 248, 0.9);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid rgba(201, 213, 226, 0.72);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--topbar-h);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 10px clamp(16px, 3vw, 36px);
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 8px;
}

.mobile-brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--navy-900);
}

.topbar-context {
  min-width: 0;
}

.eyebrow {
  margin-bottom: 4px;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.topbar-context .eyebrow {
  color: var(--muted-2);
  letter-spacing: 0.13em;
}

.topbar-context h1 {
  font-family: var(--font-display);
  font-size: clamp(1.28rem, 2vw, 1.62rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy-900);
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.asof-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 6px 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.asof-field label {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.asof-field input {
  width: 144px;
  min-height: 44px;
  border: 0;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink);
  padding: 0 4px;
}

.asof-field input:focus-visible {
  outline-offset: 0;
  border-radius: 6px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: var(--shadow-xs);
  transition: background 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}

.icon-btn:hover {
  background: var(--surface-3);
  border-color: #b6c6d8;
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn.is-spinning .icon {
  animation: spin 900ms linear infinite;
}

.api-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}

.api-pill:hover {
  border-color: #b6c6d8;
  background: var(--surface-3);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(120, 134, 152, 0.14);
}

[data-health="online"] .status-dot,
.status-dot.is-online {
  background: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.16);
}

[data-health="offline"] .status-dot,
.status-dot.is-offline {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 58, 0.13);
}

[data-health="loading"] .status-dot,
.status-dot.is-loading,
.status-dot--idle {
  background: #c48a1a;
  box-shadow: 0 0 0 3px rgba(196, 138, 26, 0.14);
  animation: pulse 1.6s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Main, page heads, panels
   -------------------------------------------------------------------------- */

main {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 34px) clamp(16px, 3vw, 36px) 40px;
  outline: none;
}

.page {
  animation: page-in 300ms var(--ease-out) both;
}

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-head-copy {
  min-width: 0;
  flex: 1 1 420px;
}

.page-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.026em;
  line-height: 1.08;
  color: var(--navy-900);
}

.lede {
  margin-top: 8px;
  max-width: 72ch;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.lede code {
  white-space: nowrap;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-head-actions--date {
  align-self: flex-end;
}

.panel-kicker {
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
}

.panel-head h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--ink);
  line-height: 1.3;
}

.panel-body {
  padding: 16px 20px 20px;
}

.panel-body--tight {
  padding-top: 10px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  border-radius: 6px;
  white-space: nowrap;
}

.text-link .icon {
  width: 15px;
  height: 15px;
  transition: transform 160ms var(--ease);
}

.text-link:hover .icon {
  transform: translateX(2px);
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.overview-grid > :last-child {
  grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   Buttons, fields, badges
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.btn-primary {
  background: var(--navy-900);
  color: #f7fafc;
  border-color: var(--navy-900);
  box-shadow: 0 1px 2px rgba(10, 21, 38, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: #b6c6d8;
}

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

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

.btn-block {
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field--grow {
  flex: 1 1 260px;
}

.field--inline {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.field > label,
.field--inline > label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.field--inline > label {
  white-space: nowrap;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.field--inline input {
  width: 150px;
  min-height: 44px;
  border: 0;
  padding: 0 4px;
  font-weight: 650;
  background: transparent;
}

.field input::placeholder {
  color: var(--muted-2);
  font-weight: 400;
}

.field input:hover,
.field select:hover {
  border-color: #b6c6d8;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.14);
}

.field--inline input:focus {
  box-shadow: none;
}

.field-help {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
}

.input-icon {
  position: relative;
}

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

.input-icon > input {
  padding-left: 38px;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-xs);
  margin-bottom: 18px;
}

.toolbar--form {
  align-items: flex-end;
}

.toolbar-reset {
  margin-left: auto;
}

.toolbar-submit {
  margin-left: auto;
}

.period-error {
  flex-basis: 100%;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--danger);
}

.view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--canvas-deep);
  border: 1px solid var(--line);
}

.segmented button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  transition: background 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.results-meta {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: nowrap;
}

.badge .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.badge--neutral {
  background: var(--surface-3);
  border-color: var(--line);
  color: var(--muted);
}

.badge--success {
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
  color: var(--accent-ink);
}

.badge--warning {
  background: var(--warning-soft);
  border-color: var(--warning-line);
  color: var(--warning);
}

.badge--danger {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}

.badge--info {
  background: var(--info-soft);
  border-color: var(--info-line);
  color: var(--info-ink);
}

.inline-alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.8rem;
  line-height: 1.55;
  margin-bottom: 16px;
  color: var(--ink-soft);
}

.inline-alert > .icon {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
}

.inline-alert strong {
  color: var(--ink);
}

.inline-alert--warning {
  background: var(--warning-soft);
  border-color: var(--warning-line);
  color: #6b4300;
}

.inline-alert--danger {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: #7c1828;
}

.inline-alert--info {
  background: var(--info-soft);
  border-color: var(--info-line);
  color: #223d5c;
}

.inline-alert > div {
  min-width: 0;
}

/* --------------------------------------------------------------------------
   KPI cards
   -------------------------------------------------------------------------- */

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

.kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 138px;
  min-width: 0;
  padding: 15px 15px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  text-align: left;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent-bright);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: #c4d2e1;
  box-shadow: var(--shadow-md);
}

.kpi-card:hover::before {
  opacity: 1;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.kpi-icon .icon {
  width: 17px;
  height: 17px;
}

.kpi-drill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}

.kpi-drill .icon {
  width: 12px;
  height: 12px;
}

.kpi-card:hover .kpi-drill,
.kpi-card:focus-visible .kpi-drill {
  opacity: 1;
  transform: translateX(0);
}

.kpi-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 2px;
  min-height: 1.35em;
  font-size: clamp(1.05rem, 1.7vw, 1.44rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.kpi-value .amount {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.kpi-value .unit {
  font-size: 0.58em;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  margin-left: 0.2em;
}

.kpi-value .empty-value {
  color: var(--muted-2);
  font-weight: 500;
}

.kpi-card[data-tone="negative"] .kpi-value {
  color: var(--danger);
}

.kpi-card[data-tone="positive"] .kpi-value {
  color: var(--accent-strong);
}

.kpi-sub {
  margin-top: auto;
  padding-top: 4px;
  font-size: 0.67rem;
  line-height: 1.35;
  color: var(--muted-2);
  overflow-wrap: anywhere;
}

.kpi-card[data-state="loading"] .kpi-value {
  min-height: 1.6em;
}

.kpi-card[data-state="error"] .kpi-value {
  color: var(--danger);
  font-size: 0.95rem;
  font-weight: 650;
}

.quality-slot .badge {
  min-height: 30px;
}

/* --------------------------------------------------------------------------
   Skeletons and states
   -------------------------------------------------------------------------- */

.skeleton {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, #e9eef4 0%, #f4f7fa 50%, #e9eef4 100%);
  background-size: 220% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  color: transparent;
}

.skeleton-value {
  width: 72%;
  height: 1.35em;
}

.skeleton-text {
  width: 100%;
  height: 12px;
  margin-bottom: 10px;
}

.skeleton-text--short {
  width: 58%;
}

.skeleton-block {
  width: 100%;
  height: 54px;
  margin-top: 6px;
}

.skeleton-row {
  height: 38px;
  margin-bottom: 8px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 7px;
  padding: 44px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
}

.empty-state .empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted-2);
}

.empty-state .empty-icon .icon {
  width: 21px;
  height: 21px;
}

.empty-state h3,
.empty-state strong {
  font-size: 0.93rem;
  color: var(--ink);
  font-weight: 700;
}

.empty-state p {
  max-width: 52ch;
  font-size: 0.79rem;
  line-height: 1.55;
}

.empty-state--compact {
  padding: 26px 18px;
}

.error-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: #7c1828;
}

.error-state-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 750;
  color: var(--danger);
}

.error-state-head .icon {
  width: 18px;
  height: 18px;
}

.error-state p {
  font-size: 0.78rem;
  line-height: 1.55;
  color: #7c3a45;
}

.error-state code {
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--danger-line);
  color: #7c1828;
}

.error-state .btn {
  margin-top: 4px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.75rem;
  background: var(--surface);
  border-color: var(--danger-line);
  color: var(--danger);
}

.error-state .btn:hover {
  background: #fff;
}

/* --------------------------------------------------------------------------
   Sidebar / topbar responsive shell + bottom nav
   -------------------------------------------------------------------------- */

.bottom-nav {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 70;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(8, 17, 31, 0.97);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.bottom-nav a,
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 50px;
  padding: 3px 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9fb0c4;
  font-size: 0.59rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-align: center;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

.bottom-nav .icon {
  width: 21px;
  height: 21px;
}

.bottom-nav a[aria-current="page"] {
  background: rgba(22, 160, 133, 0.16);
  color: #f2f8f6;
}

.bottom-nav a[aria-current="page"] .icon {
  color: #64d8bf;
}

.bottom-nav button[aria-current="page"],
.bottom-nav button[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.07);
  color: #f2f8f6;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  padding: 18px clamp(16px, 3vw, 36px) 28px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.7rem;
  line-height: 1.5;
}

@media (max-width: 1099px) {
  .overview-grid,
  .split-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .overview-grid > :last-child {
    grid-column: auto;
  }
}

@media (max-width: 979px) {
  .sidebar {
    display: none;
  }

  .main-wrap {
    margin-left: 0;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .bottom-nav {
    display: grid;
  }

  .topbar-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand pill"
      "context context"
      "actions actions";
    gap: 8px 12px;
    padding: 10px 16px 12px;
    min-height: 0;
  }

  .mobile-brand {
    display: flex;
    grid-area: brand;
  }

  .topbar-context {
    grid-area: context;
  }

  .topbar-context .eyebrow {
    font-size: 0.58rem;
    margin-bottom: 3px;
  }

  .topbar-context h1 {
    font-size: 1.32rem;
  }

  .topbar-actions {
    grid-area: actions;
    width: 100%;
    gap: 8px;
  }

  .asof-field {
    flex: 1 1 auto;
  }

  .asof-field input {
    width: 100%;
    min-width: 0;
  }

  .api-pill {
    grid-area: pill;
    justify-self: end;
  }

  .app-footer {
    padding-bottom: calc(28px + 76px + env(safe-area-inset-bottom));
  }

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

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

  .page-head-actions .btn {
    flex: 1 1 auto;
  }

  .page-head-actions--date .field--inline {
    width: 100%;
  }

  .page-head-actions--date .field--inline input {
    width: 100%;
  }
}

@media (max-width: 559px) {
  .api-pill-text {
    display: none;
  }

  .api-pill {
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .api-pill .status-dot {
    width: 9px;
    height: 9px;
  }

  .topbar-actions .asof-field {
    padding-left: 11px;
  }

  .asof-field label {
    font-size: 0.58rem;
  }

  .toolbar {
    padding: 12px;
    gap: 10px;
  }

  .toolbar-submit,
  .toolbar-reset {
    margin-left: 0;
    width: 100%;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
    padding: 0 10px;
  }

  .view-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .kpi-card {
    min-height: 132px;
    padding: 13px 12px 11px;
  }

  .kpi-value {
    font-size: 1.02rem;
  }

  .kpi-drill {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 700px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1240px) {
  .situation-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .kpi-grid {
    gap: 16px;
  }

  .kpi-card {
    min-height: 146px;
    padding: 17px 18px 15px;
  }
}

/* --------------------------------------------------------------------------
   Tables & financial rows
   -------------------------------------------------------------------------- */

.table-wrap {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.data-table caption {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.7rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}

.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink-soft);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 140ms var(--ease);
}

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

.data-table tfoot td {
  padding: 12px 14px;
  border-top: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-weight: 700;
  color: var(--ink);
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.78rem;
}

.data-table .col-code {
  width: 92px;
}

.data-table--balance th:first-child {
  width: 34%;
}

.data-table--balance th.num {
  width: 16%;
}

.data-table--balance th:last-child {
  width: 12%;
}

.data-table--balance td.cell-account {
  min-width: 210px;
}

.acct-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.acct-code {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--navy-800);
  letter-spacing: 0.01em;
}

.acct-name {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}

.acct-link {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  min-height: 44px;
  padding: 2px 4px 2px 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  color: inherit;
}

.acct-link .icon {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
  margin-top: 3px;
  opacity: 0;
  transition: opacity 140ms var(--ease);
}

.data-table tbody tr:hover .acct-link .icon {
  opacity: 1;
}

.acct-link:hover .acct-code {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.money--negative {
  color: var(--danger);
}

.money--positive {
  color: var(--accent-strong);
}

.money--null {
  color: var(--muted-2);
}

.kind-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.kind-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--muted-2);
}

.kind-dot[data-kind="asset"]::before {
  background: var(--accent-bright);
}

.kind-dot[data-kind="liability"]::before {
  background: #b07b2a;
}

.kind-dot[data-kind="equity"]::before {
  background: var(--navy-600);
}

.kind-dot[data-kind="income"]::before {
  background: #3f7fbf;
}

.kind-dot[data-kind="expense"]::before {
  background: #a85b68;
}

.kind-dot[data-kind="contra"]::before {
  background: #8794a5;
}

/* --------------------------------------------------------------------------
   Overview extras
   -------------------------------------------------------------------------- */

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

.check-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.check-row:last-child {
  border-bottom: 0;
}

.check-row dt {
  font-size: 0.73rem;
  color: var(--muted);
  line-height: 1.35;
}

.check-row dd {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
}

.check-row dd.is-good {
  color: var(--accent-strong);
}

.check-row dd.is-bad {
  color: var(--danger);
}

.check-row--wide {
  grid-column: 1 / -1;
}

.hash-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-soft);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
  overflow-wrap: anywhere;
}

.recent-list {
  display: flex;
  flex-direction: column;
}

.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.recent-item:first-child {
  padding-top: 2px;
}

.recent-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.recent-item-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.recent-number {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 650;
  color: var(--navy-800);
}

.recent-meta {
  font-size: 0.69rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-amount {
  align-self: center;
  font-size: 0.76rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.endpoint-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 13px;
}

.endpoint-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.proof-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.proof-block-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.proof-code {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.proof-code code {
  flex: 1;
  min-width: 0;
  padding: 5px 7px;
  background: var(--surface);
  border-color: var(--line);
  font-size: 0.66rem;
  overflow-wrap: anywhere;
}

.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  transition: background 140ms var(--ease), color 140ms var(--ease);
}

.copy-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.copy-btn .icon {
  width: 15px;
  height: 15px;
}

.proof-note {
  font-size: 0.71rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Journal entries
   -------------------------------------------------------------------------- */

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.entry-card:hover {
  border-color: #c4d2e1;
}

.entry-card[data-open="true"] {
  border-color: #bdd2cd;
  box-shadow: var(--shadow-sm);
}

.entry-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 14px;
  width: 100%;
  min-height: 60px;
  padding: 12px 15px;
  border: 0;
  background: transparent;
  text-align: left;
}

.entry-summary:hover {
  background: #fafcfe;
}

.entry-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.entry-number {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy-800);
  letter-spacing: 0.01em;
}

.entry-journal {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--navy-900);
  color: #eef5f3;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 650;
  letter-spacing: 0.05em;
}

.entry-date {
  font-size: 0.72rem;
  color: var(--muted);
}

.entry-ref {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.entry-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.entry-amount {
  text-align: right;
  font-size: 0.76rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.entry-amount small {
  display: block;
  font-size: 0.61rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.entry-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
}

.entry-toggle .icon {
  width: 15px;
  height: 15px;
  transition: transform 180ms var(--ease);
}

.entry-card[data-open="true"] .entry-toggle .icon {
  transform: rotate(180deg);
}

.entry-body {
  border-top: 1px solid var(--line);
  background: #fcfdfe;
}

.entry-body .data-table {
  font-size: 0.77rem;
}

.entry-body .data-table thead th {
  background: #f6f9fc;
}

.entry-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--muted);
}

.entry-totals {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}

.entry-totals strong {
  color: var(--ink);
  font-weight: 700;
}

.entry-empty {
  font-size: 0.76rem;
  color: var(--muted);
  padding: 8px 0;
}

/* --------------------------------------------------------------------------
   Ledger summary & groups
   -------------------------------------------------------------------------- */

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

.summary-item {
  padding: 15px 17px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.summary-item dt {
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.summary-item dd {
  margin: 0;
  font-size: clamp(0.95rem, 1.3vw, 1.16rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  color: var(--navy-900);
  overflow-wrap: anywhere;
}

.summary-item dd .unit {
  font-size: 0.62em;
  color: var(--muted-2);
  font-weight: 650;
  margin-left: 0.18em;
}

.summary-item--accent dd {
  color: var(--accent-strong);
}

.summary-item--danger dd {
  color: var(--danger);
}

.summary-note {
  grid-column: 1 / -1;
  padding: 10px 17px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  color: var(--muted);
}

.ledger-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.ledger-group > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 54px;
  padding: 10px 15px;
  cursor: pointer;
  list-style: none;
  background: var(--surface-2);
  border-bottom: 1px solid transparent;
}

.ledger-group > summary::-webkit-details-marker {
  display: none;
}

.ledger-group[open] > summary {
  border-bottom-color: var(--line);
}

.ledger-group-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.ledger-group-count {
  font-size: 0.68rem;
  color: var(--muted);
}

.ledger-group-total {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.ledger-group .table-wrap,
.ledger-group .data-table {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ledger-group .data-table thead th {
  background: #fbfcfe;
}

/* --------------------------------------------------------------------------
   Situation
   -------------------------------------------------------------------------- */

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

.situation-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.situation-card-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.situation-card-value {
  font-size: clamp(1.05rem, 1.6vw, 1.34rem);
  font-weight: 700;
  letter-spacing: -0.022em;
  font-variant-numeric: tabular-nums;
  color: var(--navy-900);
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.situation-card-value .unit {
  font-size: 0.6em;
  color: var(--muted-2);
  font-weight: 650;
  margin-left: 0.18em;
}

.situation-card--accent {
  background: linear-gradient(160deg, #f4faf8 0%, #ffffff 65%);
  border-color: #cfe6df;
}

.situation-card--accent .situation-card-value {
  color: var(--accent-strong);
}

.situation-card--negative .situation-card-value {
  color: var(--danger);
}

.situation-card-foot {
  margin-top: 2px;
  font-size: 0.66rem;
  color: var(--muted-2);
  line-height: 1.4;
}

.equation-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.equation-label {
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.equation-body {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.equation-body strong {
  color: var(--ink);
  font-weight: 700;
}

.equation-op {
  color: var(--muted-2);
  font-weight: 700;
}

.equation-result {
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
}

.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
}

.quality-badge .icon {
  width: 14px;
  height: 14px;
}

.quality-badge[data-quality="provisional"] {
  background: var(--warning-soft);
  border-color: var(--warning-line);
  color: var(--warning);
}

.quality-badge[data-quality="certified"] {
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
  color: var(--accent-ink);
}

.quality-badge[data-quality="uncertified"] {
  background: var(--info-soft);
  border-color: var(--info-line);
  color: var(--info-ink);
}

.quality-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0;
}

.quality-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.quality-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.quality-row dt {
  font-size: 0.74rem;
  color: var(--muted);
}

.quality-row dd {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--ink);
  text-align: right;
  max-width: 62%;
  overflow-wrap: anywhere;
}

.quality-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--muted);
}

.proof-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.proof-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.73rem;
}

.proof-meta span:first-child {
  color: var(--muted);
}

.proof-meta span:last-child {
  font-weight: 650;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Compte de résultat
   -------------------------------------------------------------------------- */

.pnl-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.pnl-stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pnl-stat-label {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.pnl-stat-value {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--navy-900);
  overflow-wrap: anywhere;
  line-height: 1.18;
}

.pnl-stat-value .unit {
  font-size: 0.6em;
  color: var(--muted-2);
  font-weight: 650;
  margin-left: 0.18em;
}

.pnl-stat--accent {
  background: linear-gradient(160deg, #f4faf8 0%, #ffffff 65%);
  border-color: #cfe6df;
}

.pnl-stat--accent .pnl-stat-value {
  color: var(--accent-strong);
}

.pnl-stat--negative .pnl-stat-value {
  color: var(--danger);
}

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

.statement + .statement {
  margin-top: 14px;
}

.statement-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 17px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.statement-head h3 {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.statement-head span {
  font-size: 0.68rem;
  color: var(--muted);
}

.statement-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 17px;
  border-bottom: 1px solid #eef2f7;
  font-size: 0.8rem;
}

.statement-row:last-child {
  border-bottom: 0;
}

.statement-row .label {
  color: var(--ink-soft);
  min-width: 0;
}

.statement-row .label small {
  display: block;
  font-size: 0.66rem;
  color: var(--muted-2);
  margin-top: 1px;
}

.statement-row .value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.statement-row--sub {
  background: #fbfcfe;
}

.statement-row--total {
  background: var(--surface-2);
  border-top: 1px solid var(--line-strong);
}

.statement-row--total .label,
.statement-row--total .value {
  font-weight: 750;
  color: var(--ink);
}

.statement-row--grand {
  background: var(--navy-900);
  border-bottom: 0;
  padding-top: 14px;
  padding-bottom: 14px;
}

.statement-row--grand .label,
.statement-row--grand .value {
  color: #f4f8fb;
  font-weight: 750;
}

.statement-row--grand .label small {
  color: #9fb3c8;
}

.statement-row--grand .value {
  color: #7fe0c9;
  font-size: 1.02rem;
}

.statement-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 11px 17px;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--surface-2);
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.bar-label {
  font-size: 0.73rem;
  color: var(--ink-soft);
  font-weight: 550;
}

.bar-value {
  font-size: 0.71rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.bar-track {
  grid-column: 1 / -1;
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: var(--canvas-deep);
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 0%);
  border-radius: inherit;
  background: var(--accent-bright);
  transition: width 500ms var(--ease-out);
}

.bar-fill--expense {
  background: #b07b2a;
}

.bar-fill--negative {
  background: var(--danger);
}

.bar-fill--neutral {
  background: var(--navy-600);
}

/* --------------------------------------------------------------------------
   Bilan
   -------------------------------------------------------------------------- */

.bilan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.bilan-state {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.bilan-card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.bilan-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent-bright);
}

.bilan-card--passif::after {
  background: var(--navy-600);
}

.bilan-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.bilan-card-head h3 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.bilan-card-head span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--muted-2);
}

.bilan-total {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  font-size: clamp(1.45rem, 2.7vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.bilan-total .unit {
  font-size: 0.45em;
  color: var(--muted-2);
  font-weight: 650;
  letter-spacing: 0.03em;
  margin-left: 0.2em;
}

.bilan-card--passif .bilan-total {
  color: var(--navy-800);
}

.bilan-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.bilan-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.74rem;
}

.bilan-meta-row span:first-child {
  color: var(--muted);
}

.bilan-meta-row span:last-child {
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bilan-scale {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.bilan-scale-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.bilan-scale-head h3 {
  font-size: 0.85rem;
  font-weight: 700;
}

.bilan-scale-head span {
  font-size: 0.69rem;
  color: var(--muted);
}

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

.bilan-scale-label {
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--muted);
}

.bilan-scale-track {
  height: 12px;
  border-radius: 999px;
  background: var(--canvas-deep);
  overflow: hidden;
}

.bilan-scale-fill {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: inherit;
  background: var(--accent-bright);
  transition: width 600ms var(--ease-out);
}

.bilan-scale-fill--passif {
  background: var(--navy-600);
}

.bilan-scale-value {
  font-size: 0.71rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.bilan-footer {
  margin-top: 14px;
  font-size: 0.7rem;
  line-height: 1.55;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Documents
   -------------------------------------------------------------------------- */

.documents-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 184px;
  padding: 24px 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 0%, rgba(22, 160, 133, 0.05), transparent 60%),
    var(--surface-2);
  text-align: center;
  transition: border-color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent-bright);
  background:
    radial-gradient(circle at 50% 0%, rgba(22, 160, 133, 0.09), transparent 60%),
    #f7fcfb;
}

.dropzone.is-dragover {
  transform: scale(0.997);
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 5px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.dropzone-icon .icon {
  width: 23px;
  height: 23px;
}

.dropzone-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.dropzone-sub {
  font-size: 0.76rem;
  color: var(--muted);
}

.dropzone-help {
  font-size: 0.68rem;
  color: var(--muted-2);
  margin-top: 2px;
}

.queue-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 14px 0 4px;
}

.upload-queue {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.queue-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

.queue-icon .icon {
  width: 17px;
  height: 17px;
}

.queue-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.queue-name {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-meta {
  font-size: 0.67rem;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.queue-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.queue-status--pending { color: var(--muted); }
.queue-status--sending { color: var(--warning); }
.queue-status--sent { color: var(--accent-strong); }
.queue-status--failed { color: var(--danger); }
.queue-status--unavailable { color: var(--warning); }

.queue-remove {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.queue-remove:hover {
  color: var(--danger);
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.queue-remove .icon {
  width: 15px;
  height: 15px;
}

.queue-actions-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.queue-actions-row .btn {
  min-height: 44px;
  padding: 0 12px;
  font-size: 0.72rem;
}

.lifecycle {
  display: flex;
  flex-direction: column;
  gap: 2px;
  counter-reset: step;
}

.lifecycle li {
  display: flex;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.lifecycle li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.lifecycle li:first-child {
  padding-top: 0;
}

.step-index {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--accent-soft-2);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 750;
}

.lifecycle strong {
  display: block;
  font-size: 0.78rem;
  color: var(--ink);
  font-weight: 700;
}

.lifecycle p {
  margin-top: 1px;
  font-size: 0.71rem;
  line-height: 1.45;
  color: var(--muted);
}

.upload-log {
  margin-top: 10px;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--warning);
}

/* --------------------------------------------------------------------------
   IA Comptable
   -------------------------------------------------------------------------- */

.assistant-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 580px;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdfe, #ffffff);
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  background: var(--navy-900);
  color: #8fe3d1;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.chat-identity {
  min-width: 0;
}

.chat-identity h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.chat-identity p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  font-size: 0.69rem;
  color: var(--muted);
}

.chat-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 20px 0;
  padding: 12px 14px;
  border: 1px solid var(--info-line);
  border-radius: 11px;
  background: var(--info-soft);
  color: #223d5c;
}

.chat-notice > .icon {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  color: var(--accent-strong);
}

.chat-notice strong {
  display: block;
  font-size: 0.78rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.chat-notice p {
  font-size: 0.73rem;
  line-height: 1.55;
}

.chat-transcript {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  overflow-y: auto;
  min-height: 220px;
  max-height: 380px;
}

.chat-empty {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  color: var(--muted-2);
  padding: 20px;
}

.chat-empty .icon {
  width: 32px;
  height: 32px;
  color: var(--line-strong);
  margin-bottom: 4px;
}

.chat-empty p {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
}

.chat-empty span {
  font-size: 0.71rem;
  max-width: 34ch;
  line-height: 1.5;
}

.message {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 13px;
  font-size: 0.78rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.message--user {
  align-self: flex-end;
  background: var(--navy-900);
  color: #f4f8fb;
  border-bottom-right-radius: 4px;
}

.message--system {
  align-self: flex-start;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-bottom-left-radius: 4px;
}

.message-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.65;
}

.chat-prompts {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 0 20px 12px;
}

.chip {
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  transition: border-color 140ms var(--ease), color 140ms var(--ease), background 140ms var(--ease);
}

.chip:hover {
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.chat-composer {
  display: flex;
  gap: 9px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.chat-composer input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.84rem;
}

.chat-composer input:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.14);
}

.tool-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tool-list li {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.tool-list li:last-child {
  border-bottom: 0;
}

.tool-list code {
  align-self: flex-start;
  background: var(--surface-3);
  border-color: var(--line);
  font-size: 0.68rem;
  color: var(--navy-800);
}

.tool-list span {
  font-size: 0.69rem;
  color: var(--muted);
}

.tool-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted);
}

.tool-note .icon {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 1px;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Global banner
   -------------------------------------------------------------------------- */

.global-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: #7c1828;
  font-size: 0.8rem;
  line-height: 1.5;
}

.global-banner > .icon {
  width: 19px;
  height: 19px;
  flex: none;
  margin-top: 1px;
  color: var(--danger);
}

.global-banner > div {
  flex: 1 1 300px;
  min-width: 0;
}

.global-banner strong {
  display: block;
  font-size: 0.86rem;
  color: var(--danger);
}

.global-banner p {
  margin-top: 2px;
  color: #7c3a45;
  font-size: 0.76rem;
}

.banner-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}

.banner-actions .btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.72rem;
  background: var(--surface);
  border-color: var(--danger-line);
  color: var(--danger);
}

/* --------------------------------------------------------------------------
   Drawer
   -------------------------------------------------------------------------- */

.drawer-scrim,
.sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(6, 12, 22, 0.52);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 260ms var(--ease);
}

.drawer-scrim.is-open,
.sheet-scrim.is-open {
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 320ms var(--ease-out);
}

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

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy-900);
  line-height: 1.15;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
}

.detail-hero {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(22, 160, 133, 0.08), transparent 60%),
    var(--surface-2);
  margin-bottom: 16px;
}

.detail-hero-label {
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-hero-value {
  margin-top: 4px;
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--navy-900);
  overflow-wrap: anywhere;
}

.detail-hero-value .unit {
  font-size: 0.46em;
  color: var(--muted-2);
  font-weight: 650;
  letter-spacing: 0.03em;
  margin-left: 0.2em;
}

.detail-source {
  margin-top: 8px;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted);
}

.detail-source code {
  font-size: 0.66rem;
}

.detail-section {
  margin-top: 18px;
}

.detail-section h3 {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.detail-list {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.detail-list-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.75rem;
}

.detail-list-row:last-child {
  border-bottom: 0;
}

.detail-list-row dt {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-list-row dd {
  margin: 0;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}

.detail-formula {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.detail-formula code {
  background: var(--surface);
  font-size: 0.7rem;
}

.recon-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2);
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 650;
}

.recon-line.is-bad {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}

.recon-line .recon-sum {
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.detail-actions .btn {
  flex: 1 1 auto;
}

.detail-empty {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Sheets
   -------------------------------------------------------------------------- */

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 130;
  width: min(560px, 100%);
  max-height: 88vh;
  margin: 0 auto;
  padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  transform: translateY(104%);
  transition: transform 340ms var(--ease-out);
}

.sheet.is-open {
  transform: translateY(0);
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: var(--line-strong);
}

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

.sheet-head h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy-900);
}

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

.sheet-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.sheet-nav a:last-child {
  border-bottom: 0;
}

.sheet-nav a:hover {
  background: var(--surface-3);
}

.sheet-nav a .icon {
  color: var(--muted);
}

.sheet-chevron {
  margin-left: auto;
  width: 16px;
  height: 16px;
  color: var(--muted-2);
  transform: rotate(-90deg);
}

.sheet-foot {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.sheet--settings form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0 2px;
}

.sheet--settings .inline-alert {
  margin-bottom: 0;
}

.settings-test {
  min-height: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}

.settings-test.is-ok { color: var(--accent-strong); }
.settings-test.is-bad { color: var(--danger); }

.sheet-actions {
  display: flex;
  gap: 9px;
}

.sheet-actions .btn {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 160;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border-radius: 11px;
  background: var(--navy-900);
  color: #f2f7fa;
  font-size: 0.77rem;
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: toast-in 240ms var(--ease-out) both;
  pointer-events: auto;
}

.toast .icon {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  color: #7fe0c9;
}

.toast--error {
  background: #6f1625;
  border-color: rgba(255, 255, 255, 0.14);
}

.toast--error .icon {
  color: #ffb9c3;
}

.toast--warning {
  background: #5d3c00;
}

.toast--warning .icon {
  color: #ffd98f;
}

.toast.is-leaving {
  animation: toast-out 200ms var(--ease) both;
}

/* --------------------------------------------------------------------------
   Utility + animation
   -------------------------------------------------------------------------- */

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

.text-right {
  text-align: right;
}

.nowrap {
  white-space: nowrap;
}

.spin {
  animation: spin 900ms linear infinite;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

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

/* --------------------------------------------------------------------------
   Responsive refinements
   -------------------------------------------------------------------------- */

@media (min-width: 700px) {
  .summary-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

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

  .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: calc(100% - 32px);
    max-width: 540px;
    border-radius: 18px;
    transform: translate(-50%, -46%);
    opacity: 0;
    padding-bottom: 20px;
    transition: transform 280ms var(--ease-out), opacity 220ms var(--ease);
  }

  .sheet.is-open {
    transform: translate(-50%, -50%);
    opacity: 1;
  }

  .sheet-handle {
    display: none;
  }

  .toast-region {
    bottom: 24px;
    right: 24px;
  }
}

@media (min-width: 980px) {
  .documents-grid,
  .assistant-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  }

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

@media (max-width: 999px) {
  .documents-grid,
  .assistant-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-panel {
    min-height: 520px;
  }
}

@media (max-width: 699px) {
  main {
    padding-top: 18px;
  }

  .page-head h2 {
    font-size: 1.72rem;
  }

  .overview-grid,
  .split-grid {
    gap: 14px;
  }

  .panel-head {
    padding: 16px 16px 0;
  }

  .panel-body {
    padding: 14px 16px 16px;
  }

  .check-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-item {
    padding: 13px 14px;
  }

  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tfoot,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 10px;
    padding: 11px 12px;
    background: var(--surface);
  }

  .data-table tbody tr:hover {
    background: var(--surface);
  }

  .data-table tbody td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 0;
    border: 0;
    text-align: right;
    font-size: 0.78rem;
  }

  .data-table tbody td::before {
    content: attr(data-label);
    flex: none;
    font-size: 0.61rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
  }

  .data-table tbody td.num {
    text-align: right;
  }

  .data-table td.cell-account {
    display: block;
    text-align: left;
    padding: 0 0 8px;
    margin-bottom: 4px;
    border-bottom: 1px dashed var(--line);
  }

  .data-table td.cell-account::before {
    display: none;
  }

  .data-table td.cell-kind {
    display: flex;
    padding-top: 7px;
    margin-top: 3px;
    border-top: 1px dashed var(--line);
  }

  .data-table tfoot {
    margin: 0 10px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface-2);
    overflow: hidden;
  }

  .data-table tfoot tr {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    padding: 10px 12px;
    background: transparent;
  }

  .data-table tfoot td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    flex: 1 1 120px;
    padding: 2px 0;
    border: 0;
    background: transparent;
    font-size: 0.74rem;
  }

  .data-table tfoot td::before {
    content: attr(data-label);
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 650;
  }

  .entry-summary {
    padding: 12px;
  }

  .entry-side {
    gap: 8px;
  }

  .entry-amount {
    font-size: 0.71rem;
  }

  .entry-body {
    overflow: hidden;
  }

  .entry-foot {
    padding: 10px 12px;
  }

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

  .queue-actions-row {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .chat-transcript {
    padding: 14px 16px;
    max-height: 330px;
  }

  .chat-notice {
    margin: 14px 16px 0;
  }

  .chat-prompts {
    padding: 0 16px 10px;
  }

  .chat-composer {
    padding: 12px 16px 15px;
    flex-wrap: wrap;
  }

  .chat-composer .btn {
    width: 100%;
  }

  .drawer {
    top: auto;
    left: 0;
    width: 100%;
    height: 88vh;
    border-left: 0;
    border-radius: 20px 20px 0 0;
    transform: translateY(104%);
  }

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

  .drawer-head {
    padding-top: 14px;
  }

  .toast-region {
    left: 16px;
    right: 16px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    max-width: none;
  }

  .bilan-scale-row {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .bilan-scale-value {
    grid-column: 2;
    justify-self: end;
    margin-top: -2px;
  }
}

@media (max-width: 419px) {
  .kpi-grid {
    gap: 9px;
  }

  .kpi-card {
    padding: 12px 11px 10px;
    min-height: 128px;
  }

  .kpi-value {
    font-size: 0.98rem;
  }

  .kpi-label {
    font-size: 0.61rem;
  }

  .kpi-sub {
    font-size: 0.61rem;
  }

  .api-pill {
    width: 44px;
  }

  .topbar-context h1 {
    font-size: 1.2rem;
  }

  .situation-grid {
    gap: 9px;
  }

  .situation-card {
    padding: 13px 12px;
  }

  .situation-card-value {
    font-size: 1rem;
  }
}

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

@media print {
  .sidebar,
  .topbar-actions,
  .bottom-nav,
  .app-footer,
  .drawer,
  .drawer-scrim,
  .sheet,
  .sheet-scrim,
  .toast-region,
  .skip-link {
    display: none !important;
  }

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

  main {
    max-width: none;
    padding: 0;
  }

  .topbar {
    position: static;
    background: none;
    backdrop-filter: none;
  }

  .page[hidden] {
    display: none !important;
  }

  .panel,
  .kpi-card,
  .table-wrap {
    box-shadow: none;
    break-inside: avoid;
  }
}

/* Final cascade guard: 8 situation cards as 4x2 on wide screens. */
@media (min-width: 1240px) {
  .situation-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.skeleton-summary {
  display: inline-block;
  width: 72%;
  height: 1.05em;
}

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

.skeleton-card--tall {
  height: 190px;
  border-radius: var(--radius-lg);
}

.loading-cards {
  margin-bottom: 18px;
}

.table-skeleton {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* ==========================================================================
   Analyses & prévisions (V18) — gestion layer, clearly labelled
   ========================================================================== */

.nav-group--gestion-note {
  padding: 6px 2px 14px;
  border: none;
}
.nav-note {
  margin: 0;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border-left: 2px solid var(--accent-bright);
  border-radius: 4px;
}

.page-kicker {
  margin: 0 0 14px;
  padding: 10px 14px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2);
  border-radius: var(--radius);
}

.analyse-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  .analyse-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1280px) {
  .analyse-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (min-width: 768px) {
  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.field-hint {
  margin: 6px 0 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.subhead {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--ink);
}

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

.calc-result {
  margin-top: 12px;
}
.calc-list {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.calc-list dt {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}
.calc-list dd {
  margin: 0;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.calc-list dt:first-of-type {
  border-top: none;
}
@media (min-width: 560px) {
  .calc-list {
    grid-template-columns: minmax(180px, 2fr) 3fr;
  }
  .calc-list dt {
    border-top: 1px solid var(--line);
  }
  .calc-list dt:nth-of-type(1) {
    border-top: none;
  }
  .calc-list dd {
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }
  .calc-list dd:nth-of-type(1) {
    border-top: none;
  }
}

.calc-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.calc-note--warn {
  color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid var(--warning-line);
  border-radius: 6px;
  padding: 10px 12px;
}

.sim-banner {
  margin: 4px 0 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px dashed var(--danger-line);
  border-radius: 6px;
}

.pay-none {
  color: var(--danger);
  font-weight: 600;
}

.plain-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.plain-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.plain-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: top;
}
.plain-table tr:last-child td {
  border-bottom: none;
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

@media (max-width: 767px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
  .calc-list {
    grid-template-columns: 1fr;
  }
}
