/* ========================================================
   SEGERIN.ES - DESIGN SYSTEM & STYLESHEET
   ======================================================== */

:root {
  --primary: #236b4b;
  --primary-dark: #174a33;
  --primary-light: #eaf3ee;
  --accent: #d8f06a;
  --accent-dark: #20422d;
  --ink: #17221d;
  --muted: #66776e;
  --line: #e2eae3;
  --bg: #f5f8f5;
  --white: #ffffff;
  --danger: #d93829;
  --danger-bg: #fdf2f1;
  --success: #1e7e45;
  --success-bg: #edf8f1;
  --shadow: 0 10px 30px rgba(32, 53, 40, 0.07);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

/* Header Navbar */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-img-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(35, 107, 75, 0.25);
  border: 2px solid var(--accent);
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: var(--primary);
  color: var(--accent);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand span {
  color: var(--primary);
}

.tag {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 1.2px;
}

.status-badge {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge-online {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #bce6cc;
}
.badge-demo {
  background: #fff4d6;
  color: #8a6100;
  border: 1px solid #f2db99;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  background: #e8eee8;
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab {
  flex: 1;
  white-space: nowrap;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.tab.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

/* Grid & Panels */
.grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px;
}

/* Forms */
.field {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin: 14px 0 6px;
  color: #2b3a32;
}

input {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid #d4ded6;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  background: #fafbfa;
  color: var(--ink);
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(35, 107, 75, 0.15);
}

/* Password Input Wrapper with Eye Toggle */
.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrap input {
  width: 100%;
  padding-right: 48px; /* ruang untuk tombol mata */
}

.btn-toggle-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7a8f83;
  border-radius: 8px;
  transition: color 0.15s, background-color 0.15s;
  outline: none;
  user-select: none;
}

.btn-toggle-eye:hover {
  color: var(--primary);
  background-color: rgba(35, 107, 75, 0.08);
}

.btn-toggle-eye svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
  stroke: currentColor;
}

/* Buttons */
button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  padding: 13px 18px;
  font-size: 14px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}
.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
}
.btn-secondary:hover:not(:disabled) {
  background: #dcece2;
}
.btn-accent {
  background: var(--accent);
  color: var(--accent-dark);
}
.btn-accent:hover:not(:disabled) {
  background: #cce559;
}
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f6cfcb;
}
.btn-block {
  width: 100%;
  margin-top: 14px;
}
.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 8px;
}

/* Loyalty Card (Tampilan VIP Glassmorphism & Metallic Sheen) */
.loyalty-card {
  background: linear-gradient(135deg, #0f3523 0%, #1a5638 50%, #24754d 100%);
  color: white;
  border-radius: 22px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(15, 53, 35, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(216, 240, 106, 0.3);
}

/* Efek Pantulan Kilau Logam Emas/Lime Diagonal */
.loyalty-card::before {
  content: "";
  position: absolute;
  inset: -100px;
  background: linear-gradient(115deg, transparent 40%, rgba(216, 240, 106, 0.12) 48%, rgba(255, 255, 255, 0.25) 50%, rgba(216, 240, 106, 0.12) 52%, transparent 60%);
  pointer-events: none;
  animation: metallicGleam 6s infinite ease-in-out;
}

@keyframes metallicGleam {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

.loyalty-card::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 240, 106, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  position: relative;
  z-index: 2;
}

.card-brand {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(216, 240, 106, 0.3);
}

.card-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
}

.card-emblem-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-mascot-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 14px rgba(216, 240, 106, 0.45);
  object-fit: cover;
}

