/* Shell comptabilité — aligné plateforme Amelie (sidebar pleine hauteur, header gris à droite) */

.accounting-shell {
  --accounting-sidebar-bg: #0f1a2e;
  --accounting-sidebar-text: #9ca3af;
  --accounting-sidebar-text-active: #ffffff;
  --accounting-sidebar-active-bg: #1a2d4a;
  --accounting-sidebar-hover-bg: rgba(26, 45, 74, 0.6);
  --accounting-sidebar-accent: #4ade80;
  --accounting-header-height: 5rem;
  --accounting-sidebar-width: 17rem;
  --accounting-header-bg: #ffffff;
  --accounting-header-border: #e8ecf1;
  min-height: 100vh;
}

/* —— Sidebar pleine hauteur —— */
.accounting-shell #accounting-sidebar {
  background: var(--accounting-sidebar-bg) !important;
  width: var(--accounting-sidebar-width) !important;
  min-width: var(--accounting-sidebar-width) !important;
  top: 0 !important;
  bottom: 0;
  left: 0;
  height: 100vh !important;
  z-index: 1650;
  position: fixed !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.25s ease, visibility 0.25s ease;
  border-inline-end: none !important;
  font-family: "Montserrat", sans-serif;
}

.accounting-shell #accounting-sidebar:not(.show) {
  width: var(--accounting-sidebar-width) !important;
  min-width: var(--accounting-sidebar-width) !important;
}

.accounting-shell:not(.sidebar-closed) #accounting-sidebar {
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.accounting-shell.sidebar-closed #accounting-sidebar {
  transform: translateX(-100%) !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* —— Zone droite (header + contenu) —— */
.accounting-shell .accounting-workspace {
  min-height: 100vh;
  transition: margin-inline-start 0.25s ease, width 0.25s ease;
}

.accounting-shell:not(.sidebar-closed) .accounting-workspace {
  margin-inline-start: var(--accounting-sidebar-width);
  width: calc(100% - var(--accounting-sidebar-width));
}

.accounting-shell.sidebar-closed .accounting-workspace {
  margin-inline-start: 0;
  width: 100%;
}

/* —— Header blanc (aligné app-header Amélie, à droite du logo sidebar) —— */
.accounting-shell .accounting-header.app-header {
  position: fixed;
  top: 0;
  inset-inline-end: 0;
  z-index: 1700;
  height: var(--accounting-header-height) !important;
  background: var(--accounting-header-bg) !important;
  border-bottom: 1px solid var(--accounting-header-border) !important;
  transition: inset-inline-start 0.25s ease, width 0.25s ease;
  box-shadow: none;
  display: flex;
  align-items: stretch;
}

.accounting-shell .accounting-header--with-brand .main-header-container {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
}

.accounting-shell .accounting-header__brand-panel {
  flex: 0 0 var(--accounting-sidebar-width);
  width: var(--accounting-sidebar-width);
  min-width: var(--accounting-sidebar-width);
  max-width: var(--accounting-sidebar-width);
  background: var(--accounting-sidebar-bg);
  border-inline-end: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  padding: 0 1.15rem;
  overflow: hidden;
}

.accounting-shell .accounting-header__brand-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.125rem;
  text-decoration: none;
  min-width: 0;
  width: 100%;
}

.accounting-shell .accounting-brand__mark {
  height: 2.25rem;
  width: auto;
  max-width: 100%;
  display: block;
}

.accounting-shell .accounting-brand__tag {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accounting-sidebar-text);
  line-height: 1;
}

.accounting-shell:not(.sidebar-closed) .accounting-header.app-header {
  inset-inline-start: var(--accounting-sidebar-width);
  width: calc(100% - var(--accounting-sidebar-width));
}

.accounting-shell.sidebar-closed .accounting-header.app-header {
  inset-inline-start: 0;
  width: 100%;
}

.accounting-shell .accounting-header__bar.main-header-container {
  display: grid;
  grid-template-columns: minmax(3.5rem, auto) 1fr minmax(auto, max-content);
  align-items: stretch;
  justify-content: stretch;
  height: 100%;
  width: auto !important;
  flex: 1 1 auto;
  min-width: 0;
  padding-inline: 0.25rem 1rem;
}

.accounting-shell .accounting-header__bar > .header-content-right {
  justify-content: flex-end;
  align-items: center;
}

.accounting-shell .accounting-header__bar .header-element {
  align-items: center;
}

