@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #fafafa;
  --fg: #0a0a0a;
  --muted: #737373;
  --border: #e5e5e5;
  --border-hover: #d4d4d4;
  --card: #ffffff;
  --accent: #0a0a0a;
  --accent-fg: #fafafa;
  --ring: rgba(10, 10, 10, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 240px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
}

.icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  stroke: currentColor;
}

.icon-sm {
  width: 0.875rem;
  height: 0.875rem;
}

.icon-lg {
  width: 1.25rem;
  height: 1.25rem;
}

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

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 280ms var(--ease);
}

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

@media (min-width: 1024px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    transform: none;
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand-main {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.sidebar-close {
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .sidebar-close {
    display: none;
  }
}

.sidebar-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background: var(--fg);
  color: var(--accent-fg);
}

.sidebar-brand-title {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sidebar-brand-sub {
  font-size: 0.6875rem;
  color: var(--muted);
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 0.5rem;
  padding: 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  margin-bottom: 2px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease);
}

.nav-item:hover {
  background: #f5f5f5;
  color: var(--fg);
}

.nav-item.is-active {
  background: var(--fg);
  color: var(--accent-fg);
}

.nav-item:active {
  transform: scale(0.98);
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  background: rgba(250, 250, 250, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-start {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  flex: 1;
}

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

.topbar-module {
  display: none;
  margin: 0 0 0.125rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 1023px) {
  .topbar-module {
    display: block;
  }
}

@media (min-width: 1024px) {
  .menu-btn {
    display: none;
  }
}

.topbar-user {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-role {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-root {
  flex: 1;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  max-width: 1400px;
  width: 100%;
}

@media (min-width: 768px) {
  .module-root {
    padding: 1.25rem;
  }
}

.surface,
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panel-head {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 600;
}

.panel-body {
  padding: 0.25rem 1rem 1rem;
}

[data-list-body] {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

[data-list-panel].is-loading [data-list-body] {
  opacity: 0.45;
  pointer-events: none;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  min-height: 5.5rem;
}

.loading-state--overlay {
  padding: 0;
  min-height: 0;
}

.loading-spinner {
  position: relative;
  width: 2rem;
  height: 2rem;
}

.loading-spinner--sm {
  width: 1.25rem;
  height: 1.25rem;
}

.loading-spinner--lg {
  width: 2.75rem;
  height: 2.75rem;
}

.loading-spinner-orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  animation: loading-pulse 1.4s ease-in-out infinite;
}

.loading-spinner-ring {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--fg);
  border-right-color: var(--fg);
  animation: loading-spin 0.7s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

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

@keyframes loading-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-subtitle {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .filter-bar.cols-1 {
    grid-template-columns: 1fr;
  }
  .filter-bar.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter-bar.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .filter-bar.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.date-range-filter {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.date-range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .date-range-filter {
    flex-direction: row;
    align-items: flex-end;
    gap: 0.75rem;
  }

  .date-range-inputs {
    flex: 1;
    max-width: 28rem;
  }

  .date-range-presets {
    flex: 1;
  }
}

.date-range-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.date-preset-btn {
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}

.date-preset-btn:hover {
  background: #fafafa;
  border-color: var(--border-hover);
}

.date-preset-btn.is-active {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--accent-fg);
}

.field {
  width: 100%;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-size: 0.8125rem;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

textarea.field {
  height: auto;
  min-height: 5rem;
  padding: 0.625rem 0.75rem;
  resize: vertical;
}

.field:hover {
  border-color: var(--border-hover);
}

.field:focus {
  outline: none;
  border-color: var(--fg);
  box-shadow: 0 0 0 3px var(--ring);
}

.field[type="date"],
.field[type="datetime-local"] {
  color-scheme: light;
  padding-right: 0.5rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.field-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 0.8125rem;
}

.field-wrap {
  position: relative;
}

.field-wrap .field-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.field-wrap .field {
  padding-left: 2.25rem;
}

.money-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.money-input .money-currency {
  width: 5.5rem;
  min-width: 5.5rem;
}

.search-select-wrap {
  position: relative;
}

.search-select-list {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.search-select-option {
  padding: 0.5rem 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
}

.search-select-option:hover {
  background: #fafafa;
}

.search-select-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
}

.search-select-hint {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.search-select-empty {
  padding: 0.625rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.tx-price-display {
  margin: 0;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafafa;
}

.money-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.money-prefix,
.money-suffix {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 2.25rem;
  padding: 0 0.875rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 120ms var(--ease), box-shadow 150ms var(--ease);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

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

.btn-primary {
  background: var(--fg);
  color: var(--accent-fg);
  border-color: var(--fg);
}

.btn-primary:hover:not(:disabled) {
  background: #262626;
}

.btn-secondary {
  background: var(--card);
  color: var(--fg);
  border-color: var(--border);
}

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

.btn-success {
  background: var(--card);
  color: #166534;
  border-color: #bbf7d0;
}

.btn-success:hover:not(:disabled) {
  background: #f0fdf4;
}

.btn-danger {
  background: var(--card);
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-danger:hover:not(:disabled) {
  background: #fef2f2;
}

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

.btn-ghost:hover:not(:disabled) {
  background: #f5f5f5;
  color: var(--fg);
}

.btn-sm {
  height: 1.875rem;
  padding: 0 0.625rem;
  font-size: 0.75rem;
}

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

.data-table thead th {
  padding: 0.625rem 0.5rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
}

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

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

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

.table-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.375rem;
}

.btn-icon-action {
  gap: 0.375rem;
}

.btn-icon-action .btn-label {
  line-height: 1;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .stat-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.stat-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.stat-card-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.stat-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius);
  background: #f5f5f5;
  color: var(--muted);
}

.stat-card-value {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  border: 1px solid var(--border);
}

.badge-success {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.badge-entree {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}

.badge-sortie {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.badge-warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.badge-muted {
  background: #fafafa;
  color: var(--muted);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.pagination-meta {
  font-size: 0.8125rem;
  color: var(--muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-btn,
.pagination-page {
  min-width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  transition: background 140ms var(--ease), border-color 140ms var(--ease);
}

.pagination-btn:hover:not(:disabled),
.pagination-page:hover:not(:disabled):not(.is-active) {
  background: #fafafa;
  border-color: var(--border-hover);
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination-page.is-active {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--accent-fg);
  cursor: default;
}

.pagination-ellipsis {
  min-width: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
}

.empty-state-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.empty-state-subtitle {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

.modal-title {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-label {
  font-size: 0.875rem;
  font-weight: 600;
}

.settings-hint {
  margin-top: 0.125rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.login-logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: var(--fg);
  color: var(--accent-fg);
}

.skeleton-line {
  position: relative;
  overflow: hidden;
  background: #f5f5f5;
  border-radius: var(--radius);
}

.skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  animation: shimmer 1.2s infinite;
}

.toast-pop {
  animation: toastIn 240ms var(--ease);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--ease);
}

.sidebar-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  .sidebar-overlay {
    display: none;
  }
}

.chart-panel {
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.chart-panel-title {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.module-enter {
  animation: moduleIn 320ms var(--ease);
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes moduleIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Mobile & touch ── */

body.sidebar-open,
body.modal-open {
  overflow: hidden;
}

.toast-stack {
  position: fixed;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  right: 1rem;
  top: 1rem;
  top: max(1rem, env(safe-area-inset-top));
  left: auto;
  max-width: min(22rem, calc(100vw - 2rem));
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-overflow-scrolling: touch;
}

.modal-root.hidden {
  display: none;
}

.modal-dialog {
  width: 100%;
  max-width: 32rem;
  margin: auto;
  padding: 1.25rem;
}

.chart-panel canvas {
  width: 100% !important;
  max-height: 16rem;
}

@media (max-width: 1023px) {
  .nav-item {
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
  }

  .btn,
  .field,
  .date-preset-btn {
    min-height: 2.75rem;
  }

  .btn-sm {
    min-height: 2.5rem;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar .btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
    height: auto;
    min-height: 2.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

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

  .pagination-controls {
    justify-content: center;
    flex-wrap: wrap;
  }

  .table-actions {
    justify-content: flex-start;
    gap: 0.25rem;
  }

  .table-actions .btn-label {
    display: none;
  }

  .table-actions .btn-icon-action {
    min-width: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    flex-shrink: 0;
  }

  .table-actions .btn-icon-action .icon {
    width: 1rem;
    height: 1rem;
  }

  .topbar-role {
    display: none;
  }
}

@media (max-width: 639px) {
  .module-root {
    padding: 0.75rem;
  }

  .panel-body {
    padding: 0.25rem 0.75rem 0.875rem;
  }

  .toast-stack {
    left: 0.75rem;
    right: 0.75rem;
    top: auto;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    max-width: none;
  }

  .logout-label,
  .menu-btn-label {
    display: none;
  }

  .menu-btn,
  .logout-btn {
    min-width: 2.75rem;
    padding-inline: 0.625rem;
  }

  .date-range-inputs {
    grid-template-columns: 1fr;
  }

  .date-preset-btn {
    flex: 1 1 calc(50% - 0.375rem);
    min-width: calc(50% - 0.375rem);
    justify-content: center;
  }

  .money-input {
    grid-template-columns: 1fr;
  }

  .money-input .money-currency {
    width: 100%;
    min-width: 0;
  }

  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .form-actions .btn {
    width: 100%;
  }

  .modal-dialog {
    padding: 1rem;
    border-radius: var(--radius-lg);
  }

  .login-card {
    padding: 1.5rem;
  }

  .stat-card-value {
    font-size: 1.25rem;
  }

  .data-table {
    min-width: 32rem;
    font-size: 0.75rem;
  }

  .data-table thead th,
  .data-table tbody td {
    padding: 0.625rem 0.375rem;
  }

  .data-table td:last-child {
    width: 1%;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .date-preset-btn {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .toolbar .btn {
    flex: 1 1 100%;
  }
}
