:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --panel: #ffffff;
  --ink: #16202e;
  --muted: #667085;
  --line: #d8dfe8;
  --line-soft: #eef2f6;
  --header: #f6f8fb;
  --accent: #0b766c;
  --accent-2: #2454b8;
  --accent-soft: #e8f4f2;
  --danger: #b42318;
  --positive: #087443;
  --warning: #b54708;
  --shadow: 0 14px 34px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 8px 20px rgba(16, 24, 40, 0.05);
  font-family: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #eef2f5 0, #f7f8fa 260px, var(--bg) 100%);
  color: var(--ink);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #0f2f35, #17454a);
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.login-card h1 {
  color: var(--ink);
}

.login-card p,
.login-card small {
  color: var(--muted);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 16px 30px;
  background: #102f35;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
  margin: 0 0 4px;
  font-size: 25px;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.import-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-box span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.user-box .secondary-button {
  padding: 8px 10px;
}

.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 30px;
  border-bottom: 1px solid #cfd8e3;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.05);
}

.admin-bar strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.admin-bar span {
  color: var(--muted);
  font-size: 12px;
}

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

.admin-actions button {
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
  box-shadow: none;
}

.admin-actions button:hover {
  background: var(--accent-soft);
  color: #0b5f59;
  filter: none;
}

input,
button {
  font: inherit;
}

input[type="file"],
input[type="search"],
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.08);
}

button:hover {
  filter: brightness(0.95);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(36, 84, 184, 0.18);
  outline-offset: 2px;
  border-color: var(--accent-2);
}

main {
  padding: 20px 30px 30px;
}

.kpis {
  display: none;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpis article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.kpis span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.kpis strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

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

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: #f7f9fb;
  overflow-x: auto;
  padding: 0 8px;
}

.tab {
  border-radius: 0;
  background: transparent;
  color: #344054;
  border-right: 0;
  padding: 15px 18px;
  min-width: 108px;
  position: relative;
  box-shadow: none;
}

.tab.active {
  background: transparent;
  color: var(--accent-2);
  box-shadow: none;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--accent-2);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

body[data-view="accueil"] .toolbar,
body[data-view="saisie"] .toolbar,
body[data-view="gestion"] .toolbar,
body[data-view="rapports"] .toolbar,
body[data-view="recettesGestion"] .toolbar,
body[data-view="chargesGestion"] .toolbar,
body[data-view="receptionGestion"] .toolbar,
body[data-view="alertes"] .toolbar,
body[data-view="donnees"] .toolbar {
  display: none;
}

#search {
  width: min(520px, 100%);
}

#sourceSheet {
  min-width: min(480px, 100%);
}

#rowCount {
  color: var(--muted);
  white-space: nowrap;
}

.sheet-wrap {
  min-height: 160px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  background: #fbfcfe;
}

body[data-view="saisie"] .sheet-wrap,
body[data-view="rapports"] .sheet-wrap,
body[data-view="donnees"] .sheet-wrap,
body[data-view="parametres"] .sheet-wrap {
  max-height: none;
  overflow: visible;
}

.management {
  display: none;
  padding: 18px;
}

.management.active {
  display: block;
}

.home-layout {
  display: grid;
  gap: 18px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(260px, 0.8fr);
  gap: 14px;
}

.home-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.home-section header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.home-section h2,
.home-section h3 {
  margin: 0;
  font-size: 17px;
  color: #111827;
}

.home-section p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.steps {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
}

.step-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.step strong {
  display: block;
  margin-bottom: 2px;
}

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

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px;
}

.module-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fbfcfe;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.module-card:hover {
  border-color: #c5d3e3;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.module-card h3 {
  margin-bottom: 6px;
}

.module-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.module-card button + button {
  margin-left: 6px;
}

.module-grid.compact {
  grid-template-columns: 1fr;
}

.admin-status .status-pill strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 18px;
}

.secondary-button {
  background: #f3f6fa;
  color: var(--ink);
  border: 1px solid var(--line);
}

.report-page {
  display: grid;
  gap: 14px;
}

.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.report-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.report-head p {
  color: var(--muted);
  font-size: 13px;
}

.period-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-filters {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.period-switcher button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.period-switcher button.active {
  border-color: #8bbeb8;
  background: var(--accent-soft);
  color: #0b5f59;
}

.period-switcher button:hover {
  background: #f8fafc;
  filter: none;
}

.period-switcher button.active:hover {
  background: var(--accent-soft);
  color: #0b5f59;
}

.date-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: end;
}

.date-filters label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.date-filters input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
  color: var(--ink);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card h3 {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  font-size: 15px;
  color: #111827;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding: 16px;
}