.accounting-shell .accounting-header__language {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem;
  padding: 0.5rem 0.65rem !important;
  height: auto;
  line-height: 1;
}

.accounting-shell .accounting-header__language-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  padding: 0;
  margin: 0;
  font-size: 1.125rem;
  line-height: 1;
  color: #475569;
  position: static;
  border-radius: 0;
}

.accounting-shell .accounting-header__language-code {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  color: #111c43;
}

.accounting-shell .accounting-header__left {
  display: flex;
  align-items: center;
}

.accounting-shell .accounting-header__center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.75rem;
  min-width: 0;
  padding-inline: 0.75rem;
}

.accounting-shell .accounting-header__center .accounting-header__year {
  flex-shrink: 0;
}

.accounting-shell .accounting-header__toggle-wrap {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accounting-shell .accounting-header__toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: #111c43;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.accounting-shell .accounting-header__toggle-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.accounting-shell .accounting-header__toggle-btn:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.accounting-shell .accounting-header__dossier {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: #2d3748;
  font-size: 1rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.accounting-shell .accounting-header__dossier:hover {
  background: #f1f5f9;
}

.accounting-shell .accounting-header__dossier:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.accounting-shell .accounting-header__dossier-chevron {
  font-size: 1.15rem;
  opacity: 0.55;
  flex-shrink: 0;
  line-height: 1;
}

.accounting-shell .accounting-header__year {
  display: flex;
  align-items: center;
}

.accounting-shell .accounting-year-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.4rem 0.65rem 0.4rem 0.55rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 2.5rem;
}

.accounting-shell .accounting-year-picker:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
}

.accounting-shell .accounting-year-picker:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.accounting-shell .accounting-year-picker__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.accounting-shell .accounting-year-picker__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
  min-width: 0;
}

.accounting-shell .accounting-year-picker__label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.accounting-shell .accounting-year-picker__select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #111c43;
  line-height: 1.2;
  cursor: pointer;
  min-width: 3rem;
  max-width: 4.5rem;
}

.accounting-shell .accounting-year-picker__select:focus {
  outline: none;
}

.accounting-shell .accounting-year-picker__chevron {
  font-size: 1rem;
  color: #94a3b8;
  flex-shrink: 0;
  pointer-events: none;
  margin-inline-start: -0.15rem;
}

@media (max-width: 575.98px) {
  .accounting-shell .accounting-year-picker__label {
    display: none;
  }

  .accounting-shell .accounting-year-picker__text {
    flex-direction: row;
    align-items: center;
  }

  .accounting-shell .accounting-year-picker {
    padding: 0.35rem 0.5rem;
  }
}


/* —— Contenu principal —— */
.accounting-shell .accounting-main-content {
  margin-block-start: var(--accounting-header-height) !important;
  margin-inline-start: 0 !important;
  min-height: calc(100vh - var(--accounting-header-height));
  background: #f8fafc;
  position: relative;
  z-index: 1;
}

.accounting-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1640;
}

.accounting-shell #accounting-sidebar .main-sidebar-header {
  position: sticky !important;
  top: 0 !important;
  inset-inline-start: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 5rem !important;
  min-height: 5rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  background: var(--accounting-sidebar-bg) !important;
  border-inline-end: none !important;
  border-block-end: 1px solid rgba(55, 65, 81, 0.4);
  z-index: 2;
  flex-shrink: 0;
}

.accounting-shell.sidebar-closed #accounting-sidebar .main-sidebar-header {
  display: none !important;
}

.accounting-shell #accounting-sidebar .main-sidebar-header a.header-logo {
  width: 90% !important;
  height: 80% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.accounting-shell #accounting-sidebar .main-sidebar-header a.header-logo img {
  height: 3.25rem;
  width: auto;
}

.accounting-shell #accounting-sidebar .main-sidebar {
  flex: 1 1 auto;
  min-height: 0;
  padding-block-start: 0 !important;
  height: auto;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 2rem;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

/* —— Sidebar nav (Figma: slot-online-25593055.figma.site) —— */
.accounting-shell #accounting-sidebar .main-menu-container {
  padding: 0 0.5rem 1rem;
}

.accounting-shell #accounting-sidebar .main-menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.accounting-shell #accounting-sidebar .slide {
  margin: 0;
  padding: 0 !important;
}

