/* Finance-specific utilities */

.nature-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nature-asset {
  color: var(--primary);
}

.nature-liability {
  color: var(--warning);
}

.nature-income {
  color: var(--success);
}

.nature-expense {
  color: var(--danger);
}

.chart-container {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.chart-container .chart-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 12px;
}

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

.report-section {
  margin-bottom: 20px;
}

.report-section-header {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-bottom: none;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-700);
  cursor: pointer;
  user-select: none;
}

.report-section-header:hover {
  background: var(--gray-100);
}

.report-section-header .toggle-icon {
  margin-right: 8px;
  font-size: 0.75rem;
  color: var(--gray-400);
  transition: transform 0.15s;
}

.report-section-header .toggle-icon.expanded {
  transform: rotate(90deg);
}

.report-section-header .section-total {
  margin-left: auto;
  font-family: var(--font-mono);
  font-weight: 500;
}

.report-section-body {
  border: 1px solid var(--gray-200);
  border-top: none;
}

.report-section-body.collapsed {
  display: none;
}

.report-row {
  display: flex;
  align-items: center;
  padding: 6px 12px 6px 32px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.1s;
}

.report-row:hover {
  background: var(--gray-50);
}

.report-row.level-2 {
  padding-left: 48px;
}

.report-row.level-3 {
  padding-left: 64px;
}

.report-row .report-label {
  flex: 1;
}

.report-row .report-amount {
  font-family: var(--font-mono);
  text-align: right;
  min-width: 100px;
}

.report-row .report-debit {
  font-family: var(--font-mono);
  text-align: right;
  min-width: 100px;
  color: var(--gray-800);
}

.report-row .report-credit {
  font-family: var(--font-mono);
  text-align: right;
  min-width: 100px;
  color: var(--danger);
}

.report-row.total-row {
  font-weight: 600;
  background: var(--gray-50);
  border-top: 2px solid var(--gray-200);
}

.report-row.grand-total {
  font-weight: 700;
  background: var(--primary-light);
  border-top: 2px solid var(--primary);
  color: var(--primary);
}

.balance-sheet-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
}

.balance-sheet-card .bs-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gray-200);
}

.accounting-equation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  margin-top: 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
}

.accounting-equation .eq-sign {
  font-weight: 400;
  color: var(--gray-400);
}

/* Opening balance editable table */
.ob-table td.editable {
  padding: 2px 6px;
}

.ob-table .ob-input {
  width: 130px;
  padding: 4px 6px;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  text-align: right;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  height: 28px;
}

.ob-table .ob-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.15);
}

/* Financial Year badges */
.fy-status-current {
  background: var(--success-light);
  color: var(--success);
}

.fy-status-closed {
  background: var(--danger-light);
  color: var(--danger);
}

.fy-status-future {
  background: var(--info-light);
  color: var(--info);
}

.chart-bar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 200px;
  padding: 8px 0;
}

.chart-bar-column {
  flex: 1;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  position: relative;
  transition: opacity 0.2s;
}

.chart-bar-column:hover {
  opacity: 0.8;
}

.chart-bar-column .bar-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800);
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.625rem;
  white-space: nowrap;
  display: none;
}

.chart-bar-column:hover .bar-tooltip {
  display: block;
}

.chart-bar-column.income-bar {
  background: var(--success);
}

.chart-bar-column.expense-bar {
  background: var(--danger);
}

.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 40px;
  margin-top: 8px;
}

.mini-chart .mini-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}

.mini-chart .mini-bar.positive {
  background: var(--success);
}

.mini-chart .mini-bar.negative {
  background: var(--danger);
}

.mini-chart .mini-bar.neutral {
  background: var(--primary);
}

.action-menu {
  position: relative;
  display: inline-block;
}

.action-menu-btn {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 1rem;
  border-radius: var(--radius-sm);
}

.action-menu-btn:hover {
  color: var(--gray-600);
  background: var(--gray-100);
}

.action-menu-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 1050;
  display: none;
  padding: 4px;
}

.action-menu-dropdown.dropup {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 4px;
}

.action-menu-dropdown.show {
  display: block;
}

.action-menu-dropdown a,
.action-menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 0.8125rem;
  color: var(--gray-700);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: inherit;
}

.action-menu-dropdown a:hover,
.action-menu-dropdown button:hover {
  background: var(--gray-50);
  color: var(--gray-900);
  text-decoration: none;
}

.action-menu-dropdown .dropdown-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 4px 0;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 16px;
  gap: 0;
}

.tab-item {
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.tab-item:hover {
  color: var(--gray-700);
}

.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Voucher type */
.voucher-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 600;
}

.voucher-cash { background: #ecfdf5; color: #065f46; }
.voucher-bank { background: #e0f2fe; color: #075985; }
.voucher-journal { background: #fef3c7; color: #92400e; }
.voucher-contra { background: #ede9fe; color: #5b21b6; }
.voucher-sales { background: #f0fdf4; color: #166534; }
.voucher-purchase { background: #fff1f2; color: #9f1239; }