/* ExpenseTracker — shared app shell & design tokens */

:root {
  --et-radius-lg: 18px;
  --et-radius-md: 12px;
  --et-radius-pill: 999px;
  --et-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --et-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --et-sidebar-width: 260px;
  --et-sidebar-collapsed-width: 72px;
  --et-content-topbar-height: 52px;
  --et-space-1: 0.25rem;
  --et-space-2: 0.5rem;
  --et-space-3: 0.75rem;
  --et-space-4: 1rem;
  --et-space-5: 1.25rem;
  --et-space-6: 1.5rem;
}

body.et-body {
  margin: 0;
  min-height: 100vh;
  background: var(--et-bg);
  color: var(--et-text);
  font-family: var(--et-font-family);
  scrollbar-width: thin;
  scrollbar-color: var(--et-scrollbar-thumb) var(--et-scrollbar-track);
}

.et-sidebar-nav,
.et-page,
.et-drawer-body {
  scrollbar-width: thin;
  scrollbar-color: var(--et-scrollbar-thumb) var(--et-scrollbar-track);
}

.et-sidebar-nav {
  scrollbar-color: var(--et-scrollbar-thumb) var(--et-scrollbar-track-sidebar, var(--et-scrollbar-track));
}

body.et-body::-webkit-scrollbar,
.et-sidebar-nav::-webkit-scrollbar,
.et-page::-webkit-scrollbar,
.et-drawer-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body.et-body::-webkit-scrollbar-track,
.et-page::-webkit-scrollbar-track,
.et-drawer-body::-webkit-scrollbar-track {
  background: var(--et-scrollbar-track);
}

.et-sidebar-nav::-webkit-scrollbar-track {
  background: var(--et-scrollbar-track-sidebar, var(--et-scrollbar-track));
}

body.et-body::-webkit-scrollbar-thumb,
.et-sidebar-nav::-webkit-scrollbar-thumb,
.et-page::-webkit-scrollbar-thumb,
.et-drawer-body::-webkit-scrollbar-thumb {
  background: var(--et-scrollbar-thumb);
  border-radius: var(--et-radius-pill);
  border: 2px solid var(--et-scrollbar-track);
}

body.et-body::-webkit-scrollbar-thumb:hover,
.et-sidebar-nav::-webkit-scrollbar-thumb:hover,
.et-page::-webkit-scrollbar-thumb:hover,
.et-drawer-body::-webkit-scrollbar-thumb:hover {
  background: var(--et-scrollbar-thumb-hover);
}

.et-app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
}

/* ── West sidebar ── */
.et-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  width: var(--et-sidebar-width);
  height: 100vh;
  background: var(--et-sidebar-surface);
  color: var(--et-sidebar-text);
  border-right: 1px solid var(--et-sidebar-border);
  box-shadow: var(--et-shadow-sm);
  transition: width 0.2s ease;
  overflow: hidden;
}

.et-sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--et-space-2);
  min-height: 64px;
  padding: var(--et-space-4);
  border-bottom: 1px solid var(--et-sidebar-border);
  flex-shrink: 0;
}

.et-sidebar-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.et-sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--et-space-2);
  min-width: 0;
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  color: var(--et-sidebar-text);
  text-decoration: none;
  white-space: nowrap;
}

.et-sidebar-brand:hover {
  color: var(--et-sidebar-active-color);
}

.et-sidebar-brand-icon {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

body.et-sidebar-collapsed .et-sidebar-brand-icon {
  display: inline-flex;
}

.et-sidebar-brand-text {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  transition: opacity 0.15s ease, width 0.15s ease;
}

.et-sidebar-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  padding: 0;
  color: var(--et-sidebar-muted);
  background: transparent;
  border: 1px solid var(--et-sidebar-border);
  border-radius: var(--et-radius-md);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.et-sidebar-collapse-btn:hover {
  color: var(--et-sidebar-text);
  background: var(--et-sidebar-soft);
}

.et-sidebar-nav {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: var(--et-space-3) var(--et-space-2);
}

.et-sidebar-menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.et-sidebar-menu > li + li {
  margin-top: 0.125rem;
}

.et-sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--et-space-3);
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--et-sidebar-muted);
  text-decoration: none;
  border: none;
  border-radius: var(--et-radius-md);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.et-sidebar-link i {
  flex-shrink: 0;
  width: 1.25rem;
  font-size: 1.125rem;
  text-align: center;
}