.accounting-shell #accounting-sidebar.app-sidebar .side-menu__item {
  position: relative;
  margin: 0.125rem 0 !important;
  padding: 0.75rem;
  gap: 0.75rem;
  border-radius: 0 !important;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-left: none;
  background: transparent;
  transition: background-color 0.15s ease;
}

.accounting-shell #accounting-sidebar.app-sidebar .side-menu__item:hover {
  color: #fff !important;
  background-color: var(--accounting-sidebar-hover-bg) !important;
  border-left: none !important;
}

.accounting-shell #accounting-sidebar.app-sidebar .side-menu__item.active {
  color: #fff !important;
  background-color: var(--accounting-sidebar-active-bg) !important;
  font-weight: 600;
  border-left: none !important;
}

.accounting-shell #accounting-sidebar.app-sidebar .side-menu__item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accounting-sidebar-accent);
  border-radius: 0 2px 2px 0;
}

.accounting-shell #accounting-sidebar.app-sidebar .side-menu__item.active .side-menu__label,
.accounting-shell #accounting-sidebar.app-sidebar .side-menu__item:hover .side-menu__label,
.accounting-shell #accounting-sidebar.app-sidebar .side-menu__item.active .side-menu__angle,
.accounting-shell #accounting-sidebar.app-sidebar .side-menu__item:hover .side-menu__angle {
  color: #fff !important;
}

.accounting-shell #accounting-sidebar .side-menu__icon-main,
.accounting-shell #accounting-sidebar .side-menu__item > i.bx:first-child,
.accounting-shell #accounting-sidebar .side-menu__item .d-flex.align-items-center > i.bx {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 1.25rem;
  line-height: 1;
  margin-inline-end: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.accounting-shell #accounting-sidebar .side-menu__item--featured .side-menu__icon-main {
  margin-top: 0.125rem;
}

.accounting-shell #accounting-sidebar .side-menu__item > .side-menu__label,
.accounting-shell #accounting-sidebar .side-menu__item .d-flex.align-items-center .side-menu__label,
.accounting-shell #accounting-sidebar .side-menu__item .d-flex.flex-column .side-menu__label {
  display: block;
  flex: 1;
  min-width: 0;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accounting-shell #accounting-sidebar .side-menu__item > .d-flex.align-items-center {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  gap: 0.75rem;
}

.accounting-shell #accounting-sidebar .side-menu__item .side-menu__desc {
  color: var(--accounting-sidebar-text);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.375;
  white-space: normal;
  margin: 0;
}

.accounting-shell #accounting-sidebar .side-menu__item--featured .d-flex.flex-column {
  gap: 0.125rem;
  min-width: 0;
  flex: 1;
}

.accounting-shell #accounting-sidebar .side-menu__item .side-menu__angle {
  position: static;
  flex-shrink: 0;
  font-size: 1rem;
  color: var(--accounting-sidebar-text) !important;
  transition: transform 0.15s ease;
}

.accounting-shell #accounting-sidebar .side-menu__item.child-active {
  background-color: transparent !important;
}

.accounting-shell #accounting-sidebar .side-menu__item.child-active > .d-flex.align-items-center .side-menu__label,
.accounting-shell #accounting-sidebar .side-menu__item.child-active > .side-menu__label {
  color: #fff !important;
  font-weight: 600;
}

/* Dashboard status block */
.accounting-shell #accounting-sidebar .sidebar-dashboard-status {
  padding: 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid rgba(55, 65, 81, 0.4);
}

.accounting-shell #accounting-sidebar .sidebar-dashboard-status .custom__side-menu-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0;
  margin: 0 0 0.125rem;
  text-align: end;
  gap: 0;
}

.accounting-shell #accounting-sidebar .sidebar-status-label {
  font-size: 0.6875rem;
  color: var(--accounting-sidebar-text);
  font-weight: 400;
  line-height: 1.45;
}

.accounting-shell #accounting-sidebar .sidebar-status-date {
  font-size: 0.6875rem;
  color: #fff;
  font-weight: 600;
  line-height: 1.45;
}

.accounting-shell #accounting-sidebar .sidebar-status-date-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.accounting-shell #accounting-sidebar .sidebar-status-date-row .bx-info-circle {
  font-size: 0.875rem;
  color: var(--accounting-sidebar-text);
  opacity: 1;
  vertical-align: middle;
}

/* Submenus */
.accounting-shell #accounting-sidebar .slide-submenu {
  padding: 0 0 0 1rem;
  list-style: none;
  margin: 0;
}

