/* --- GENERAL --- */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 15px;
  background: #f8f9fa;
  color: #333;
  line-height: 1.5;
}

/* --- HEADINGS --- */
h1, h2, h3 {
  color: #222;
  margin-bottom: 12px;
  font-weight: 600;
}

/* --- LOGIN PAGE --- */
#loginPage {
  max-width: 360px;
  margin: 60px auto;
  background: #ffffff;
  padding: 25px 20px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  text-align: center;
}

#loginPage input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
}

#loginPage button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border: none;
  border-radius: 8px;
  background: #4CAF50;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

#loginPage button:hover { background: #45a049; }

/* --- APP FORM --- */
form {
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  max-width: 500px;
  margin: 0 auto 20px auto;
}

form label { display: block; margin-top: 12px; font-weight: 600; }
form input, form select, form button {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 15px;
}

form button {
  background: #007bff;
  color: #fff;
  margin-top: 15px;
  font-weight: bold;
}

form button:hover { background: #0069d9; }

/* --- FILTER & BUTTONS --- */
#filterSection, #buttonsSection {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

#filterSection input { flex: 1; }

#filterSection button, #buttonsSection button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

#filterSection button { background: #17a2b8; color: #fff; }
#filterSection button:hover { background: #138496; }

#buttonsSection button:first-child { background: #ffc107; color: #333; }
#buttonsSection button:first-child:hover { background: #e0a800; }
#buttonsSection button:last-child { background: #dc3545; color: #fff; }
#buttonsSection button:last-child:hover { background: #c82333; }

/* --- DATA LIST --- */
.data-row {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column; /* kebawah, bukan kesamping */
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.data-row > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.data-row button {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
}

.data-row button:first-child { background: #28a745; color: #fff; }
.data-row button:first-child:hover { background: #218838; }
.data-row button:last-child { background: #dc3545; color: #fff; }
.data-row button:last-child:hover { background: #c82333; }

/* --- PREVIEW --- */
#preview table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  table-layout: fixed;
  word-wrap: break-word;
}

#preview th, #preview td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
  font-size: 14px;
}

#preview th {
  background: #007bff;
  color: #fff;
}

#preview .total-row td {
  font-weight: bold;
  background: #f1f1f1;
}

/* --- HIDDEN --- */
.hidden { display: none; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 600px) {
  body { padding: 10px; }
  #loginPage, form { max-width: 100%; margin: 40px auto; padding: 20px; }
  .data-row { flex-direction: column; gap: 6px; }
  #filterSection, #buttonsSection { flex-direction: column; gap: 8px; }
  #filterSection input, #filterSection button, #buttonsSection button { width: 100%; }
  #preview th, #preview td { font-size: 13px; padding: 6px; }
}