:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  /* Dark Blue se Light Theme Colors Change */
  --bg-dark: #f1f5f9;       /* Light Slate Background */
  --card-bg: #ffffff;       /* Pure White Cards */
  --text-main: #0f172a;     /* Dark Slate Text */
  --text-muted: #64748b;    /* Muted Text */
  --border-color: #e2e8f0; /* Light Gray Borders */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 70px;
}

/* Header & Navbar */
.navbar {
  background: #ffffff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 15px;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: 0.3s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
}

/* Container width for desktop to show all columns easily */
.container {
  max-width: 98%;
  margin: 20px auto;
  padding: 0 10px;
}

/* Cards & Stats */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 15px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card h3 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.card .amount {
  font-size: 1.6rem;
  font-weight: 700;
}

.amount.fund { color: var(--success); }
.amount.expense { color: var(--danger); }
.amount.balance { color: var(--warning); }

/* Forms & Inputs */
.form-group label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  outline: none;
  font-size: 0.85rem;
}

.form-control:focus {
  border-color: var(--primary);
}

.btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  text-decoration: none;
  display: inline-block;
  font-size: 0.85rem;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }

/* Responsive & Compact Table (Scroll-Free Desktop Display) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
  table-layout: auto;
}

th, td {
  padding: 8px 10px; /* Reduced Padding to fit content */
  border-bottom: 1px solid var(--border-color);
  word-wrap: break-word;
  white-space: normal; /* Text wrap enabling */
}

th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
}

/* Modal Popup Styles */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(3px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--card-bg);
  padding: 25px;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
  .container { max-width: 100%; padding: 0 8px; }
  .navbar { flex-direction: column; gap: 10px; text-align: center; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  th, td { white-space: nowrap; } /* Mobile par standard scroll view ke liye */
}