:root {
  --navy: #0c325f;
  --navy-deep: #0c325f;
  --page: #eef3f9;
  --panel: #ffffff;
  --line: #bccade;
  --muted: #61738c;
  --text: #061b33;
  --stock: #8ec7f4;
  --service: #9deec7;
  --hs: #ff8f9f;
  --sav: #ffd39b;
  --perdu: #8f98a6;
  --dispo: #8fe8e2;
  --warn: #f7b955;
  --shadow: 0 10px 26px rgba(18, 42, 74, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--text);
  background: var(--page);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

@media (prefers-reduced-motion: no-preference) {
  body,
  .login-screen,
  .login-card,
  .app-shell,
  .sidebar,
  .brand,
  .workspace,
  .page-header,
  .stock-panel,
  .detail-panel,
  .user-history-panel,
  .tool-panel,
  .kpi-card,
  .mini-table-wrap,
  .mini-table th,
  .mini-table td,
  .stock-table th,
  .stock-table td,
  .stock-table tbody tr,
  .history-details,
  .history-details summary,
  .history-item,
  .latest-item,
  .attention-item,
  .info-field,
  .status-pill,
  .swatch,
  .attention-filters button,
  .module-nav button,
  .filter-tabs button,
  .ghost-button,
  .soft-button,
  .primary-button,
  .danger-button,
  input,
  select,
  textarea {
    transition:
      background-color 220ms ease,
      background 220ms ease,
      color 220ms ease,
      border-color 220ms ease,
      box-shadow 220ms ease;
  }
}

body[data-theme="dark"] {
  --navy: #0c325f;
  --navy-deep: #0c325f;
  --page: #0b1320;
  --panel: #121d2c;
  --line: #31435d;
  --muted: #9fb1c7;
  --text: #eaf2ff;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

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

.login-card {
  width: min(340px, 100%);
  border: 1px solid #c2cedd;
  border-radius: 12px;
  background: #fff;
  padding: 28px 32px;
  box-shadow: 0 16px 35px rgba(12, 39, 76, 0.08);
}

.login-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.login-heading h1,
.login-heading p {
  margin: 0;
}

.login-heading h1 {
  font-size: 20px;
}

.login-heading p {
  margin-top: 8px;
  color: #40536c;
  font-size: 12px;
}

.login-mark {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #0c325f;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}

.phone-mark {
  background: #0c325f;
  border: 1px solid rgba(189, 226, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.phone-mark svg {
  width: 31px;
  height: 31px;
  color: #75d7ff;
  fill: currentColor;
}

.phone-mark .phone-body {
  fill: currentColor;
}

.phone-mark .phone-wave {
  fill: none;
  stroke: currentColor;
  stroke-width: 5.4;
  stroke-linecap: round;
}
.phone-mark .phone-photo-icon {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.logo-mark {
  position: relative;
  overflow: hidden;
}

.logo-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.logo-mark img:not([hidden]) + span {
  opacity: 0;
}

.logo-mark span {
  position: relative;
  z-index: 1;
}

.login-card label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.login-card label span {
  color: #40536c;
  font-size: 12px;
}

.login-card input {
  min-height: 36px;
  border: 1px solid #b8c6d8;
  border-radius: 8px;
  padding: 7px 10px;
}

.login-card input:focus,
.search-box input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: 2px solid rgba(13, 63, 114, 0.18);
  border-color: var(--navy);
}

.login-error {
  min-height: 18px;
  margin: 0 0 10px;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
}

.login-button {
  width: 100%;
  margin-top: 4px;
}

.app-shell {
  --sidebar-width: 270px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-collapsed {
  --sidebar-width: 48px;
  grid-template-columns: 48px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  color: #fff;
  background: linear-gradient(180deg, #0c325f 0, #0c325f 70px, #dfe8f3 70px);
  padding: 15px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid #9fb1c7;
  overflow-y: auto;
  overflow-x: hidden;
}

.side-nav.removed-sidebar-nav,
#resetDemo {
  display: none;
}

.sidebar-toggle {
  position: fixed;
  top: 34px;
  left: calc(var(--sidebar-width) - 14px);
  transform: none;
  z-index: 5;
  width: 28px;
  height: 36px;
  border: 1px solid #9fb1c7;
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(18, 42, 74, 0.14);
}

.app-shell.sidebar-collapsed .sidebar {
  padding: 15px 6px;
  background: #0c325f;
}

.app-shell.sidebar-collapsed .brand,
.app-shell.sidebar-collapsed .module-nav,
.app-shell.sidebar-collapsed .side-nav,
.app-shell.sidebar-collapsed .mini-panel,
.app-shell.sidebar-collapsed .latest-panel,
.app-shell.sidebar-collapsed .sidebar-logo-card,
.app-shell.sidebar-collapsed .ghost-button.full {
  display: none;
}

.app-shell.standard-mode {
  --sidebar-width: 270px;
}

.app-shell:not(.standard-mode) .latest-panel {
  display: none;
}

.app-shell.standard-mode .sidebar-toggle,
.app-shell.standard-mode .module-nav,
.app-shell.standard-mode #clearCsv,
.app-shell.standard-mode #exportCsv,
.app-shell.standard-mode .file-button,
.app-shell.standard-mode .filter-tabs,
.app-shell.standard-mode .main-column,
.app-shell.standard-mode #alertsPanel,
.app-shell.standard-mode #csvPanel,
.app-shell.standard-mode #newRecord {
  display: none;
}

.app-shell.standard-mode .sidebar {
  gap: 14px;
  background: linear-gradient(180deg, #0c325f 0, #0c325f 70px, #dfe8f3 70px);
  border-color: #9fb1c7;
}

.app-shell.standard-mode .mini-panel {
  margin-top: 4px;
}

.app-shell.standard-mode .mini-panel h2,
.app-shell.standard-mode .latest-panel h2 {
  color: var(--navy);
}

.app-shell.standard-mode .mini-table-wrap,
.app-shell.standard-mode .latest-item,
.app-shell.standard-mode .latest-empty {
  background: #fff;
  border-color: #c4d0df;
  color: #061b33;
}

.app-shell.standard-mode .mini-table thead th {
  color: #41546e;
  background: #f8fbff;
  border-color: #d4deeb;
}

.app-shell.standard-mode .mini-table tbody td {
  color: #061b33;
}

.app-shell.standard-mode .latest-item span {
  color: #53657e;
}

.app-shell.standard-mode .latest-item:hover {
  background: #f2f5f8;
}

.app-shell.standard-mode .sidebar-logo-card {
  color: #061b33;
}

.app-shell.standard-mode .sidebar-logo-card span {
  color: #53657e;
}

.app-shell.standard-mode #logoutButton {
  margin-top: 6px;
  color: var(--text);
  background: #fff;
  border-color: #b9c6d8;
}

.app-shell.standard-mode .toolbar,
.app-shell.standard-mode .action-grid {
  width: 100%;
  max-width: none;
}

.app-shell.standard-mode .toolbar {
  grid-template-columns: minmax(280px, 560px);
}

.app-shell.standard-mode .content-grid {
  width: 100%;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  align-items: stretch;
}

.app-shell.standard-mode .action-grid {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.standard-mode .detail-panel {
  min-height: 320px;
  margin-top: 0;
}

.app-shell.standard-mode .user-history-panel {
  display: block;
  min-height: 320px;
  margin-top: 0;
}

.app-shell.standard-mode .user-history-panel .history-board {
  min-height: 380px;
  max-height: calc(100vh - 260px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: -15px -10px 0;
  padding: 17px 14px 15px;
  background: #0c325f;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 21px;
}

.brand .phone-mark {
  background: #0c325f;
  border-color: rgba(189, 226, 255, 0.18);
}

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

.brand h1,
.brand p,
.mini-panel h2,
.section-head h3,
.section-head p,
.page-header h2,
.page-header p {
  margin: 0;
}

.brand h1 {
  font-size: 17px;
  line-height: 1.1;
}

.brand p {
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 1.7px;
  color: #9fc8f2;
  font-size: 11px;
}

.module-nav,
.side-nav {
  display: grid;
  gap: 4px;
}

.module-nav button,
.side-nav button {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  text-align: left;
  padding: 7px 12px;
}

.module-nav button {
  color: #061b33;
  background: transparent;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 400;
}

.module-nav button.active,
.side-nav button.active,
.side-nav button:hover {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.module-nav button:hover:not(.active) {
  color: #061b33;
  background: rgba(255, 255, 255, 0.42);
  border-color: transparent;
  text-decoration: underline;
}

.side-nav button {
  color: #061b33;
  background: transparent;
}

.mini-panel,
.latest-panel {
  color: #061b33;
}

.latest-panel {
  margin-top: 4px;
}

.mini-panel h2,
.latest-panel h2 {
  color: var(--navy);
  font-size: 11px;
  text-align: center;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.mini-table-wrap {
  border: 1px solid #c4d0df;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.mini-table th,
.mini-table td {
  padding: 4px 7px;
  border-bottom: 1px solid #d4deeb;
  text-align: right;
}

.mini-table th:first-child,
.mini-table td:first-child {
  text-align: left;
}

.mini-table thead th {
  color: #41546e;
  background: #f8fbff;
  font-weight: 500;
}

.mini-table tr[data-state="En Stock"] td {
  background: var(--stock);
}

.mini-table tr[data-state="En Service"] td {
  background: var(--service);
}

.mini-table tr[data-state="En service"] td {
  background: var(--service);
}

.mini-table tr[data-state="HS"] td {
  background: var(--hs);
}

.mini-table tr[data-state="SAV"] td {
  background: var(--sav);
}

.mini-table tr[data-state="Perdu"] td {
  background: var(--perdu);
}

.mini-table tr[data-state="Disponible"] td {
  background: var(--dispo);
}

.mini-table tr[data-state="Changement"] td {
  background: var(--sav);
}

.mini-table tr[data-state="Dispo"] td {
  background: var(--dispo);
}

.mini-table tr[data-state="Libre"] td {
  background: var(--dispo);
}

.mini-table tr[data-state="Résilié"] td {
  background: var(--perdu);
}

.latest-list {
  display: grid;
  gap: 6px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.latest-item {
  width: 100%;
  border: 1px solid #c4d0df;
  border-radius: 7px;
  background: #fff;
  color: #061b33;
  padding: 6px 8px;
  text-align: left;
}

.latest-item:hover {
  background: #f2f5f8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.latest-item strong,
.latest-item span,
.latest-item em {
  display: block;
}

.latest-item strong {
  font-size: 12px;
}

.latest-item span {
  margin-top: 2px;
  color: #53657e;
  font-size: 11px;
}

.latest-item em {
  margin-top: 2px;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.latest-empty {
  border: 1px solid #c4d0df;
  border-radius: 7px;
  background: #fff;
  color: #53657e;
  padding: 8px;
  font-size: 12px;
  text-align: center;
}

.sidebar-logo-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  order: 20;
  margin-top: auto;
  padding: 14px 2px 0;
  color: #061b33;
  text-align: center;
  min-width: 0;
}

.sidebar-logo-card img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.sidebar-logo-card strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.sidebar-logo-card span {
  color: #53657e;
  font-size: 11px;
}

#logoutButton {
  order: 21;
  margin-top: 4px;
}

.alert-list,
.alert-board {
  display: grid;
  gap: 7px;
}

.alert-list {
  max-height: 224px;
  overflow-y: auto;
  padding-right: 2px;
}

.alert-board {
  max-height: 500px;
  overflow-y: auto;
  padding: 12px;
}

.alert-details summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #c1cede;
  background: #f7fafe;
  border-radius: 8px 8px 0 0;
  list-style: none;
  cursor: pointer;
}

.alert-details summary::-webkit-details-marker {
  display: none;
}

.alert-details summary b {
  display: block;
  font-size: 15px;
}

.alert-details summary em,
.summary-action {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.alert-item {
  color: #08213e;
  background: #fff;
  border: 1px solid #c6d2df;
  border-left: 5px solid var(--warn);
  border-radius: 7px;
  padding: 8px 9px;
  font-size: 12px;
  line-height: 1.3;
}

.alert-item strong {
  display: inline-block;
  min-width: 54px;
}

.attention-dashboard {
  display: grid;
  gap: 10px;
}

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

.attention-metrics span {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #c6d2df;
  border-radius: 7px;
  background: #f8fbff;
}

.attention-metrics strong,
.attention-metrics em {
  display: block;
}

.attention-metrics strong {
  font-size: 16px;
}

.attention-metrics em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.attention-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attention-filters button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid #b9c6d8;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.attention-filters button:hover {
  background: #eef5fd;
  text-decoration: underline;
}

.attention-filters button.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  text-decoration: none;
}

.attention-filters span {
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #d9e7f7;
  color: #08213e;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.attention-filters button.active span {
  background: #fff;
}

.attention-list {
  display: grid;
  gap: 7px;
}

.attention-item {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 8px 9px;
  border: 1px solid #c6d2df;
  border-left: 5px solid var(--warn);
  border-radius: 7px;
  background: #fff;
  color: #08213e;
  font: inherit;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.attention-item:hover {
  border-color: var(--accent);
  background: #eaf4ff;
}

.attention-priority-1 {
  border-left-color: var(--hs);
}

.attention-priority-2 {
  border-left-color: var(--sav);
}

.attention-priority-3 {
  border-left-color: var(--perdu);
}

.attention-priority-4 {
  border-left-color: var(--service);
}

.attention-top,
.attention-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.attention-top strong {
  font-size: 13px;
}

.attention-main {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-detail-item {
  gap: 7px;
}

.history-detail-changes {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.history-detail-change {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(70px, 0.75fr) minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: #08213e;
}

.history-detail-change b {
  min-width: 0;
  color: #29425f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-detail-change span,
.history-detail-note,
.history-detail-more {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-detail-change i {
  color: var(--muted);
  font-style: normal;
}

.history-detail-note,
.history-detail-more {
  color: #29425f;
}

.history-detail-more {
  font-size: 11px;
  font-weight: 700;
}

.attention-meta {
  color: #435a76;
  font-size: 11px;
}

.attention-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-age {
  color: #29425f;
  font-size: 11px;
  font-weight: 700;
}

.attention-empty {
  padding: 12px;
  border: 1px dashed #b9c6d8;
  border-radius: 7px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.ghost-button,
.soft-button,
.primary-button,
.danger-button {
  border: 1px solid #b9c6d8;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-height: 32px;
  padding: 7px 12px;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.ghost-button:hover,
.soft-button:hover,
.primary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
  border-color: var(--navy);
}

.ghost-button.full {
  width: 100%;
}

.soft-button.small {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.ghost-button:disabled,
.soft-button:disabled,
.primary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.danger-button {
  color: #9f1d1d;
  border-color: #f0b9b9;
  background: #fff7f7;
  font-weight: 700;
}

.clear-csv-button {
  color: #9f1d1d;
  border-color: #e8a7a7;
  background: #fff1f1;
}

.clear-csv-button:hover {
  color: #7a1717;
  border-color: #d58b8b;
  background: #ffe3e3;
}

.danger-button.small {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.primary-button {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
  font-weight: 400;
}

.workspace {
  min-width: 0;
  padding: 14px 18px 28px;
}

.page-header {
  min-height: 40px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid #b9c8da;
}

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 11px;
  font-weight: 700;
}

.page-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.file-button {
  position: relative;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
}

.theme-toggle {
  min-width: 112px;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.toolbar {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 12px;
  align-items: end;
}

.search-box,
.form-grid label {
  display: grid;
  gap: 5px;
}

.search-box span,
.form-grid span {
  color: #40536c;
  font-size: 12px;
  font-weight: 700;
}

.search-box input,
.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 36px;
  width: 100%;
  border: 1px solid #b8c6d8;
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text);
  background: #fff;
}

.form-grid textarea {
  resize: vertical;
  min-height: 82px;
}

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

.filter-tabs button {
  min-height: 31px;
  border: 1px solid #b8c7d9;
  border-radius: 7px;
  background: #fff;
  color: #00152f;
  padding: 5px 13px;
  font-size: 14px;
  line-height: 1;
}

.filter-tabs button:hover {
  background: #f2f5f8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.filter-tabs button.active:hover {
  background: var(--navy);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  gap: 6px;
}

.kpi-card {
  min-height: 50px;
  border: 1px solid #bcc9d9;
  border-radius: 8px;
  background: #fff;
  padding: 7px 9px;
  display: grid;
  align-content: center;
  gap: 2px;
  box-shadow: var(--shadow);
}

.kpi-card strong {
  font-size: 19px;
  line-height: 1;
}

.kpi-card span {
  color: #40536c;
  font-size: 11px;
  font-weight: 700;
}

.kpi-card em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.content-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 10px;
  align-items: start;
}

.main-column {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.stock-panel,
.detail-panel,
.user-history-panel,
.tool-panel {
  border: 1px solid #b8c6d8;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.user-history-panel {
  display: none;
}

.section-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #c1cede;
  background: #f7fafe;
  border-radius: 8px 8px 0 0;
}

.section-head.compact {
  min-height: auto;
}

.section-head h3 {
  font-size: 15px;
}

.section-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  font-size: 11px;
  color: #40536c;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 2px;
}

.table-wrap {
  overflow: auto;
  max-height: 53vh;
}

.stock-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.stock-table th,
.stock-table td {
  height: 31px;
  padding: 5px 8px;
  border-right: 1px solid #c8d3e0;
  border-bottom: 1px solid #c8d3e0;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #38506d;
  background: #f7fafe;
  font-weight: 700;
  text-align: left;
}

.sort-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0;
  font-weight: 700;
  text-align: left;
}

.sort-mark {
  color: #6b7d94;
  font-size: 10px;
}

.stock-table th:first-child,
.stock-table td:first-child {
  width: 112px;
  font-weight: 800;
}

.stock-table[data-module="DECT"] col {
  min-width: 0;
}

.stock-table[data-module="DECT"] th:first-child,
.stock-table[data-module="DECT"] td:first-child {
  width: auto;
}

.stock-table[data-module="DECT"] th:nth-child(1),
.stock-table[data-module="DECT"] td:nth-child(1),
.stock-table[data-module="DECT"] th:nth-child(3),
.stock-table[data-module="DECT"] td:nth-child(3),
.stock-table[data-module="DECT"] th:nth-child(9),
.stock-table[data-module="DECT"] td:nth-child(9) {
  padding-left: 6px;
  padding-right: 6px;
}

.stock-table[data-module="DECT"] td:nth-child(7) .status-pill,
.stock-table[data-module="DECT"] td:nth-child(10) .status-pill {
  width: 100%;
  min-width: 0;
  padding-left: 4px;
  padding-right: 4px;
}

.stock-table tbody tr {
  background: #f5f8fc;
}

.stock-table tbody tr:nth-child(even) {
  background: #ebf1f8;
}

.stock-table tbody tr.selected {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}

.stock-table tbody tr:hover {
  background: #ddeafb;
}

.status-pill {
  display: inline-grid;
  place-items: center;
  min-width: 88px;
  min-height: 20px;
  border-radius: 4px;
  padding: 2px 7px;
  color: #061b33;
  font-weight: 700;
  font-size: 11px;
}

body[data-theme="dark"] .login-screen,
body[data-theme="dark"] {
  background: var(--page);
}

body[data-theme="dark"] .login-card,
body[data-theme="dark"] .kpi-card,
body[data-theme="dark"] .stock-panel,
body[data-theme="dark"] .detail-panel,
body[data-theme="dark"] .user-history-panel,
body[data-theme="dark"] .tool-panel,
body[data-theme="dark"] .history-details,
body[data-theme="dark"] .history-item,
body[data-theme="dark"] .latest-item,
body[data-theme="dark"] .latest-empty,
body[data-theme="dark"] .alert-item,
body[data-theme="dark"] .mini-table-wrap {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, var(--navy-deep) 0, var(--navy) 70px, #111d2c 70px);
  border-color: var(--line);
}

body[data-theme="dark"] .app-shell.standard-mode .sidebar {
  background: linear-gradient(180deg, var(--navy-deep) 0, var(--navy) 70px, #111d2c 70px);
  border-color: var(--line);
}

body[data-theme="dark"] .app-shell.standard-mode .mini-panel h2,
body[data-theme="dark"] .app-shell.standard-mode .latest-panel h2 {
  color: #bde2ff;
}

body[data-theme="dark"] .app-shell.standard-mode .mini-table-wrap,
body[data-theme="dark"] .app-shell.standard-mode .latest-item,
body[data-theme="dark"] .app-shell.standard-mode .latest-empty {
  background: #132238;
  border-color: #315070;
  color: #eef6ff;
}

body[data-theme="dark"] .app-shell.standard-mode .mini-table thead th {
  color: #eef6ff;
  background: var(--navy);
  border-color: #315070;
}

body[data-theme="dark"] .app-shell.standard-mode .mini-table tbody td {
  color: #061b33;
}

body[data-theme="dark"] .app-shell.standard-mode .latest-item span {
  color: #9dc0e3;
}

body[data-theme="dark"] .app-shell.standard-mode .latest-item:hover {
  background: var(--navy);
  color: #fff;
}

body[data-theme="dark"] .app-shell.standard-mode .sidebar-logo-card {
  color: #eef6ff;
}

body[data-theme="dark"] .app-shell.standard-mode .sidebar-logo-card span {
  color: #9dc0e3;
}

body[data-theme="dark"] .app-shell.standard-mode #logoutButton {
  color: #eef6ff;
  background: #132238;
  border-color: #315070;
}

body[data-theme="dark"] .page-header,
body[data-theme="dark"] .section-head,
body[data-theme="dark"] .history-details summary,
body[data-theme="dark"] .alert-details summary,
body[data-theme="dark"] .stock-table th {
  border-color: var(--line);
}

body[data-theme="dark"] .section-head,
body[data-theme="dark"] .history-details summary,
body[data-theme="dark"] .alert-details summary,
body[data-theme="dark"] .stock-table th {
  background: var(--navy);
  color: #fff;
}

body[data-theme="dark"] .history-board,
body[data-theme="dark"] .alert-board {
  background: #0e1826;
  border-color: var(--line);
}

body[data-theme="dark"] .alert-details {
  background: var(--panel);
  color: var(--text);
}

body[data-theme="dark"] .alert-details summary b {
  color: var(--text);
}

body[data-theme="dark"] .alert-details summary em,
body[data-theme="dark"] .alert-details .summary-action {
  color: var(--muted);
}

body[data-theme="dark"] .attention-metrics span,
body[data-theme="dark"] .attention-item,
body[data-theme="dark"] .attention-empty {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="dark"] .attention-filters button {
  background: #132238;
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="dark"] .attention-filters button:hover,
body[data-theme="dark"] .attention-item:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

body[data-theme="dark"] .attention-filters button.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

body[data-theme="dark"] .attention-meta,
body[data-theme="dark"] .attention-age,
body[data-theme="dark"] .attention-metrics em {
  color: var(--muted);
}

body[data-theme="dark"] .history-detail-change,
body[data-theme="dark"] .history-detail-change b,
body[data-theme="dark"] .history-detail-note,
body[data-theme="dark"] .history-detail-more {
  color: var(--text);
}

body[data-theme="dark"] .history-detail-change i {
  color: var(--muted);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background: #0e1826;
  color: var(--text);
  border-color: var(--line);
}

body[data-theme="dark"] .search-box span,
body[data-theme="dark"] .form-grid span,
body[data-theme="dark"] .login-card label span,
body[data-theme="dark"] .login-heading p,
body[data-theme="dark"] .kpi-card span,
body[data-theme="dark"] .mini-panel h2,
body[data-theme="dark"] .latest-panel h2,
body[data-theme="dark"] .sidebar-logo-card span {
  color: var(--muted);
}

body[data-theme="dark"] .module-nav button,
body[data-theme="dark"] .soft-button,
body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .filter-tabs button {
  background: #132238;
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="dark"] .module-nav button.active,
body[data-theme="dark"] .module-nav button:hover,
body[data-theme="dark"] .filter-tabs button.active,
body[data-theme="dark"] .filter-tabs button.active:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

body[data-theme="dark"] .soft-button:hover,
body[data-theme="dark"] .ghost-button:hover,
body[data-theme="dark"] .filter-tabs button:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

body[data-theme="dark"] .danger-button {
  background: #32171a;
  border-color: #7c2e34;
  color: #ffb4b8;
}

body[data-theme="dark"] .clear-csv-button {
  color: #ffc7cc;
  background: #32171a;
  border-color: #7c2e34;
}

body[data-theme="dark"] .clear-csv-button:hover {
  color: #ffdadd;
  background: #421d21;
  border-color: #a64048;
}

body[data-theme="dark"] .stock-table th,
body[data-theme="dark"] .stock-table td {
  border-color: var(--line);
}

body[data-theme="dark"] .stock-table tbody tr {
  background: #111d2b;
}

body[data-theme="dark"] .stock-table tbody tr:nth-child(even) {
  background: #162437;
}

body[data-theme="dark"] .stock-table tbody tr:hover,
body[data-theme="dark"] .history-item:hover,
body[data-theme="dark"] .history-item.selected {
  background: var(--navy);
  color: #fff;
}

body[data-theme="dark"] .history-item.static:hover {
  background: var(--panel);
  border-color: var(--line);
}

body[data-theme="dark"] .history-item.arrival-event {
  background: #0f1a29;
  border-color: var(--line);
}

body[data-theme="dark"] .history-old {
  background: #0d1725;
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="dark"] .history-new {
  background: #173324;
  border-color: #2e7550;
  color: var(--text);
}

body[data-theme="dark"] .history-field,
body[data-theme="dark"] .history-note-row,
body[data-theme="dark"] .history-empty-note,
body[data-theme="dark"] .history-arrow {
  color: var(--muted);
}

body[data-theme="dark"] .mini-table thead th {
  background: var(--navy);
  color: #fff;
  border-color: #2d5278;
}

body[data-theme="dark"] .mini-table tbody td {
  color: #fff;
  border-color: rgba(6, 27, 51, 0.18);
}

body[data-theme="dark"] .mini-table tr[data-state="En Stock"] td {
  background: #1f527b;
  color: #f3f8ff;
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .mini-table tr[data-state="En Service"] td,
body[data-theme="dark"] .mini-table tr[data-state="En service"] td {
  background: #176044;
  color: #f4fff9;
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .mini-table tr[data-state="HS"] td {
  background: #7f2430;
  color: #fff6f8;
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .mini-table tr[data-state="SAV"] td,
body[data-theme="dark"] .mini-table tr[data-state="Changement"] td {
  background: #765021;
  color: #fff7e8;
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .mini-table tr[data-state="Perdu"] td,
body[data-theme="dark"] .mini-table tr[data-state="Résilié"] td {
  background: #4e5767;
  color: #f4f7fb;
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .mini-table tr[data-state="Disponible"] td,
body[data-theme="dark"] .mini-table tr[data-state="Dispo"] td,
body[data-theme="dark"] .mini-table tr[data-state="Libre"] td {
  background: #1b6866;
  color: #ecfffd;
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .app-shell.standard-mode .mini-table tbody td,
body[data-theme="dark"] .mini-table tbody td {
  color: #fff;
}

body[data-theme="dark"] .info-field {
  background: #0f1a29;
  border-color: var(--line);
}

body[data-theme="dark"] .sidebar-logo-card,
body[data-theme="dark"] .mini-panel,
body[data-theme="dark"] .latest-panel {
  color: var(--text);
}

body[data-theme="dark"] .detail-empty {
  color: var(--muted);
}

.status-stock,
.swatch-stock {
  background: var(--stock);
}

.status-service,
.swatch-service {
  background: var(--service);
}

.status-hs,
.swatch-hs {
  background: var(--hs);
}

.status-sav,
.swatch-sav {
  background: var(--sav);
}

.status-perdu,
.swatch-perdu {
  background: var(--perdu);
}

.status-dispo,
.swatch-dispo {
  background: var(--dispo);
}

.status-warranty-ok {
  background: var(--service);
  color: #061b33;
}

.status-warranty-expired {
  background: var(--hs);
  color: #000;
}

.status-warranty-missing {
  background: #a8b2c3;
  color: #061b33;
}

body[data-theme="dark"] .status-pill {
  color: #fff;
}

body[data-theme="dark"] .status-stock,
body[data-theme="dark"] .swatch-stock {
  background: #1f527b;
  color: #fff;
}

body[data-theme="dark"] .status-service,
body[data-theme="dark"] .swatch-service,
body[data-theme="dark"] .status-warranty-ok {
  background: #176044;
  color: #fff;
}

body[data-theme="dark"] .status-hs,
body[data-theme="dark"] .swatch-hs,
body[data-theme="dark"] .status-warranty-expired {
  background: #7f2430;
  color: #fff;
}

body[data-theme="dark"] .status-sav,
body[data-theme="dark"] .swatch-sav {
  background: #765021;
  color: #fff;
}

body[data-theme="dark"] .status-perdu,
body[data-theme="dark"] .swatch-perdu,
body[data-theme="dark"] .status-warranty-missing {
  background: #4e5767;
  color: #fff;
}

body[data-theme="dark"] .status-dispo,
body[data-theme="dark"] .swatch-dispo {
  background: #1b6866;
  color: #fff;
}

.detail-panel {
  min-height: 360px;
  overflow: hidden;
}

.detail-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.detail-title {
  padding: 12px;
  background: var(--navy);
  color: #fff;
}

.detail-title p,
.detail-title h3 {
  margin: 0;
}

.detail-title p {
  margin-bottom: 3px;
  color: #bde2ff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail-title h3 {
  font-size: 22px;
}

.detail-body {
  padding: 12px;
  display: grid;
  gap: 12px;
}

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

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.info-field {
  min-height: 58px;
  border: 1px solid #c3d0df;
  border-radius: 7px;
  padding: 8px;
  background: #f8fbff;
}

.info-field.wide,
.form-grid .wide {
  grid-column: 1 / -1;
}

.info-field span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.info-field strong {
  display: block;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.warranty-info-field {
  display: grid;
  align-content: start;
}

.warranty-info-field strong {
  display: flex;
  align-items: center;
  min-height: 24px;
}

.warranty-pill {
  min-width: 0;
  width: auto;
  min-height: 22px;
  border-radius: 999px;
  padding: 4px 11px;
  letter-spacing: 0.2px;
}

.history-details {
  border: 1px solid #c1cede;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.history-details summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f7fafe;
  list-style: none;
  cursor: pointer;
}

.history-details summary::-webkit-details-marker {
  display: none;
}

.history-summary-title {
  display: grid;
  gap: 2px;
}

.history-details summary b {
  display: block;
  font-size: 15px;
}

.history-details summary em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.history-summary-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.history-delete-button {
  white-space: nowrap;
}

.history-board {
  max-height: 228px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid #c1cede;
  background: #fbfdff;
}

.history-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid #ccd7e6;
  border-radius: 7px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  line-height: 1.2;
}

.history-item.selected,
.history-item:hover {
  border-color: var(--accent);
  background: #eaf4ff;
}

.history-item.static {
  cursor: default;
}

.history-item.static:hover {
  border-color: #ccd7e6;
  background: #fff;
}

.history-item.arrival-event {
  border-style: dashed;
  background: #f7fafe;
}

.history-item time {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.history-item > span {
  display: block;
  overflow-wrap: anywhere;
}

.history-item b {
  display: block;
  margin-bottom: 2px;
}

.history-content {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.history-change-list {
  list-style: none;
  display: grid;
  gap: 4px;
  margin: 4px 0 0;
  padding: 0;
}

.history-change-list li {
  display: grid;
  grid-template-columns: minmax(70px, 0.55fr) minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.history-field {
  color: var(--muted);
  font-weight: 700;
}

.history-old,
.history-new {
  min-width: 0;
  padding: 2px 6px;
  border: 1px solid #d1ddeb;
  border-radius: 5px;
  background: #f5f8fc;
  overflow-wrap: anywhere;
}

.history-new {
  border-color: #bfe8d2;
  background: #ecfdf3;
}

.history-arrow {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.history-note-row {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.history-empty-note {
  color: var(--muted);
  font-style: normal;
}

.action-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 10px;
}

.tool-panel {
  padding-bottom: 12px;
}

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

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 12px;
}

.import-panel {
  grid-column: 1 / -1;
}

.import-columns {
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.import-columns span {
  border: 1px solid #b8c6d8;
  border-radius: 999px;
  background: #f8fbff;
  padding: 5px 10px;
  color: #364b66;
  font-size: 12px;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(380px, calc(100vw - 36px));
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: #0c325f;
  color: #fff;
  padding: 11px 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

  .app-shell.standard-mode {
    --sidebar-width: 270px;
  }

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

  .detail-panel {
    min-height: auto;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-height: 760px) and (min-width: 821px) {
  .sidebar {
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .brand {
    padding-bottom: 6px;
  }

  .module-nav,
  .side-nav {
    gap: 4px;
  }

  .module-nav button,
  .side-nav button {
    min-height: 30px;
    padding: 7px 10px;
  }

  .mini-panel h2,
  .latest-panel h2 {
    margin-bottom: 4px;
  }

  .latest-list {
    max-height: none;
  }

  .latest-item {
    padding: 5px 7px;
  }

  .sidebar-logo-card {
    padding-top: 4px;
  }

  .sidebar-logo-card img {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 13px;
  }

  .app-shell,
  .app-shell.standard-mode,
  .app-shell.sidebar-collapsed {
    --sidebar-width: 100%;
    grid-template-columns: 1fr;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    padding: 10px;
    gap: 10px;
    background: #0c325f;
    border-right: 0;
    border-bottom: 1px solid #9fb1c7;
    overflow: visible;
  }

  .brand {
    gap: 10px;
    margin: -10px -10px 0;
    padding: 12px 12px 11px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p {
    margin-top: 4px;
    font-size: 10px;
    letter-spacing: 1.5px;
  }

  .sidebar-logo-card {
    position: static;
    width: auto;
    background: transparent;
    color: #fff;
  }

  .module-nav,
  .side-nav {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
  }

  .module-nav button,
  .side-nav button {
    flex: 0 0 auto;
    min-height: 36px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    white-space: nowrap;
  }

  .module-nav button.active,
  .side-nav button.active {
    color: var(--navy);
    background: #fff;
    border-color: #fff;
  }

  .mini-panel,
  .latest-panel,
  .sidebar-logo-card,
  .ghost-button.full {
    display: none;
  }

  .workspace {
    padding: 10px;
  }

  .page-header,
  .toolbar {
    grid-template-columns: 1fr;
    display: grid;
    gap: 10px;
  }

  .page-header {
    min-height: auto;
    padding-bottom: 10px;
  }

  .page-header h2 {
    font-size: 20px;
  }

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

  .header-actions,
  .legend {
    justify-content: flex-start;
  }

  .header-actions .soft-button,
  .header-actions .danger-button,
  .header-actions .file-button {
    width: 100%;
    justify-content: center;
    min-height: 38px;
  }

  .search-box input {
    min-height: 42px;
  }

  .filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
  }

  .filter-tabs button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 12px;
  }

  .content-grid,
  .app-shell.standard-mode .content-grid,
  .action-grid,
  .app-shell.standard-mode .action-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
  }

  .main-column,
  .stock-panel,
  .detail-panel,
  .user-history-panel,
  .tool-panel {
    min-width: 0;
    max-width: 100%;
  }

  .kpi-grid,
  .form-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

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

  .kpi-card:first-child {
    grid-column: 1 / -1;
  }

  .section-head {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .legend {
    gap: 6px;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    max-height: 58vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .stock-table {
    width: 100%;
    min-width: 860px;
    display: table;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 11px;
  }

  .stock-table[data-module="DECT"] {
    min-width: 980px;
  }

  .stock-table[data-module="GSM"],
  .stock-table[data-module="COMMANDES"] {
    min-width: 760px;
  }

  .stock-table colgroup,
  .stock-table thead {
    display: table-column-group;
  }

  .stock-table thead {
    display: table-header-group;
  }

  .stock-table tbody {
    display: table-row-group;
    padding: 0;
  }

  .stock-table tbody tr,
  .stock-table tbody tr:nth-child(even) {
    display: table-row;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .stock-table tbody tr.selected {
    outline-offset: 0;
  }

  .stock-table th:first-child,
  .stock-table td:first-child,
  .stock-table[data-module="DECT"] th:first-child,
  .stock-table[data-module="DECT"] td:first-child {
    width: auto;
  }

  .stock-table td,
  .stock-table[data-module="DECT"] td:nth-child(1),
  .stock-table[data-module="DECT"] td:nth-child(3),
  .stock-table[data-module="DECT"] td:nth-child(9) {
    min-height: 0;
    height: 31px;
    display: table-cell;
    padding: 5px 6px;
    border-right: 1px solid #c8d3e0;
    border-bottom: 1px solid #c8d3e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stock-table td:last-child {
    border-bottom: 1px solid #c8d3e0;
  }

  .stock-table td::before {
    content: none;
  }

  .stock-table[data-module="DECT"] td:nth-child(7) .status-pill,
  .stock-table[data-module="DECT"] td:nth-child(10) .status-pill,
  .stock-table .status-pill {
    width: 100%;
    min-width: 0;
    justify-self: auto;
    min-height: 20px;
  }

  .detail-panel,
  .app-shell.standard-mode .detail-panel,
  .app-shell.standard-mode .user-history-panel {
    min-height: auto;
  }

  .detail-title {
    padding: 10px 12px;
  }

  .detail-title h3 {
    font-size: 20px;
  }

  .detail-body,
  .form-grid {
    padding: 10px;
  }

  .detail-actions button,
  .detail-actions .status-pill {
    min-height: 34px;
  }

  .history-details summary {
    min-height: auto;
    align-items: flex-start;
  }

  .history-summary-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .history-board,
  .app-shell.standard-mode .user-history-panel .history-board {
    max-height: none;
    min-height: 0;
  }

  .history-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .history-change-list li {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .history-arrow {
    display: none;
  }

  .form-actions {
    padding: 0 10px 10px;
  }

  .form-actions .primary-button {
    width: 100%;
    min-height: 42px;
  }

  .import-columns {
    padding: 10px;
  }

  body[data-theme="dark"] .stock-table tbody tr,
  body[data-theme="dark"] .stock-table tbody tr:nth-child(even) {
    border-color: var(--line);
  }

  body[data-theme="dark"] .stock-table td {
    border-color: var(--line);
  }
}

@media (max-width: 520px) {
  .login-card {
    padding: 24px;
  }

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

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

  .stock-table {
    font-size: 10.5px;
  }

  .stock-table th,
  .stock-table td,
  .stock-table[data-module="DECT"] td:nth-child(1),
  .stock-table[data-module="DECT"] td:nth-child(3),
  .stock-table[data-module="DECT"] td:nth-child(9) {
    padding: 5px;
  }

  .history-details summary {
    display: grid;
  }
}

.login-mark .phone-photo-icon {
  width: 30px;
  height: 30px;
}

.brand .phone-mark .phone-photo-icon {
  width: 24px;
  height: 24px;
}