.et-sidebar-link:hover {
  color: var(--et-sidebar-text);
  background: var(--et-sidebar-soft);
}

.et-sidebar-link.active {
  color: var(--et-sidebar-active-color);
  background: var(--et-sidebar-active-bg);
}

.et-sidebar-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: opacity 0.15s ease;
}

.et-sidebar-section {
  margin-top: var(--et-space-3);
  padding-top: var(--et-space-2);
  border-top: 1px solid var(--et-sidebar-border);
}

.et-sidebar-section-toggle {
  display: flex;
  align-items: center;
  gap: var(--et-space-3);
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--et-sidebar-muted);
  background: transparent;
  border: none;
  border-radius: var(--et-radius-md);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.et-sidebar-section-toggle:hover {
  color: var(--et-sidebar-text);
  background: var(--et-sidebar-soft);
}

.et-sidebar-section-toggle i:first-child {
  flex-shrink: 0;
  width: 1.25rem;
  font-size: 1rem;
  text-align: center;
}

.et-sidebar-chevron {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.et-sidebar-section.is-open .et-sidebar-chevron {
  transform: rotate(180deg);
}

.et-sidebar-section-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease;
}

.et-sidebar-section.is-open .et-sidebar-section-panel {
  grid-template-rows: 1fr;
}

.et-sidebar-section-panel > .et-sidebar-menu {
  overflow: hidden;
}

.et-sidebar-section.is-open .et-sidebar-section-panel > .et-sidebar-menu {
  padding-top: 0.25rem;
}

/* Legacy title class kept for any stragglers */
.et-sidebar-section-title {
  display: flex;
  align-items: center;
  gap: var(--et-space-3);
  padding: 0.375rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--et-sidebar-muted);
}

.et-sidebar-section-title i {
  flex-shrink: 0;
  width: 1.25rem;
  font-size: 1rem;
  text-align: center;
}

.et-sidebar-submenu .et-sidebar-link {
  padding-left: 1.125rem;
}

.et-sidebar-footer {
  flex-shrink: 0;
  padding: var(--et-space-3) var(--et-space-2);
  border-top: 1px solid var(--et-sidebar-border);
  background: var(--et-sidebar-footer-bg);
}

.et-sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--et-space-3);
  padding: 0.625rem 0.75rem;
  margin-bottom: 0.125rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--et-sidebar-text);
}

.et-sidebar-user i {
  flex-shrink: 0;
  width: 1.25rem;
  font-size: 1.25rem;
  color: var(--et-sidebar-muted);
}

.et-sidebar-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.et-sidebar-footer-link {
  margin-top: 0.125rem;
}

.et-sidebar-logout-form {
  margin: 0;
}

.et-sidebar-logout-btn {
  text-align: left;
}

.et-sidebar-logout-btn:hover {
  color: var(--et-danger);
  background: var(--et-danger-soft);
}

.et-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1035;
  background: rgba(15, 23, 42, 0.45);
}

/* Collapsed sidebar (desktop) */
body.et-sidebar-collapsed .et-sidebar {
  width: var(--et-sidebar-collapsed-width);
}

body.et-sidebar-collapsed .et-sidebar-brand-text,
body.et-sidebar-collapsed .et-sidebar-label,
body.et-sidebar-collapsed .et-sidebar-section-toggle .et-sidebar-label,
body.et-sidebar-collapsed .et-sidebar-section-toggle .et-sidebar-chevron {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

body.et-sidebar-collapsed .et-sidebar-header {
  flex-direction: column;
  justify-content: center;
  gap: var(--et-space-2);
  padding: var(--et-space-3) var(--et-space-2);
  position: relative;
}

body.et-sidebar-collapsed .et-sidebar-brand {
  flex: 0;
  justify-content: center;
  width: 100%;
}

body.et-sidebar-collapsed .et-sidebar-header-actions {
  flex-direction: column;
}

body.et-sidebar-collapsed .et-theme-picker-menu {
  left: calc(100% + 0.5rem);
  top: 0;
  transform: none;
}

body.et-sidebar-collapsed .et-sidebar-collapse-btn {
  position: static;
}

body.et-sidebar-collapsed .et-sidebar-section {
  margin-top: var(--et-space-2);
  padding-top: 0;
  border-top: none;
}

body.et-sidebar-collapsed .et-sidebar-section-toggle {
  display: none;
}

body.et-sidebar-collapsed .et-sidebar-section-panel {
  display: block;
  grid-template-rows: 1fr;
}

body.et-sidebar-collapsed .et-sidebar-section-panel > .et-sidebar-menu {
  overflow: visible;
  padding-top: 0;
}

body.et-sidebar-collapsed .et-sidebar-link,
body.et-sidebar-collapsed .et-sidebar-user {
  justify-content: center;
  padding-inline: 0.5rem;
}

body.et-sidebar-collapsed .et-sidebar-submenu .et-sidebar-link {
  padding-left: 0.5rem;
}

body.et-sidebar-collapsed .et-main {
  margin-left: var(--et-sidebar-collapsed-width);
}

/* Main content area */
.et-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--et-sidebar-width);
  transition: margin-left 0.2s ease;
  overflow-x: hidden;
}

