/* ── Expense Ledger Page ── */
.expense-ledger-page {
  min-height: 100%;
}

.el-header-row,
.el-page-header {
  margin-bottom: var(--space-md);
}

.el-mobile-list {
  display: none;
  flex-direction: column;
  gap: var(--space-sm);
}

.el-mobile-list.is-visible {
  display: flex;
}

.el-mobile-card {
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.el-mobile-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  margin-bottom: 4px;
}

.el-mobile-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.el-title-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-left: 4px solid #dc2626;
  padding-left: var(--space-sm);
}

.el-title-wrap .page-title-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
}

.el-title-wrap .page-title-back:hover {
  background: #fef2f2;
  color: #dc2626;
}

.el-title-wrap .page-title-back svg { width: 20px; height: 20px; }

.el-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.toolbar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.toolbar-icon-btn:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}

.toolbar-icon-btn svg { width: 18px; height: 18px; }

.el-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.el-stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.el-stat-card.is-total { border-top: 3px solid #dc2626; }

.el-stat-label {
  display: block;
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.el-stat-value {
  font-family: var(--font-en);
  font-size: var(--text-xl);
  font-weight: 700;
}

.el-stat-card.is-total .el-stat-value { color: #dc2626; }

.el-stat-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: #fef2f2;
  color: #dc2626;
}

.el-stat-icon svg { width: 22px; height: 22px; }

.el-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.el-date-range {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  min-width: 200px;
}

.el-date-range-icon { width: 16px; height: 16px; color: var(--color-text-muted); }
.el-date-range-label { font-family: var(--font-en); font-size: var(--text-sm); white-space: nowrap; }
.el-date-range-inputs { position: absolute; inset: 0; opacity: 0; display: flex; }
.el-date-range-inputs input { flex: 1; width: 50%; height: 100%; cursor: pointer; pointer-events: auto; }

.el-search-wrap,
.el-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 180px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.el-search-wrap svg { width: 16px; height: 16px; color: var(--color-text-muted); }
.el-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  background: transparent;
}

.el-table-meta {
  margin: var(--space-md) 0 var(--space-sm);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.el-table-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.el-table-card.is-hidden { display: none; }
.el-table-scroll { overflow-x: auto; }

.el-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.el-table thead { background: #fef2f2; }
.el-table th {
  padding: 12px 14px;
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  font-weight: 700;
  color: #991b1b;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.el-table td {
  padding: 12px 14px;
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border-light);
}

.el-cell-date { font-family: var(--font-bn); font-size: var(--text-xs); color: var(--color-text-secondary); }
.el-cell-note { color: var(--color-text-muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el-cell-amount { font-family: var(--font-en); font-weight: 700; color: #dc2626; white-space: nowrap; }

.el-empty-state { display: none; text-align: center; padding: var(--space-xl); }
.el-empty-state.is-visible { display: block; }
.el-empty-subtext { color: var(--color-text-muted); margin: 8px 0 var(--space-md); }

.el-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 300;
  padding: 12px 20px;
  background: #111827;
  color: #fff;
  border-radius: var(--radius-md);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  transition: transform 0.3s ease;
}

.el-toast.is-visible { transform: translateX(-50%) translateY(0); }
.el-toast.is-error { background: #991b1b; }

@media (max-width: 992px) {
  .el-table-card { display: none !important; }
  .el-mobile-list.is-visible { display: flex; }
  .el-search-box,
  .el-date-range { min-width: 0; }
}

@media (max-width: 768px) {
  .el-stats-grid { grid-template-columns: 1fr; }
  .el-toolbar { flex-direction: column; align-items: stretch; }
  .el-date-range, .el-search-box { width: 100%; min-width: 0; }
  .el-header-actions { width: 100%; }
  .el-header-actions .btn-brand { flex: 1; justify-content: center; }
  .el-table-card { display: none; }
  .el-mobile-list.is-visible { display: flex; }
}
