/* ========================= */
/* GLOBAL GUARD (jangan kacau desktop) */
/* ========================= */
html, body{
  overflow-x:hidden; /* elak scroll kiri kanan */
}

/* ========================= */
/* LOGIN FIX (center + spacing) */
/* ========================= */
.login-wrapper{
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:40px 16px; /* bagi ruang atas/bawah */
}

.login-box{
  max-width:360px;   /* elak jadi besar */
  width:100%;
  margin:0 auto;
}

/* kawal saiz logo dalam login */
.login-header img,
.login-header .logo{
  max-width:160px;
  height:auto;
  display:block;
  margin:0 auto 10px;
}

/* input & button center + gap */
#pinInput{
  display:block;
  margin:0 auto 12px;
  text-align:center;
}
#loginBtn{
  display:block;
  margin:0 auto;
}

/* ========================= */
/* HEADER FIX (logo tak pecah layout) */
/* ========================= */
.header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  max-width:1000px;
  margin:0 auto;
  padding:10px 12px;
}

/* limit semua image dalam header (kalau ada logo besar) */
.header img{
  max-height:48px;
  width:auto;
}

/* user area kanan rapat kemas */
.header > div{
  display:flex;
  align-items:center;
  gap:10px;
}

/* ========================= */
/* CONTENT CONTAINER */
/* ========================= */
.app-wrapper{
  max-width:1000px;
  margin:0 auto;
  padding:16px;
}

/* ========================= */
/* FORM GRID (desktop kekal 3) */
/* ========================= */
.form-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:15px;
}

/* input jangan overflow */
.input, select{
  width:100%;
  max-width:100%;
}

/* button full row (desktop) */
.full{
  grid-column:span 3;
}

/* ========================= */
/* TABLE (allow horizontal scroll only inside table) */
/* ========================= */
.table-wrapper{
  width:100%;
  overflow-x:auto;
}

/* ========================= */
/* MOBILE ONLY (tak sentuh desktop) */
/* ========================= */
@media(max-width:600px){

  /* form jadi 1 column */
  .form-grid{
    grid-template-columns:1fr !important;
  }

  .full{
    grid-column:span 1 !important;
  }

  /* header stack */
  .header{
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
  }

  /* card full width */
  .card{
    width:100%;
    margin:10px 0;
  }
}

/* ===== CARD BALIKKAN DESIGN ===== */
.card{
  background:white;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:20px;
  margin-top:20px;
  box-shadow:0 5px 15px rgba(0,0,0,0.05);
}

/* ===== INPUT STYLE ===== */
.input, select{
  background:#f9fafb;
  border:1px solid #d1d5db;
  padding:10px;
  border-radius:8px;
  font-size:14px;
}

/* focus effect */
.input:focus, select:focus{
  border-color:#3b82f6;
  outline:none;
  box-shadow:0 0 0 2px rgba(59,130,246,0.15);
}

/* ===== LABEL ===== */
.form-group label{
  font-size:12px;
  font-weight:500;
  margin-bottom:4px;
  color:#374151;
}

/* ===== BUTTON ===== */
.btn-primary{
  background:#3b82f6;
  color:white;
  padding:10px 16px;
  border:none;
  border-radius:8px;
  font-weight:600;
  cursor:pointer;
  transition:0.2s;
}

.btn-primary:hover{
  background:#2563eb;
}

/* ===== TABLE ===== */
.table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
}

.table th{
  text-align:left;
  font-size:12px;
  color:#6b7280;
  border-bottom:1px solid #e5e7eb;
  padding:8px;
}

.table td{
  padding:8px;
  border-bottom:1px solid #f1f5f9;
}

/* ===== DELETE BUTTON ===== */
.delete-btn{
  color:#ef4444;
  cursor:pointer;
  font-weight:500;
}

/* background */
body{
  background:#f1f5f9;
}

/* wrapper center */
.login-wrapper{
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:center;
}

/* login card */
.login-box{
  background:white;
  padding:30px 25px;
  border-radius:16px;
  width:100%;
  max-width:380px;
  text-align:center;

  /* 🔥 premium shadow */
  box-shadow:0 10px 30px rgba(0,0,0,0.08);
}

/* logo */
.login-header img{
  width:140px;
  margin-bottom:10px;
}

/* subtitle */
.login-header p{
  font-size:13px;
  color:#64748b;
  margin-bottom:15px;
}

/* input */
#pinInput{
  width:100%;
  padding:12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  text-align:center;
  margin-bottom:15px;
}

/* focus effect */
#pinInput:focus{
  border-color:#3b82f6;
  outline:none;
  box-shadow:0 0 0 2px rgba(59,130,246,0.2);
}

/* button */
#loginBtn{
  background:#3b82f6;
  color:white;
  padding:10px 20px;
  border:none;
  border-radius:10px;
  font-weight:600;
  cursor:pointer;
}

#loginBtn:hover{
  background:#2563eb;
}

/* ===== TABLE CARD ===== */
.table-wrapper{
  margin-top:10px;
  overflow-x:auto;
  border-radius:10px;
}

/* ===== TABLE ===== */
.table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}

/* header */
.table th{
  text-align:left;
  background:#f8fafc;
  color:#64748b;
  font-size:12px;
  padding:10px;
  border-bottom:1px solid #e5e7eb;
}

/* row */
.table td{
  padding:10px;
  border-bottom:1px solid #f1f5f9;
}

/* hover */
.table tr:hover{
  background:#f9fafb;
}

/* ===== STATUS ===== */
.status-ok{
  color:#16a34a;
  font-weight:600;
}

.status-rosak{
  color:#dc2626;
  font-weight:600;
}

/* ===== ACTION ===== */
.action-btn{
  cursor:pointer;
  margin-right:8px;
  font-size:13px;
}

.action-edit{
  color:#3b82f6;
}

.action-delete{
  color:#ef4444;
}

/* ===== TOAST ===== */
.toast{
  position:fixed;
  top:20px;
  right:20px;
  padding:12px 16px;
  border-radius:10px;
  color:white;
  font-size:14px;
  font-weight:500;
  box-shadow:0 10px 20px rgba(0,0,0,0.1);
  z-index:9999;

  opacity:0;
  transform:translateX(100px);
  transition:0.3s;
}

/* show */
.toast.show{
  opacity:1;
  transform:translateX(0);
}

/* types */
.toast.success{
  background:#16a34a;
}

.toast.error{
  background:#dc2626;
}

.toast.warning{
  background:#f59e0b;
}

.pin-container{
  display:flex;
  justify-content:center;
  gap:10px;
  margin:15px 0;
}

.pin-box{
  width:45px;
  height:50px;
  text-align:center;
  font-size:20px;
  border:1px solid #d1d5db;
  border-radius:10px;
  outline:none;
  transition:0.2s;
}

.pin-box:focus{
  border-color:#3b82f6;
  box-shadow:0 0 0 2px rgba(59,130,246,0.2);
}

/* PRIMARY BUTTON (Save) */
.btn-primary {
  background: linear-gradient(135deg, #4f8cff, #6a5cff);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 600;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(79, 140, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(79, 140, 255, 0.35);
  opacity: 0.95;
}

/* SECONDARY BUTTON (Clear) */
.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}