/* ====== GLOBAL ====== */
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: #f4f6f7;
  color: #333;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #2ecc71;
  padding: 15px 30px;
  color: white;
  flex-wrap: wrap;
}

header .logo {
  font-weight: 700;
  font-size: 20px;
}

header nav {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

header nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

header nav a:hover {
  text-decoration: underline;
}

/* ====== LAYOUT ====== */
main {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  padding: 20px;
}

section {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  border: 1px solid #ddd;
}

h2 {
  margin-top: 0;
  color: #2ecc71;
}

/* ====== FORMS ====== */
form input,
form textarea,
form select,
form button {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

form button {
  background: #2ecc71;
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

form button:hover {
  background: #27ae60;
}

/* ====== TABLES ====== */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

table th,
table td {
  border: 1px solid #eee;
  padding: 10px;
  text-align: center;
  font-size: 14px;
}

table th {
  background: #2ecc71;
  color: white;
}

/* ====== ROW COLORS BY TYPE ====== */
tr.type-income td {
  background: #eafaf1;
  color: #2ecc71;
  font-weight: 600;
}
tr.type-expense td {
  background: #fdecea;
  color: #e74c3c;
  font-weight: 600;
}
tr.type-transfer td,
tr.type-send_to_idr td {
  background: #fff8e1;
  color: #f39c12;
  font-weight: 600;
}
tr.type-debt_payment td {
  background: #e8f4fd;
  color: #2980b9;
  font-weight: 600;
}

/* ====== ACTION BUTTONS ====== */
button,
a.btn {
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 14px;
  text-decoration: none;
}

a.btn-edit {
  background: #3498db;
  color: white;
}
a.btn-edit:hover {
  background: #2980b9;
}

a.btn-delete {
  background: #e74c3c;
  color: white;
}
a.btn-delete:hover {
  background: #c0392b;
}

/* ====== PIE CHART CONTAINER ====== */
.chart-container {
  position: relative;
  margin: auto;
  height: 300px;
  width: 300px;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  main {
    grid-template-columns: 1fr;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  header nav {
    margin-top: 10px;
  }
  table {
    font-size: 12px;
  }
  table th, table td {
    padding: 6px;
  }
}