.et-content-topbar {
  display: flex;
  align-items: center;
  gap: var(--et-space-3);
  min-height: var(--et-content-topbar-height);
  padding: 0 var(--et-space-4);
  background: var(--et-surface);
  border-bottom: 1px solid var(--et-border);
  box-shadow: var(--et-shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.et-mobile-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: var(--et-text);
  background: var(--et-surface);
  border: 1px solid var(--et-border);
  border-radius: var(--et-radius-md);
  cursor: pointer;
}

.et-content-topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--et-text);
}

@media (max-width: 991.98px) {
  .et-sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  body.et-sidebar-mobile-open .et-sidebar {
    transform: translateX(0);
  }

  .et-main {
    margin-left: 0;
  }

  body.et-sidebar-collapsed .et-main {
    margin-left: 0;
  }
}

/* ── Page shell ── */
.et-page {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--et-space-3) var(--et-space-5) 2.5rem;
  overflow-x: hidden;
  min-width: 0;
}

.et-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1rem;
  padding: var(--et-space-4) var(--et-space-5);
  font-size: 0.8125rem;
  color: var(--et-muted);
  text-align: center;
  border-top: 1px solid var(--et-border);
  background: var(--et-surface);
}

.et-footer-version {
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

/* ── Page header (shared across modules) ── */
.et-page-header,
.page-header {
  display: flex;
  flex-direction: column;
  gap: var(--et-space-4);
  margin-bottom: var(--et-space-5);
}

@media (min-width: 768px) {
  .et-page-header,
  .page-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.et-page-header-text h1,
.page-header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--et-text);
  line-height: 1.25;
}

.et-page-header-compact,
.et-page-header.et-nb-compact-header,
.et-page-header.et-budget-set-header,
.et-page-header.et-budget-report-header {
  margin-top: 0;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.et-page-title-row,
.et-budget-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.et-page-title-row h1,
.et-budget-title-row h1 {
  margin: 0;
}

.et-page-about-btn,
.et-budget-about-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--et-border);
  border-radius: 999px;
  background: var(--et-surface);
  color: var(--et-muted);
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.et-page-about-btn:hover,
.et-page-about-btn:focus-visible,
.et-budget-about-btn:hover,
.et-budget-about-btn:focus-visible {
  color: var(--et-primary);
  border-color: color-mix(in srgb, var(--et-primary) 40%, var(--et-border));
  background: var(--et-primary-soft, color-mix(in srgb, var(--et-primary) 10%, var(--et-surface)));
  outline: none;
}

.et-page-about-btn i,
.et-budget-about-btn i {
  font-size: 1.05rem;
}

.et-page-about-modal .modal-body p:first-child,
.et-budget-about-modal .modal-body p:first-child {
  margin-top: 0;
}

.et-page-about-note,
.et-budget-about-note {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--et-muted);
}

.et-page-title-meta {
  font-size: 1rem;
  font-weight: 500;
  color: var(--et-muted);
}

.et-page-title-meta .et-page-title-current {
  font-weight: 600;
  color: var(--et-primary);
}

.et-page-header-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--et-space-2);
  align-items: center;
}

@media (max-width: 767.98px) {
  .et-page-header-actions .et-btn-primary,
  .et-page-header-actions .et-btn-secondary,
  .page-header .btn-primary,
  .page-header .et-btn-primary {
    flex: 1 1 auto;
  }
}

/* ── Month nav + pagination toolbar ── */
.et-month-nav-row,
.et-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--et-space-3);
  margin-bottom: var(--et-space-5);
}

