/* Finance-specific styles */
:root {
  --primary-color: #007a55;
  --primary-dark: #005c40;
  --primary-light: #00a065;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
  --light-bg: #f8f9fa;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.finance-nav {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
}

.finance-nav a {
  color: white !important;
}

.finance-nav a:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.finance-container {
  margin-left: 250px;
  padding: 20px;
  background: var(--light-bg);
  min-height: 100vh;
}

/* Dashboard Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card .icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 15px;
}

.stat-card .icon.income {
  background: #d4edda;
  color: var(--success-color);
}
.stat-card .icon.expense {
  background: #f8d7da;
  color: var(--danger-color);
}
.stat-card .icon.balance {
  background: #cce5ff;
  color: var(--info-color);
}
.stat-card .icon.budget {
  background: #fff3cd;
  color: var(--warning-color);
}

.stat-card .value {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 5px;
}

.stat-card .label {
  color: #6c757d;
  font-size: 14px;
}

/* Charts Section */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.chart-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.chart-card h3 {
  margin: 0 0 20px 0;
  color: var(--primary-color);
  font-size: 18px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  border-bottom: 2px solid #dee2e6;
  padding-bottom: 0;
}

.tab {
  padding: 12px 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
  color: #6c757d;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--primary-color);
}

.tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.data-table th {
  background: var(--primary-color);
  color: white;
  padding: 15px;
  text-align: left;
  font-weight: 600;
}

.data-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #dee2e6;
}

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

.data-table .amount-positive {
  color: var(--success-color);
  font-weight: 600;
}

.data-table .amount-negative {
  color: var(--danger-color);
  font-weight: 600;
}

/* Category badges */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* Budget Progress */
.budget-progress {
  margin-bottom: 15px;
}

.budget-progress .header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.budget-progress .name {
  font-weight: 600;
}

.budget-progress .amounts {
  color: #6c757d;
  font-size: 14px;
}

.progress-bar {
  height: 10px;
  background: #e9ecef;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.3s ease;
}

.progress-bar .fill.ok {
  background: var(--success-color);
}
.progress-bar .fill.warning {
  background: var(--warning-color);
}
.progress-bar .fill.danger {
  background: var(--danger-color);
}

/* Account Cards */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.account-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.account-card .header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.account-card .name {
  font-size: 18px;
  font-weight: 600;
}

.account-card .type {
  font-size: 14px;
  color: #6c757d;
}

.account-card .balance {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 15px;
}

.account-card .balance.positive {
  color: var(--success-color);
}
.account-card .balance.negative {
  color: var(--danger-color);
}

/* Forms */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #495057;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 85, 0.1);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Filter Section */
.filter-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
}

.filter-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-row .form-group {
  flex: 1;
  min-width: 150px;
  margin-bottom: 0;
}

/* Alerts */
.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

.alert-danger {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.alert-info {
  background: #cce5ff;
  border: 1px solid #b8daff;
  color: #004085;
}

.alert .close-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.5;
}

.alert .close-btn:hover {
  opacity: 1;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-overlay > .modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
    position: relative;
    z-index: 10000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin: auto;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: var(--primary-color);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6c757d;
}

/* Search */
.search-box {
  position: relative;
}

.search-box input {
  padding-left: 40px;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
  .finance-container {
    margin-left: 0;
    padding: 15px;
  }

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

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

  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .tab {
    white-space: nowrap;
  }
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Transaction Type Icons */
.type-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.type-icon.income {
  background: #d4edda;
  color: var(--success-color);
}

.type-icon.expense {
  background: #f8d7da;
  color: var(--danger-color);
}

.type-icon.transfer {
  background: #cce5ff;
  color: var(--info-color);
}

/* Summary Cards */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.summary-card {
  background: white;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  box-shadow: var(--card-shadow);
}

.summary-card .value {
  font-size: 24px;
  font-weight: bold;
}

.summary-card .label {
  color: #6c757d;
  font-size: 13px;
  margin-top: 5px;
}

/* Export Options */
.export-options {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.empty-state h3 {
  margin-bottom: 10px;
  color: #495057;
}

/* Date Range */
.date-range {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-range input {
  width: 140px;
}

.date-range span {
  color: #6c757d;
}

/* Lucide Icons */
[data-lucide] {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  margin-right: 0.35em;
  margin-left: 0.15em;
}

.side-nav [data-lucide] {
  color: inherit;
}

.btn [data-lucide] {
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.4em;
  margin-left: 0;
}

.stat-card .icon [data-lucide] {
  width: 24px;
  height: 24px;
}

.type-icon [data-lucide] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.search-box [data-lucide] {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  margin: 0;
}

.empty-state [data-lucide] {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.modal-header [data-lucide] {
  margin-right: 0.5em;
}

/* Override global modal styles from style.css */
.modal-overlay .modal-content,
.modal-overlay > .modal {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  max-width: 600px !important;
  max-height: calc(100vh - 40px) !important;
  height: auto !important;
  margin: 0 auto !important;
  background: white !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
  z-index: 10000 !important;
  overflow-y: auto !important;
}