.metric-tile {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
  padding: 13px;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.metric-tile span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.metric-tile strong {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.bar-chart {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 110px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: linear-gradient(90deg, #2454b8, #5b8def);
}

.bar-fill.alt {
  background: linear-gradient(90deg, #0f766e, #14b8a6);
}

.bar-fill.negative {
  background: linear-gradient(90deg, #b42318, #ef4444);
}

.bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #344054;
}

.export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: #0b5f59;
  font-weight: 700;
  text-decoration: none;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  font-size: 13px;
  background: #fbfcfe;
}

.grid-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
}

.management-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.management-card.wide {
  grid-column: 1 / -1;
}

.management-card h2 {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  font-size: 15px;
}

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

.mini-table th,
.mini-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.mini-table th {
  color: #475467;
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.mini-table tr:hover td {
  background: #fbfcfe;
}

.mini-table td:last-child,
.mini-table th:last-child {
  text-align: right;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  padding: 16px 18px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
}

.status-pill span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.status-pill strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.entry-page {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 8px 0;
}

.entry-menu {
  position: sticky;
  top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.entry-menu header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.entry-menu h2 {
  margin: 0 0 5px;
  font-size: 17px;
}

.entry-menu p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.entry-switcher {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.entry-switcher button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.entry-switcher button span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.entry-switcher button.active {
  background: var(--accent-soft);
  color: #0b5f59;
  border-color: #89d1c9;
}

body[data-role="agent"] .admin-only {
  display: none;
}

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

.settings-page {
  display: grid;
  gap: 14px;
}

.settings-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.settings-card.wide {
  grid-column: 1 / -1;
}

.settings-intro {
  padding-bottom: 10px;
}

.settings-intro p {
  padding: 0 16px 6px;
  color: var(--muted);
  font-size: 13px;
}

.settings-card h2 {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  font-size: 15px;
}

.settings-card form {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.settings-inline-form {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end;
}

.settings-inline-form .full {
  grid-column: 1 / -1;
}

.settings-form-section {
  display: grid;
  gap: 3px;
  margin-top: 4px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f7fafb;
}

.settings-form-section strong {
  font-size: 13px;
}

.settings-form-section span {
  color: var(--muted);
  font-size: 12px;
}

.user-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.settings-list {
  border-top: 1px solid var(--line);
}

.settings-list h3 {
  margin: 0;
  padding: 12px 14px;
  color: #344054;
  font-size: 13px;
  background: #fbfcfe;
}

.settings-toggle {
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.row-actions {
  min-width: 180px;
  white-space: nowrap;
}

.row-actions button,
.password-reset {
  margin: 2px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.danger-button {
  border-color: #f3b4ae !important;
  color: var(--danger) !important;
}

.edit-dialog {
  width: min(860px, calc(100vw - 28px));
  height: min(760px, calc(100dvh - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: 0 30px 80px rgba(16, 24, 40, 0.3);
  overflow: hidden;
}

.edit-dialog::backdrop {
  background: rgba(15, 23, 42, 0.62);
}

.edit-dialog-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  max-height: calc(100dvh - 28px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.edit-dialog-card > header,
.edit-dialog-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: #f8fafc;
}

.edit-dialog-card > header {
  border-bottom: 1px solid var(--line);
}

.edit-dialog-card > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.edit-dialog-card header span {
  color: var(--muted);
  font-size: 11px;
}

.edit-dialog-card header h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.dialog-close {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
}

.edit-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  padding: 18px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.edit-form-grid .full {
  grid-column: 1 / -1;
}

.entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.entry-form {
  display: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.entry-form.active {
  display: block;
}

.entry-form h2 {
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  font-size: 17px;
}

.form-note {
  margin: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #fbfcfe;
  font-size: 13px;
  line-height: 1.45;
}

.form-section-title {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

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

.field.full,
.computed-box,
.entry-form button[type="submit"] {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 5px;
}

.field label {
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  background: #fff;
}

.field textarea {
  resize: vertical;
  min-height: 38px;
}

.computed-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 13px;
  border: 1px solid #cbd8f4;
  border-radius: 10px;
  background: #f6f8ff;
}

.computed-box div {
  min-width: 0;
}

.computed-box span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.computed-box strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.sheet {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: #fff;
}

.sheet th,
.sheet td {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 10px;
  min-width: 120px;
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f5f9;
  color: #344054;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.sheet tbody tr:nth-child(even) td {
  background: #fcfdff;
}

.sheet tbody tr:hover td {
  background: #f5f8ff;
}

.sheet td:first-child,
.sheet th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f8fafc;
  min-width: 58px;
  width: 58px;
  text-align: right;
  color: var(--muted);
}

.sheet th:first-child {
  z-index: 4;
  background: #e8eef6;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

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

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.22);
}

@media (min-width: 1100px) {
  .home-layout,
  .report-page,
  .entry-page,
  .settings-grid,
  .grid-dashboard {
    max-width: 1440px;
    margin: 0 auto;
  }
}

@media (max-width: 820px) {
  .edit-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .edit-dialog-card {
    max-height: calc(100dvh - 16px);
  }

  .topbar,
  .import-box,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    padding: 16px;
  }

  .tabs {
    padding: 0;
  }

  .tab {
    min-width: 104px;
    padding: 13px 14px;
  }

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

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

  .home-hero,
  .module-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-head {
    align-items: stretch;
    flex-direction: column;
  }

  .report-filters,
  .date-filters {
    justify-items: stretch;
    justify-content: stretch;
  }

  .date-filters label,
  .date-filters button {
    width: 100%;
  }

  .bar-row {
    grid-template-columns: 88px 1fr;
  }

  .bar-value {
    grid-column: 2;
    text-align: left;
  }

  .entry-page,
  .entry-layout,
  .form-body,
  .edit-form-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .user-form-actions,
  .edit-dialog-card > footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .entry-menu {
    position: static;
  }

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

  .status-row {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  main {
    padding: 16px;
  }
}