.et-month-nav-group {
  display: inline-flex;
  width: 100%;
  max-width: 520px;
  background: var(--et-surface);
  border: 1px solid var(--et-border);
  border-radius: var(--et-radius-md);
  overflow: visible;
  box-shadow: var(--et-shadow-sm);
  position: relative;
}

.et-month-nav-group a,
.et-month-nav-group .et-month-nav-disabled,
.et-month-nav-group .et-month-jump {
  flex: 1;
  min-width: 0;
}

.et-month-nav-group a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--et-muted);
  text-decoration: none;
  border-right: 1px solid var(--et-border);
  transition: background 0.15s ease, color 0.15s ease;
}

.et-month-nav-group > a:last-child,
.et-month-nav-group > .et-month-nav-disabled:last-child {
  border-right: none;
}

.et-month-nav-group a:hover {
  background: var(--et-surface-soft);
  color: var(--et-text);
}

.et-month-nav-group .et-month-nav-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--et-muted);
  opacity: 0.45;
  cursor: not-allowed;
  user-select: none;
  background: var(--et-surface-soft);
}

.et-month-jump {
  position: relative;
  border-right: 1px solid var(--et-border);
}

.et-month-nav-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  height: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--et-primary);
  background: var(--et-primary-soft);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.et-month-nav-current:hover {
  background: color-mix(in srgb, var(--et-primary-soft) 80%, var(--et-primary) 20%);
}

.et-month-jump.is-open .et-month-nav-current {
  background: color-mix(in srgb, var(--et-primary-soft) 70%, var(--et-primary) 30%);
}

.et-month-jump-caret {
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}

.et-month-jump.is-open .et-month-jump-caret {
  transform: rotate(180deg);
}

.et-month-jump-panel {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 50%;
  z-index: 20;
  width: min(16rem, 80vw);
  padding: var(--et-space-4);
  background: var(--et-surface);
  border: 1px solid var(--et-border);
  border-radius: var(--et-radius-md);
  box-shadow: var(--et-shadow-md);
  transform: translateX(-50%);
}

.et-month-jump-title {
  margin: 0 0 var(--et-space-3);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--et-text);
}

.et-month-jump-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--et-space-3);
  margin-bottom: var(--et-space-3);
}

.et-month-jump-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--et-muted);
}

.et-month-jump-go {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.et-list-toolbar-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--et-muted);
}

.et-pagination-bar {
  display: inline-flex;
  align-items: center;
  gap: var(--et-space-2);
  margin-left: auto;
}

.et-list-toolbar .et-pagination-bar {
  margin-left: auto;
}

.et-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--et-text);
  background: var(--et-surface);
  border: 1px solid var(--et-border);
  border-radius: var(--et-radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.et-pagination-btn:hover:not(.et-pagination-btn-disabled) {
  background: var(--et-surface-soft);
  color: var(--et-text);
}

.et-pagination-btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.et-pagination-status {
  padding: 0 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--et-muted);
  white-space: nowrap;
}

.et-pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
}

.et-pagination-jump-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--et-muted);
  white-space: nowrap;
}

.et-pagination-page-input {
  width: 3.25rem;
  padding: 0.3125rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  color: var(--et-text);
  background: var(--et-surface);
  border: 1px solid var(--et-border);
  border-radius: var(--et-radius-md);
}

.et-pagination-page-input:focus {
  outline: none;
  border-color: var(--et-primary);
  box-shadow: 0 0 0 2px var(--et-primary-soft);
}

.et-pagination-go-btn {
  border: none;
  background: var(--et-primary);
  color: #fff;
}

.et-pagination-go-btn:hover {
  background: var(--et-primary-hover);
  color: #fff;
}

.et-pagination-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--et-space-4);
  margin-bottom: var(--et-space-5);
}

