/* =========================================================
   RESET & BASE
========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #0d1117;
  color: #c9d1d9;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 15px; /* lebih nyaman di HP */
}

/* =========================================================
   APP LAYOUT – FULL RESPONSIVE
========================================================= */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR – Jadi header di HP */
.sidebar {
  width: 100%;
  height: auto;
  min-height: 140px;
  background: #161b22;
  border-right: none;
  border-bottom: 1px solid #30363d;
  padding: 12px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.brand .logo{
  width:60px;
  height:60px;
  background:#58a6ff;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.8rem;
  font-weight:900;
  color:#0d1117;
  box-shadow:0 8px 25px rgba(88,166,255,0.3);
}
.brand h2 {
  font-size: 1.3rem;
}
.meta { font-size: 0.85rem; }

/* Stats jadi horizontal scroll di HP */
.sidebar-content {
  padding: 0 8px 8px;
}
.stats-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.stats-grid::-webkit-scrollbar { height: 6px; }
.stats-grid::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }

.stat-box {
  min-width: 110px;
  padding: 12px 10px;
  border-radius: 12px;
  text-align: center;
  flex-shrink: 0;
}
.stat-box .label { font-size: 0.75rem; }
.stat-box .value { font-size: 1.6rem; height: 36px; }

/* Controls di bawah stats */
.controls {
  padding: 10px 12px 0;
  border-top: 1px solid #30363d;
  flex-direction: row;
  gap: 10px;
}
.controls .btn {
  flex: 1;
  padding: 11px 8px;
  font-size: 0.9rem;
}
/* WATERMARK – Persegi panjang melengkung, menyala */
.watermark {
  position: fixed;
  bottom: 20px;
  right: 20px;                 /* HP: kiri bawah */
  z-index: 999;
  pointer-events: none;
  opacity: 0.7;
  /*filter: drop-shadow(0 0 10px rgba(255,255,255,0.8));*/
}

.watermark img {
  width: 240px;               /* ukuran logo besar */
  height: auto;
  object-fit: contain;
  display: block;
  
  /* Box putih tipis & rapat */
  background: rgba(255, 255, 255, 0.4);  /* putih buram, naikkan opacity biar lebih solid */
  padding: 4px 10px;                    /* <--- DIKECILKAN: padding sangat kecil → box rapat ke logo */
  border-radius: 12px;                  /* <--- DIKECILKAN: melengkung sedang, nggak terlalu bulat */
  
  /* Bayangan halus biar tetap "mengambang" */
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  
  /* Glow putih lembut biar menyala di dark background */
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

/* MAIN CONTENT */
.main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.header {
  padding: 14px 16px;
  font-size: 1.4rem;
  font-weight: 800;
}

/* TABLE – 100% RESPONSIVE (yang paling penting!) */
.table-container {
  flex: 1;
  overflow: auto;
  padding: 8px;
  -webkit-overflow-scrolling: touch; /* smooth scroll di Android */
}

table {
  width: 100%;
  min-width: 620px;        /* turunkan dari 680px */
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

thead th, tbody td {
  padding: 10px 8px;       /* lebih hemat tempat */
  text-align: center;
}
thead th { font-size: 0.8rem; }

/* Kolom yang bisa dikecilkan */
td:nth-child(1), th:nth-child(1) { width: 40px; }   /* NO */
td:nth-child(2), th:nth-child(2) { width: 120px; }  /* WAKTU */
td:nth-child(5), th:nth-child(5) { width: 80px; }   /* STATUS */
td:nth-child(7), th:nth-child(7) { width: 90px; }   /* AKSI */


/* WA link */
.wa-link {
  color: #25d366 !important;
  text-decoration: none;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(37,211,102,0.15);
  border-radius: 8px;
  font-size: 0.95rem;
  height: 38px;
  transition: .25s;
}
.wa-link:hover {
  background: rgba(37,211,102,0.3);
}

/* Button Selesai */
.btn-selesai {
  background: #ef4444;
  color: white;
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  height: 38px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: .25s;
}
.btn-selesai:hover {
  background: #b91c1c;
}

/* PAGINATION */
.pagination {
  padding: 12px;
  gap: 12px;
}
.pagination button {
  padding: 8px 14px;
  font-size: 0.9rem;
}

.pin-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.pin-box {
  background: #111;
  padding: 24px;
  border-radius: 12px;
  width: 280px;
  text-align: center;
  box-shadow: 0 0 40px red;
}

.pin-box input {
  width: 100%;
  padding: 12px;
  font-size: 20px;
  text-align: center;
  margin: 12px 0;
}

.pin-actions button {
  padding: 8px 16px;
  margin: 6px;
}

/* =========================================================
   HP SCREEN
========================================================= */
@media (max-width:639px) {
  .watermark {
    bottom: 5px;
    right: 20px;
  }
  .watermark img {
    width: 100px;
    height: 50px;
    padding: 2px 4px;
    border-radius: 10px;
  }
}

/* =========================================================
   TABLET & LITTLE BIGGER SCREEN
========================================================= */
@media (min-width: 640px) {
  .app { flex-direction: row; }
  .sidebar {
    width: 260px;
    height: 100%;
    border-right: 1px solid #30363d;
    border-bottom: none;
  }
  .stats-grid {
    flex-direction: column;
    overflow-x: visible;
  }
  .stat-box { min-width: auto; }
  .controls { flex-direction: column; }
  table { min-width: 680px; }
  thead th, tbody td { padding: 14px; }
  
  .watermark {
    bottom: 130px;
    left: 16px;
  }
  .watermark img {
    width: 100px;
    height: 50px;
    padding: 2px 4px;
    border-radius: 10px;
  }
}

/* =========================================================
   DESKTOP (tetap cantik)
========================================================= */
@media (min-width: 1024px) {
  .sidebar { width: 280px; }
  .stat-box { padding: 16px; }
  .value { font-size: 1.8rem; }
  .header { font-size: 1.7rem; }
  
  .watermark {
    bottom: 30px;
    left: 30px;              
    opacity: 0.8;
  }
  .watermark img {
    width: 240px;
    height: 120px;
    padding: 16px 32px;
    border-radius: 32px;
  }
  .watermark {
    filter: drop-shadow(0 0 15px rgba(255,255,255,0.9));
  }
}

/* =========================================================
   EMERGENCY SCREEN – FULLSCREEN DI HP
========================================================= */
#emergencyScreen {
  position: fixed;
  inset: 0;
  background: #dc2626;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 9999;
}
#emergencyScreen h1 {
  font-size: clamp(2.5rem, 12vw, 6rem);
  margin: 20px 0;
}
#emergencyScreen button {
  padding: 18px 60px;
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  margin-top: 40px;
}


/* =========================================================
   FIX PAGINATION VISIBILITY DI HP
========================================================= */
@media (max-width: 639px) {
  .main {
    padding-bottom: 60px; /* beri ruang biar table nggak tertutup pagination */
  }
  
  .pagination {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #161b22;           /* sama kayak sidebar biar nyambung */
    border-top: 1px solid #30363d;
    padding: 10px 16px !important; /* sedikit lebih lebar */
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.3); /* optional: bayangan atas biar kelihatan "mengambang" */
  }
  
  .pagination button {
    padding: 10px 20px;
    font-size: 1rem;
    min-width: 44px; /* lebih mudah tap di HP */
  }
  
  #pageInfo {
    font-size: 1rem;
    font-weight: bold;
  }
}