.accounting-shell #accounting-sidebar .slide-submenu .side-menu__item {
  padding: 0.625rem 0.75rem;
  font-weight: 500;
}

.accounting-shell #accounting-sidebar .slide-submenu .side-menu__item i {
  width: 1rem !important;
  height: 1rem !important;
  font-size: 1rem !important;
}

.accounting-shell #accounting-sidebar .slide-submenu .side-menu__item .fs-14 {
  font-size: 0.875rem !important;
  font-weight: 500;
  color: #fff;
}

@media (max-width: 991.98px) {
  .accounting-shell:not(.sidebar-closed) .accounting-workspace {
    margin-inline-start: 0;
    width: 100%;
  }

  .accounting-shell:not(.sidebar-closed) .accounting-header {
    inset-inline-start: 0;
    width: 100%;
  }
}

/* —— Éditions comptables (balance, grand livre, etc.) —— */
.accounting-edition-header {
  background: #fafbfc;
}

.accounting-edition-header__title {
  font-size: 1rem;
  white-space: nowrap;
}

.accounting-edition-header__field {
  flex-shrink: 0;
}

.accounting-edition-header__field .form-label {
  color: #64748b;
}

.accounting-edition-header__date-input,
.accounting-edition-header .form-control-sm,
.accounting-edition-header .form-select-sm {
  width: auto;
  min-width: 9.5rem;
}

.accounting-edition-header__meta {
  line-height: 1.3;
}

.accounting-edition__table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  font-size: 0.75rem;
  white-space: nowrap;
  border-bottom: 2px solid #cbd5e1;
}

.accounting-edition__table td {
  font-size: 0.8125rem;
  vertical-align: middle;
}

.accounting-edition__row--total td {
  border-top: 1px solid #cbd5e1;
  background: #f8fafc;
}

.accounting-edition__row--grand td {
  background: #e2e8f0;
  font-weight: 700;
  border-top: 2px solid #94a3b8;
}

.accounting-edition__result {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.accounting-edition__result .card-body {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

/* Pages d'édition — occuper toute la hauteur sous header + onglets */
.accounting-shell .accounting-main-content:has(
  .grand-livre,
  .balance-generale,
  .accounting-edition,
  .interrogation-comptes,
  .journal-ecritures,
  .fichier-fec,
  .bilan-interne,
  .liasse-fiscale,
  .fixed-asset-index
) {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--accounting-header-height));
  min-height: calc(100vh - var(--accounting-header-height));
  overflow: hidden;
}

.accounting-shell .accounting-main-content:has(
  .grand-livre,
  .balance-generale,
  .accounting-edition,
  .interrogation-comptes,
  .journal-ecritures,
  .fichier-fec,
  .bilan-interne,
  .liasse-fiscale,
  .fixed-asset-index
) > .accounting-workspace-tabs {
  flex-shrink: 0;
}