@media (max-width: 575.98px) {
  .et-month-nav-row,
  .et-list-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .et-month-nav-group {
    max-width: none;
  }

  .et-pagination-bar {
    justify-content: center;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .et-pagination-jump-label {
    display: none;
  }

  .et-pagination-footer {
    justify-content: center;
  }

  .et-pagination-btn-label {
    display: none;
  }
}

/* ── Row action icon buttons ── */
.et-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.et-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 0.9375rem;
  line-height: 1;
  border-radius: var(--et-radius-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.et-btn-icon-primary {
  color: var(--et-primary);
  border-color: var(--et-primary);
}

.et-btn-icon-primary:hover {
  color: var(--et-primary);
  background: var(--et-primary-soft);
}

.et-btn-icon-danger {
  color: var(--et-danger);
  border-color: var(--et-danger);
}

.et-btn-icon-danger:hover {
  color: var(--et-danger);
  background: var(--et-danger-soft);
}

/* ── Shared components ── */
.et-alert {
  padding: var(--et-space-3) var(--et-space-4);
  margin-bottom: var(--et-space-5);
  font-size: 0.875rem;
  border-radius: var(--et-radius-md);
  border: 1px solid transparent;
}

.et-alert-success {
  color: var(--et-success);
  background: var(--et-success-soft);
  border-color: rgba(22, 163, 74, 0.25);
}

.et-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--et-space-2);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--et-primary);
  border: none;
  border-radius: var(--et-radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px var(--et-primary-shadow);
}

.et-btn-primary:hover {
  filter: brightness(1.05);
  color: #fff;
  box-shadow: 0 6px 18px var(--et-primary-shadow);
}

.et-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--et-space-2);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--et-text);
  background: var(--et-surface);
  border: 1px solid var(--et-border);
  border-radius: var(--et-radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.et-btn-secondary:hover {
  background: var(--et-surface-soft);
  color: var(--et-text);
}

.et-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--et-space-2);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--et-danger);
  border: 1px solid var(--et-danger);
  border-radius: var(--et-radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.et-btn-danger:hover {
  filter: brightness(1.05);
  color: #fff;
}

.et-btn-outline-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3125rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--et-primary);
  background: transparent;
  border: 1px solid var(--et-primary);
  border-radius: var(--et-radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.et-btn-outline-primary:hover {
  background: var(--et-primary-soft);
  color: var(--et-primary);
}

.et-btn-outline-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3125rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--et-danger);
  background: transparent;
  border: 1px solid var(--et-danger);
  border-radius: var(--et-radius-md);
  cursor: pointer;
  transition: background 0.15s ease;
}

.et-btn-outline-danger:hover {
  background: var(--et-danger-soft);
  color: var(--et-danger);
}

.et-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--et-radius-pill);
}

.et-badge-primary {
  color: var(--et-primary);
  background: var(--et-primary-soft);
}

.et-badge-muted {
  color: var(--et-muted);
  background: var(--et-surface-soft);
  border: 1px solid var(--et-border);
}

.et-badge-success {
  color: var(--et-success);
  background: var(--et-success-soft);
}

.et-badge-warning {
  color: #b45309;
  background: #fffbeb;
}

/* ── Table card (shared list grids) ── */
.et-table-card {
  background: var(--et-surface);
  border: 1px solid var(--et-border);
  border-radius: var(--et-radius-lg);
  box-shadow: var(--et-shadow-sm);
  overflow: hidden;
}

.et-table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--et-space-4) var(--et-space-5);
  border-bottom: 1px solid var(--et-border);
}

.et-table-card-header h2 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--et-text);
}

.et-table-card-meta {
  font-size: 0.8125rem;
  color: var(--et-muted);
}

.et-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Shared data grid column separators */
.et-data-table {
  width: 100%;
  margin: 0;
  font-size: 0.875rem;
}

.et-data-table,
.et-report-data-table,
.et-nb-data-table,
.et-budget-report-dense-table,
.et-budget-input-table {
  border-collapse: collapse;
}

.et-data-table thead th,
.et-data-table tbody td,
.et-data-table tfoot td,
.et-data-table tfoot th,
.et-report-data-table thead th,
.et-report-data-table tbody th,
.et-report-data-table tbody td,
.et-report-data-table tfoot th,
.et-report-data-table tfoot td,
.et-nb-data-table thead th,
.et-nb-data-table tbody th,
.et-nb-data-table tbody td,
.et-nb-data-table tfoot th,
.et-nb-data-table tfoot td {
  border: 1px solid var(--et-border);
}

.et-data-table thead th:first-child,
.et-report-data-table thead th:first-child,
.et-nb-data-table thead th:first-child,
.et-data-table tbody td:first-child,
.et-report-data-table tbody th:first-child,
.et-nb-data-table tbody td:first-child {
  border-left-width: 1px;
}

.et-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--et-muted);
  background: var(--et-surface-soft);
  border-bottom: 1px solid var(--et-border);
  white-space: nowrap;
}

.et-data-table tbody td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--et-border);
  color: var(--et-text);
}

.et-data-table tbody tr:last-child td {
  border-bottom: none;
}

