/* ====== GLOBAL ====== */
body {
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f0f2f5;
  margin: 0;
  padding: 20px;
}

.container {
  max-width: 500px; /* 🔹 disamakan Scanner & List-data */
  margin: auto;
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

h2 {
  text-align: center;
  margin: 5px 0 15px;
}
h3 {
  margin: 5px 0 0 0;
  font-size: 14px;
}

/* ====== SCANNER BOX ====== */
#scanner {
  width: 100%;
  border-radius: 6px;
  background: #000;
  margin: 10px 0;
  position: relative;
}
.scanner-blink {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 4px solid red;
  border-radius: 6px;
  animation: blink 0.3s infinite alternate;
  pointer-events: none;
}
@keyframes blink {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* ====== BUTTONS ====== */
.del-all {
    width: 100%;
}

.btn {
  display: inline-block;
  padding: 8px 14px;
  margin: 3px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  transition: 0.2s;
}

.btn-scan,
.btn-add {
  background: #ffde00;
  color: #000;
}

.btn-clear,
.btn-del {
  background: #dc3545;
  color: #fff;
}

.btn-photo {
  background: #17a2b8;
  color: #fff;
}

.btn-stop {
  background: #6c757d;
  color: #fff;
}

.btn:hover {
  opacity: 0.9;
}

.add-btn {
  background: #28a745;
  color: #fff;
}
.remove-btn {
  background: #dc3545;
  color: #fff;
}

.btn-load {
  background: #007bff; /* biru */
  color: #fff;
}
.btn-load:hover {
  background: #0069d9;
}

.btn-del {
  background: #dc3545;
  color: #fff;
}
.btn-del:hover {
  background: #c82333;
}


/* ====== FORM ELEMENTS ====== */
input[type="file"],
input[type="text"],
select,
input[type="date"] {
  display: block;
  width: 100%;
  padding: 8px;
  margin: 6px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  text-transform: uppercase;
}
input::placeholder {
  text-transform: none;
}

.resi-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.resi-row input {
  flex: 1;
}
.resi-row button {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
}

/* ====== TABLE (Scanner & List-data) ====== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

table th,
table td {
  border: 1px solid #ccc;
  padding: 6px;
  text-align: center;
  vertical-align: middle;
}

table th {
  background: #f8f8f8;
  white-space: nowrap;
}

table tr:nth-child(even) {
  background: #fafafa;
}

td b {
  display: block;
  margin: 3px 0;
}

.empty-row td {
  text-align: center;
  font-style: italic;
  color: #666;
}

/* ====== SWEETALERT CUSTOM ====== */
button.swal2-confirm.swal2-styled {
  background: #ffc107 !important;
  color: black !important;
}

/* ====== PHOTO SLIDER ====== */
.photo-slider {
  position: relative;
  overflow: hidden;
  width: 100%;
  touch-action: pan-y;
}
.photo-slider .slides {
  display: flex;
  transition: transform 0.35s ease;
  width: 100%;
}
.photo-slider .slide {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.photo-slider img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}
.photo-slider button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
}
.photo-slider .prev {
  left: 8px;
}
.photo-slider .next {
  right: 8px;
}

/* ====== INSTALL BUTTON (PWA) ====== */
#installBtn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 8px;
  background: #ffde00;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: none;
  font-size: 20px;
  font-weight: bold;
}

div#photoPreview {
  font-size: 15px !important;
  font-weight: bold;
  color: blue !important;
}

/* ====== TAB HEADER ====== */
.tab-header {
    justify-content: center;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid #ddd;
    max-width: 530px;
    margin-left: auto;
    margin-right: auto;
    display: flex
}

.tab-header a {
  flex: 1;
  padding: 12px;
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  color: #000;
  background: #fff;
  transition: 0.2s;
}

.tab-header a.active {
  background: #ffde00;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  .container {
    padding: 12px;
  }
  table {
    font-size: 12px;
  }
  table th,
  table td {
    padding: 4px;
  }
}
