* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f7fb;
}
.container {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 230px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding: 25px 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo i {
  font-size: 28px;
  color: #111827;
}

.logo h2 {
  font-size: 22px;
  color: #111827;
}

.logo p {
  font-size: 13px;
  color: #6b7280;
  margin-top: 3px;
}
.main-content {
  margin-left: 230px;
  flex: 1;
  padding: 30px;
}

nav {
  margin-top: 40px;
}
nav ul {
  list-style: none;
}
nav li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 10px;
  cursor: pointer;
  color: #4b5563;
  transition: all 0.3s ease;
}

nav li:hover {
  background: #f3f4f6;
  color: #111827;
}

.active {
  background: #e5e7eb;
  color: #111827;
}
.add-btn {
  width: 100%;
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: none;
  background: black;
  color: white;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  transition: 0.3s;
  margin-top: auto;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.add-btn:hover {
  transform: translateY(-2px);
}
.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 70px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0 25px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 20px;
}
.user-info span {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}
.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}

.logout-btn:hover {
  background: #f3f4f6;
}
.dashboard {
  padding: 35px;
}
.dashboard h1 {
  font-size: 30px;
  font-weight: 900;
  color: #111827;
}
.subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: #6b7280;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 25px;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  transition: 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.card p {
  color: #6b7280;
  font-size: 15px;
  margin-bottom: 10px;
}

.card h2 {
  font-size: 38px;
  color: #111827;
  font-weight: 800;
}
.card-title {
  color: #6b7280;
  font-size: 15px;
}
.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  margin-bottom: 18px;
}
.blue {
  background: #dbeafe;
  color: #2563eb;
}

.green {
  background: #dcfce7;
  color: #15803d;
}

.red {
  background: #fee2e2;
  color: #dc2626;
}

.purple {
  background: #ede9fe;
  color: #7c3aed;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 30px;
  align-items: start;
}

.main-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.side-column {
  display: flex;
  flex-direction: column;
}

.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 22px;
}
.panel h2 {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 20px;
}

.chart-area {
  position: relative;
  width: 100%;
  height: 300px;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 15px;
}
#cashFlowChart {
  width: 100% !important;
  height: 100% !important;
}

.table-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 48px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
}

.search-box i {
  color: #6b7280;
  font-size: 15px;
}

.search-input {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
}

.filter-select {
  width: 220px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  height: 48px;
  outline: none;
  background: #fff;
}

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #6b7280;
}

td {
  padding: 14px 10px;
  border-bottom: 1px solid #f3f4f6;
}

.preference-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 50px;
  cursor: pointer;
  transition: 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.switch input:checked + .slider {
  background: #2563eb;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.reset-btn {
  width: 100%;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: 1px solid #ef4444;
  background: #fff5f5;
  color: #dc2626;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.reset-btn:hover {
  background: #fee2e2;
}

/* modal */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  width: 420px;
  max-width: 90%;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  animation: popup 0.25s ease;
}

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

/* header */

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.close {
  font-size: 30px;
  color: #6b7280;
  cursor: pointer;
  transition: 0.2s;
}

.close:hover {
  color: #111827;
}

/* form */

#transactionForm {
  display: flex;
  flex-direction: column;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.form-group label {
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  margin-bottom: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

#transactionForm input,
#transactionForm select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  color: #111827;
  outline: none;
  transition: 0.2s;
}

#transactionForm input:focus,
#transactionForm select:focus {
  border-color: #000103;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* save-btn */
.save-btn {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border: none;
  border-radius: 8px;
  background: #01040a;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s;
}

.save-btn:hover {
  background: #303038;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* settings */

.settings-page {
  display: none;
  padding: 34px 30px;
}

.settings-page.active {
  display: block;
}

.settings-page h1 {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 6px;
}

.settings-page .subtitle {
  font-size: 15px;
  color: #6b7280;
  margin-bottom: 22px;
}
.settings-panel {
  width: 66%;
  min-width: 780px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
}

.settings-panel h2 {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 18px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  margin-bottom: 22px;
}

.settings-panel label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.settings-panel input,
.settings-panel select {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  color: #111827;
  outline: none;
  transition: 0.25s;
}

.settings-panel input::placeholder {
  color: #9ca3af;
}

.settings-panel input:focus,
.settings-panel select:focus {
  border-color: #040507;
}
.settings-panel .save-btn {
  width: 118px;
  height: 42px;
  border: none;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s;
}

.settings-panel .save-btn:hover {
  background: #222;
}

/* tables */

.table-container table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table-container th {
  padding: 14px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  text-align: center;
}

.table-container td {
  padding: 18px 10px;
  font-size: 16px;
  color: #111827;
  border-top: 1px solid #eef2f7;
  text-align: center;
  vertical-align: middle;
}

/* Column widths */
.table-container table {
  width: 100%;
  border-collapse: collapse;
}

.table-container th,
.table-container td {
  padding: 18px 12px;
  text-align: left;
}

.table-container th:last-child,
.table-container td:last-child {
  text-align: center;
  width: 120px;
}
/* Actions column */
#transactionTable td:last-child {
  text-align: center;
  vertical-align: middle;
}

.action-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.edit-btn,
.delete-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.2s ease;
}

.edit-btn {
  background: #eef4ff;
  color: #2563eb;
}

.edit-btn:hover {
  background: #dbeafe;
}

.delete-btn {
  background: #fff1f2;
  color: #dc2626;
}

.delete-btn:hover {
  background: #ffe4e6;
}

.edit-btn i,
.delete-btn i {
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
}

body.dark-mode {
  background: #111827;
  color: #f9fafb;
}

body.dark-mode .sidebar {
  background: #1f2937;
  border-right: 1px solid #374151;
}

body.dark-mode .logo h2,
body.dark-mode .logo i {
  color: white;
}

body.dark-mode .logo p {
  color: #9ca3af;
}

body.dark-mode nav li {
  color: #d1d5db;
}

body.dark-mode nav li:hover {
  background: #374151;
}

body.dark-mode nav li.active {
  background: #2563eb;
  color: white;
}

body.dark-mode .main-content {
  background: #111827;
}

body.dark-mode .topbar {
  background: #1f2937;
  border-color: #374151;
}

body.dark-mode .user-info span {
  color: white;
}

body.dark-mode .logout-btn {
  background: #374151;
  color: white;
  border: none;
}

body.dark-mode .card,
body.dark-mode .panel,
body.dark-mode .settings-panel {
  background: #1f2937;
  border-color: #374151;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode label {
  color: white;
}

body.dark-mode p,
body.dark-mode span,
body.dark-mode td,
body.dark-mode th {
  color: #d1d5db;
}

body.dark-mode input,
body.dark-mode select {
  background: #374151;
  color: white;
  border: 1px solid #4b5563;
}

body.dark-mode input::placeholder {
  color: #9ca3af;
}

body.dark-mode .search-box {
  background: #374151;
  border-color: #4b5563;
}

body.dark-mode table {
  background: #1f2937;
}

body.dark-mode td {
  border-color: #374151;
}

body.dark-mode .modal-content {
  background: #1f2937;
}

body.dark-mode .modal-header h2 {
  color: white;
}

body.dark-mode .close {
  color: white;
}

body.dark-mode .chart-area {
  border-color: #4b5563;
}

body.dark-mode .save-btn,
body.dark-mode .add-btn {
  background: #2563eb;
}

body.dark-mode .reset-btn {
  background: #7f1d1d;
  color: white;
  border: none;
}