.et-data-table tbody tr:nth-child(even) {
  background: var(--et-row-stripe);
}

.et-data-table tbody tr:hover {
  background: var(--et-primary-soft);
}

.et-data-table .et-cell-item {
  font-weight: 500;
  max-width: 280px;
}

.et-data-table .et-cell-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  color: var(--et-muted);
}

.et-data-table .et-cell-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.et-data-table .et-cell-amount-positive {
  color: var(--et-text);
}

.et-data-table .et-cell-amount-negative {
  color: var(--et-danger);
}

.et-data-table .et-cell-actions {
  white-space: nowrap;
}

.et-data-table tbody tr.et-row-muted {
  opacity: 0.72;
}

.et-empty-state {
  padding: 3rem var(--et-space-5);
  text-align: center;
  color: var(--et-muted);
  font-size: 0.9375rem;
}

/* ── East filter panel ── */
.et-filter-panel {
  width: min(26rem, 100vw);
}

.et-filter-panel-body .et-filter-form {
  display: flex;
  flex-direction: column;
  gap: var(--et-space-4);
}

.et-filter-panel-body .et-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

body.et-filter-open {
  overflow: hidden;
}

/* ── Filter card (legacy — prefer filter panel) ── */
.et-filter-card {
  margin-bottom: var(--et-space-5);
  background: var(--et-surface);
  border: 1px solid var(--et-border);
  border-radius: var(--et-radius-lg);
  box-shadow: var(--et-shadow-sm);
  overflow: hidden;
}

.et-filter-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--et-space-4) var(--et-space-5);
  border-bottom: 1px solid var(--et-border);
  background: var(--et-surface-soft);
}

.et-filter-card-header h2 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--et-text);
}

.et-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--et-muted);
  background: transparent;
  border: 1px solid var(--et-border);
  border-radius: var(--et-radius-md);
  cursor: pointer;
}

.et-filter-toggle:hover {
  color: var(--et-text);
  background: var(--et-surface);
}

.et-filter-card-body {
  padding: var(--et-space-5);
}

.et-filter-form label,
.et-filter-form .form-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--et-muted);
}

.et-filter-form .form-control,
.et-filter-form .form-select {
  font-size: 0.875rem;
  border-color: var(--et-border);
  border-radius: var(--et-radius-md);
  background: var(--et-surface);
  color: var(--et-text);
}

.et-filter-form .form-control:focus,
.et-filter-form .form-select:focus {
  border-color: var(--et-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.et-filter-actions {
  display: flex;
  flex-direction: column;
  gap: var(--et-space-3);
  margin-top: var(--et-space-5);
  padding-top: var(--et-space-4);
  border-top: 1px solid var(--et-border);
}

@media (min-width: 768px) {
  .et-filter-actions {
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
  }
}

@media (max-width: 767.98px) {
  .et-filter-actions .et-btn-primary,
  .et-filter-actions .et-btn-secondary,
  .et-filter-form .d-flex .et-btn-primary,
  .et-filter-form .d-flex .et-btn-secondary,
  .et-filter-form .d-flex .btn {
    width: 100%;
  }
}

/* ── Record removal modal ── */
.et-removal-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--et-space-4);
}

.et-removal-modal-root[hidden] {
  display: none !important;
}

.et-removal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.et-removal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 28rem);
  padding: var(--et-space-5);
  background: var(--et-surface);
  border: 1px solid var(--et-border);
  border-radius: var(--et-radius-lg);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.et-removal-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--et-space-3);
  margin-bottom: var(--et-space-3);
}

.et-removal-dialog-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--et-text);
}

.et-removal-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: var(--et-muted);
  background: transparent;
  border: none;
  border-radius: var(--et-radius-md);
  cursor: pointer;
}

.et-removal-dialog-close:hover {
  color: var(--et-text);
  background: var(--et-surface-soft);
}

.et-removal-dialog-body {
  margin: 0 0 var(--et-space-4);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--et-muted);
}

.et-removal-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--et-space-2);
  justify-content: flex-end;
}

.et-removal-keyhint {
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0.75;
}

body.et-removal-open {
  overflow: hidden;
}

@media (max-width: 575.98px) {
  .et-removal-dialog-actions {
    flex-direction: column;
  }

  .et-removal-dialog-actions .et-btn-danger,
  .et-removal-dialog-actions .et-btn-secondary {
    width: 100%;
  }
}