.card-chip {
  width: 38px;
  height: 28px;
  background: linear-gradient(135deg, #d4af37 0%, #fae69e 50%, #aa7c11 100%);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
}
.card-chip::after {
  content: "";
  position: absolute;
  inset: 5px 6px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

/* Tulisan Nama Pelanggan Timbul (Embossed Card Font) */
.card-holder {
  font-size: 22px;
  font-weight: 850;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: #ffffff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9), -1px -1px 1px rgba(255, 255, 255, 0.4), 0 0 10px rgba(216, 240, 106, 0.2);
  position: relative;
  z-index: 2;
  overflow-wrap: anywhere;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #c7e3d2;
  margin-bottom: 18px;
  position: relative;
  z-index: 2;
}

/* Rekap Kasir Harian (Closing Report) */
.closing-report-card {
  background: linear-gradient(135deg, #f7faf7 0%, #edf4ee 100%);
  border: 1.5px solid #c8dece;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 22px;
}

.closing-report-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.closing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .closing-grid {
    grid-template-columns: 1fr;
  }
}

.closing-stat-box {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.closing-stat-num {
  font-size: 24px;
  font-weight: 850;
  color: var(--primary);
  line-height: 1.2;
}

.closing-stat-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}

/* Card Status Box (Pengganti Bulatan Stempel untuk Menjaga Privasi Pelanggan) */
.card-status-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 20px 16px;
  margin: 18px 0;
  text-align: center;
}

.status-badge-active {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(216, 240, 106, 0.2);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 18px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.status-pulse-dot {
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  display: inline-block;
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.status-subtext {
  font-size: 12px;
  color: #c0ded0;
  margin-top: 8px;
  font-weight: 500;
}

/* Stamp Showcase & Progress inside Loyalty Card */
.stamp-showcase-box {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 16px 0;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

.stamp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.stamp-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stamp-counter-badge {
  background: var(--accent);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  letter-spacing: 0.3px;
}

.btn-stamp-privacy {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-stamp-privacy:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Progress Bar */
.stamp-progress-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.stamp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #bbf7d0 100%);
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px rgba(216, 240, 106, 0.6);
}

.stamp-progress-text {
  font-size: 11px;
  color: #d1ecdd;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Stamp Grid */
.stamps-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 10px 0 4px;
}

.stamp-slot {
  aspect-ratio: 1;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 800;
  font-size: 13px;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.stamp-slot.filled {
  border: 2px solid var(--accent);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 12px rgba(216, 240, 106, 0.5);
  transform: scale(1.06);
  animation: stampPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes stampPop {
  0% { transform: scale(0.6) rotate(-15deg); opacity: 0; }
  100% { transform: scale(1.06) rotate(0deg); opacity: 1; }
}

.stamp-img-mark {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.stamp-slot.reward-slot {
  border-color: #ffd768;
  background: rgba(255, 215, 104, 0.1);
  color: #ffd768;
}

.stamp-slot.reward-slot.filled {
  border-color: #ffd768;
  background: #ffd768;
  box-shadow: 0 0 16px rgba(255, 215, 104, 0.7);
}

/* Privacy Mode Masking */
.stamp-privacy-masked .stamps-grid,
.stamp-privacy-masked .stamp-progress-track,
.stamp-privacy-masked .stamp-progress-text {
  display: none !important;
}

.stamp-privacy-masked .stamp-masked-notice {
  display: block !important;
}

.stamp-masked-notice {
  display: none;
  text-align: center;
  padding: 10px 4px;
  font-size: 12px;
  color: #c0ded0;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.reward-pill {
  background: rgba(0, 0, 0, 0.2);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

/* Notices */
.notice {
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-top: 14px;
  line-height: 1.4;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.notice-info {
  background: var(--primary-light);
  color: var(--primary);
}
.notice-success {
  background: var(--success-bg);
  color: var(--success);
  font-weight: 600;
}
.notice-danger {
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
}

/* Member QR Code Container */
.member-qr-box {
  margin-top: 20px;
  padding: 16px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
}

.member-qr-img {
  display: inline-block;
  padding: 8px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.member-qr-img img,
.member-qr-img canvas {
  display: block;
  margin: 0 auto;
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: #fafcfa;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.stat-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 2px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* Admin Table */
.table-container {
  overflow-x: auto;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

th {
  background: #fafbfa;
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

.action-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: white;
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Camera Scanner Container */
#qrReaderContainer {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  margin: 14px 0;
  background: #000;
}

/* History Logs */
.log-list {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.log-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.log-item:last-child {
  border-bottom: none;
}

.hidden {
  display: none !important;
}

footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 40px;
}

/* Responsive Mobile Optimization (Layar Smartphone Support) */
@media (max-width: 480px) {
  body {
    -webkit-text-size-adjust: 100%;
  }

  header {
    padding: 10px 14px;
  }

  .brand {
    font-size: 18px;
  }

  .brand-img-logo {
    width: 38px;
    height: 38px;
  }

  main {
    padding: 12px 10px 40px;
  }

  .loyalty-card {
    padding: 18px 14px;
    border-radius: 18px;
  }

  .card-holder {
    font-size: 18px;
    margin-bottom: 4px;
  }

  .stamp-showcase-box {
    padding: 12px 10px;
    border-radius: 12px;
  }

  .stamps-grid {
    gap: 6px;
  }

  .stamp-slot {
    font-size: 12px;
  }

  .btn-stamp-privacy {
    font-size: 10px;
    padding: 3px 8px;
  }

  .card-meta {
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .member-qr-box {
    padding: 18px 14px;
    border-radius: 16px;
  }

  .panel {
    padding: 18px 14px;
    border-radius: 16px;
  }

  /* Cegah auto-zoom tidak sengaja di browser iPhone/Safari */
  input {
    font-size: 16px;
  }
}

@media print {
  header,
  .tabs,
  .noprint,
  footer,
  button {
    display: none !important;
  }
  body {
    background: white;
  }
  .panel {
    box-shadow: none;
    border: none;
    padding: 0;
  }
}