.accounting-shell .accounting-main-content:has(
  .grand-livre,
  .balance-generale,
  .accounting-edition,
  .interrogation-comptes,
  .journal-ecritures,
  .fichier-fec,
  .bilan-interne,
  .liasse-fiscale,
  .fixed-asset-index
) > .content-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.accounting-shell .content-wrapper:has(
  .grand-livre,
  .balance-generale,
  .accounting-edition,
  .interrogation-comptes,
  .journal-ecritures,
  .fichier-fec,
  .bilan-interne,
  .liasse-fiscale,
  .fixed-asset-index
) .accounting-workspace-tab-host,
.accounting-shell .content-wrapper:has(
  .grand-livre,
  .balance-generale,
  .accounting-edition,
  .interrogation-comptes,
  .journal-ecritures,
  .fichier-fec,
  .bilan-interne,
  .liasse-fiscale,
  .fixed-asset-index
) .accounting-tab-pane:not(.accounting-tab-pane--hidden) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.accounting-shell .grand-livre,
.accounting-shell .balance-generale,
.accounting-shell .accounting-edition,
.accounting-shell .interrogation-comptes,
.accounting-shell .journal-ecritures,
.accounting-shell .fichier-fec,
.accounting-shell .bilan-interne,
.accounting-shell .liasse-fiscale,
.accounting-shell .fixed-asset-index {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.accounting-shell .grand-livre__result,
.accounting-shell .balance-generale__result,
.accounting-shell .accounting-edition__result,
.accounting-shell .interrogation-comptes__result,
.accounting-shell .journal-ecritures__result,
.accounting-shell .fichier-fec__result,
.accounting-shell .bilan-interne__result,
.accounting-shell .liasse-fiscale__result,
.accounting-shell .fixed-asset-index__result {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.accounting-shell .grand-livre__result > .accounting-edition-header,
.accounting-shell .balance-generale__result > .accounting-edition-header,
.accounting-shell .accounting-edition__result > .accounting-edition-header,
.accounting-shell .interrogation-comptes__result > .accounting-edition-header,
.accounting-shell .journal-ecritures__result > .accounting-edition-header,
.accounting-shell .fichier-fec__result > .accounting-edition-header,
.accounting-shell .bilan-interne__result > .accounting-edition-header,
.accounting-shell .liasse-fiscale__result > .accounting-edition-header,
.accounting-shell .fixed-asset-index__result > .card-header {
  flex-shrink: 0;
}

.accounting-shell .grand-livre__result > .card-body,
.accounting-shell .balance-generale__result > .card-body,
.accounting-shell .interrogation-comptes__result > .card-body,
.accounting-shell .journal-ecritures__result > .card-body,
.accounting-shell .fichier-fec__result > .card-body,
.accounting-shell .bilan-interne__result > .card-body,
.accounting-shell .liasse-fiscale__body,
.accounting-shell .fixed-asset-index__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.accounting-shell .grand-livre__scroll,
.accounting-shell .balance-generale__scroll,
.accounting-shell .interrogation-comptes__scroll,
.accounting-shell .journal-ecritures__scroll,
.accounting-shell .fichier-fec__scroll,
.accounting-shell .liasse-fiscale__scroll,
.accounting-shell .fixed-asset-index__scroll,
.accounting-shell .bilan-interne__result > .card-body {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.accounting-shell .fixed-asset-index__toolbar {
  flex-shrink: 0;
}

.accounting-edition-tabs-bar {
  background: #fff;
  padding-top: 0.35rem;
}

.accounting-edition-tabs {
  border-bottom: 0;
  gap: 0.15rem;
  flex-wrap: nowrap;
}

.accounting-edition-tabs .nav-item {
  margin-bottom: 0;
}

.accounting-edition-tabs .nav-link {
  border: 0;
  border-radius: 0.35rem 0.35rem 0 0;
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  white-space: nowrap;
}

.accounting-edition-tabs .nav-link:hover,
.accounting-edition-tabs .nav-link:focus {
  color: var(--primary-color, #6366f1);
  background: rgba(var(--primary-rgb), 0.06);
  border-color: transparent;
}

.accounting-edition-tabs .nav-link.active {
  color: var(--primary-color, #6366f1);
  background: #f8fafc;
  border-bottom: 2px solid var(--primary-color, #6366f1);
  font-weight: 600;
}

.accounting-edition-tabs .nav-link:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Filtres segmentés (écran lettrage — pas des onglets workspace) */
.accounting-segmented {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem;
  border-radius: 0.45rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  gap: 0.1rem;
}

.accounting-segmented__btn {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: 0.35rem;
  line-height: 1.3;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.accounting-segmented__btn:hover:not(:disabled) {
  color: #334155;
  background: rgba(255, 255, 255, 0.65);
}

.accounting-segmented__btn--active {
  background: #fff;
  color: var(--primary-color, #6366f1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  font-weight: 600;
}

.accounting-segmented__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tableau rapports comptables (balance, lettrage, interrogation…) */
.accounting-report-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid #cbd5e1;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.accounting-report-table td,
.accounting-report-table tfoot td {
  font-size: 0.78rem;
  vertical-align: middle;
  border-color: #f1f5f9;
  padding: 0.28rem 0.55rem;
}

.accounting-report-table th:last-child,
.accounting-report-table td:last-child {
  padding-right: 1rem;
}

.accounting-report-table tbody tr:hover td {
  background: rgba(var(--primary-rgb), 0.04);
}

.accounting-report-table__amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 5rem;
}

.accounting-report-table__row--total td,
.accounting-report-table tfoot tr td {
  background: #f1f5f9;
  border-top: 2px solid #cbd5e1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.accounting-report-table__row--selected td {
  background: rgba(var(--primary-rgb), 0.08);
}

.accounting-report-table__caption {
  caption-side: top;
  padding: 0;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.accounting-report-table__caption-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.accounting-report-scroll {
  max-height: calc(100vh - 16rem);
  overflow: auto;
}

.accounting-edition__result.accounting-edition__result--tabs {
  max-height: calc(100vh - 14rem);
}

@media print {
  .accounting-edition-header {
    display: none !important;
  }

  .accounting-edition__result {
    max-height: none;
  }
}

/* —— Liasse fiscale ISOC 275.1 —— */
.liasse-fiscale {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.liasse-fiscale__result {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.liasse-fiscale__summary {
  flex-shrink: 0;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.liasse-fiscale__summary-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  height: 100%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.liasse-fiscale__summary-code {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary-color, #6366f1);
  letter-spacing: 0.04em;
}

.liasse-fiscale__summary-label {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.25;
  margin: 0.2rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.liasse-fiscale__summary-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.liasse-fiscale__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.liasse-fiscale__scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding-right: 0.15rem;
}

.liasse-fiscale__supplementary {
  flex-shrink: 0;
}

.tva-declaration__tabs {
  flex-shrink: 0;
}

.tva-declaration__nav-tabs {
  border-bottom: none;
  gap: 0.25rem;
}

.tva-declaration__nav-tabs .nav-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 0.35rem 0.35rem 0 0;
  padding: 0.45rem 0.85rem;
}

.tva-declaration__nav-tabs .nav-link:hover {
  color: #334155;
  background: rgba(255, 255, 255, 0.6);
}

.tva-declaration__nav-tabs .nav-link.active {
  color: #6366f1;
  background: #fff;
  border-color: var(--default-border);
}

.tva-declaration__tab-count {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.7;
  margin-left: 0.35rem;
}

.liasse-fiscale__table {
  --bs-table-hover-bg: rgba(var(--primary-rgb), 0.05);
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.liasse-fiscale__col-code {
  width: 5rem;
}

.liasse-fiscale__col-label {
  width: auto;
}

.liasse-fiscale__col-amount {
  width: 10.5rem;
}

.liasse-fiscale__caption {
  caption-side: top;
  padding: 0;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 4;
}

.liasse-fiscale__caption-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.55rem 0.85rem;
}

.liasse-fiscale__caption-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.liasse-fiscale__table thead th {
  position: sticky;
  top: 2.35rem;
  z-index: 3;
  background: #f8fafc;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  border-color: #e2e8f0;
  vertical-align: middle;
  padding: 0.45rem 0.65rem;
  border-bottom: 2px solid #cbd5e1;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
}

.liasse-fiscale__col-amount-h {
  border-left: 1px solid #e8edf3;
}

.liasse-fiscale__sticky {
  position: sticky;
  z-index: 1;
  background: inherit;
}

.liasse-fiscale__sticky--code {
  left: 0;
  width: 5rem;
  min-width: 5rem;
  max-width: 5rem;
  font-size: 0.78rem;
  color: #64748b;
  z-index: 2;
  box-shadow: 2px 0 4px rgba(15, 23, 42, 0.04);
}

.liasse-fiscale__sticky--label {
  left: 5rem;
  min-width: 14rem;
  z-index: 2;
  box-shadow: 2px 0 4px rgba(15, 23, 42, 0.04);
}

.liasse-fiscale__head-row .liasse-fiscale__sticky {
  z-index: 4;
  background: #f8fafc;
}

.liasse-fiscale__table td {
  font-size: 0.8125rem;
  vertical-align: middle;
  border-color: #f1f5f9;
  padding: 0.28rem 0.65rem;
}

.liasse-fiscale__table td:last-child,
.liasse-fiscale__table th:last-child {
  padding-right: 1rem;
}

.liasse-fiscale__label-text {
  line-height: 1.35;
  color: #334155;
}

.liasse-fiscale__amount-cell {
  text-align: right;
  border-left: 1px solid #f1f5f9;
}

.liasse-fiscale__amount {
  display: block;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #334155;
  padding: 0.2rem 0.35rem;
}

.liasse-fiscale__amount--calculated {
  font-weight: 600;
  color: #1e293b;
}

.liasse-fiscale__amount-input {
  width: 100%;
  max-width: none;
  margin: 0;
  font-variant-numeric: tabular-nums;
  border-color: #e2e8f0;
  background: #fff;
  padding: 0.2rem 0.45rem;
  font-size: 0.8125rem;
}

.liasse-fiscale__amount-input:focus {
  border-color: var(--primary-color, #6366f1);
  box-shadow: 0 0 0 0.15rem rgba(var(--primary-rgb), 0.15);
}

.liasse-fiscale__row--section td {
  font-weight: 700;
  background: #f1f5f9 !important;
  color: #334155;
  border-top: 1px solid #e2e8f0;
}

.liasse-fiscale__row--section .liasse-fiscale__sticky {
  background: #f1f5f9;
}

.liasse-fiscale__row--subsection td {
  font-weight: 600;
  background: #f8fafc !important;
  color: #475569;
}

.liasse-fiscale__row--subsection .liasse-fiscale__sticky {
  background: #f8fafc;
}

.liasse-fiscale__row--calculated td {
  background: rgba(239, 246, 255, 0.65) !important;
}

.liasse-fiscale__row--calculated .liasse-fiscale__sticky {
  background: rgba(239, 246, 255, 0.65);
}

.liasse-fiscale__row--calculated .liasse-fiscale__amount-cell {
  background: rgba(238, 242, 255, 0.45);
}

.liasse-fiscale__table tbody tr:not(.liasse-fiscale__row--section):not(.liasse-fiscale__row--subsection):hover td {
  background: rgba(var(--primary-rgb), 0.04);
}

.liasse-fiscale__table tbody tr:not(.liasse-fiscale__row--section):not(.liasse-fiscale__row--subsection):hover .liasse-fiscale__sticky {
  background: rgba(var(--primary-rgb), 0.04);
}

@media print {
  .liasse-fiscale__result {
    max-height: none;
  }

  .liasse-fiscale__scroll {
    overflow: visible;
  }

  .liasse-fiscale__sticky {
    position: static;
    box-shadow: none;
  }
}

/* —— Toasts au-dessus du header fixe (Blazored.Toast z-index: 1 par défaut) —— */
body:has(.accounting-shell) .blazored-toast-container {
  z-index: 2000 !important;
}

body:has(.accounting-shell) .blazored-toast-container.position-top-right,
body:has(.accounting-shell) .blazored-toast-container.position-top-left,
body:has(.accounting-shell) .blazored-toast-container.position-top-center {
  top: calc(var(--accounting-header-height, 5rem) + 0.75rem) !important;
}

/* —— Onglets de travail —— */
.accounting-workspace-tab-host {
  position: relative;
}

.accounting-tab-pane--hidden {
  display: none !important;
}

.accounting-workspace-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem 0;
  background: #eef1f6;
  border-bottom: 1px solid var(--accounting-header-border, #e8ecf1);
  min-height: 2.35rem;
}

.accounting-workspace-tabs__scroll {
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: thin;
}

.accounting-workspace-tabs__tab {
  display: inline-flex;
  align-items: center;
  max-width: 14rem;
  border: 1px solid #d5dbe5;
  border-bottom: none;
  border-radius: 0.4rem 0.4rem 0 0;
  background: #f8fafc;
  color: #475569;
  flex-shrink: 0;
}

.accounting-workspace-tabs__tab--active {
  background: #fff;
  color: #111827;
  border-color: #c5cedb;
  box-shadow: 0 -1px 0 #fff inset;
  position: relative;
  z-index: 1;
}

.accounting-workspace-tabs__tab--dirty .accounting-workspace-tabs__label {
  font-style: italic;
}

.accounting-workspace-tabs__dirty-mark {
  color: #f59e0b;
  font-size: 0.55rem;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.accounting-workspace-tabs__label {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.55rem 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}

.accounting-workspace-tabs__close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  padding: 0.2rem 0.45rem 0.2rem 0;
  line-height: 1;
  font-size: 1rem;
}

.accounting-workspace-tabs__close:hover {
  color: #ef4444;
}

.accounting-workspace-tabs__close-all {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  border: 1px solid #d5dbe5;
  border-radius: 0.35rem;
  background: #fff;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.55rem;
  line-height: 1.2;
  white-space: nowrap;
}

.accounting-workspace-tabs__close-all:hover {
  color: #ef4444;
  border-color: #fecaca;
  background: #fff5f5;
}

.accounting-workspace-tabs__close-all i {
  font-size: 1rem;
  line-height: 1;
}

.accounting-workspace-tabs__badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #fff;
  border: 1px solid #d5dbe5;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  flex-shrink: 0;
}
