:root {
  --bg: #f5f7fb;
  --card: #fff;
  --muted: #666;
  --accent: #2b6cb0;
  --gap: 14px;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, Arial, sans-serif;
  background: var(--bg);
  color: #222;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
header {
  background: linear-gradient(90deg, #2b6cb0 0%, #2b9be0 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

header h1 {
  margin: 0;
  font-size: 18px;
}

/* ===== MAIN ===== */
main {
  padding: 18px;
  max-width: 1100px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ===== CARD GRID ===== */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 15px;
}

.card {
  width: 150px;
  height: 150px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.card:hover {
  transform: scale(1.05);
}

.card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 6px;
}

.card div {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.3;
  text-transform: uppercase;
  word-break: break-word;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .card {
    width: 150px;
    height: 150px;
    padding: 8px;
  }

  .card div {
    font-size: 0.8em;
  }
}

/* ===== TYPE AREA ===== */
.type-area {
  padding: 10px;
}

.small-muted {
  font-size: 0.9em;
  color: var(--muted);
  margin-bottom: 8px;
}

.type-list {
  display: flex;
  flex-direction: column;
}

.btn-type {
  display: block;
  width: 100%;
  margin: 6px 0;
  padding: 10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-type:hover {
  background: #1e4f8a;
}

/* ===== MENU AREA ===== */
.menu-area {
  padding: 10px;
}

.menu-list {
  display: flex;
  flex-direction: column;
}

.btn-menu {
  display: block;
  width: 100%;
  margin: 6px 0;
  padding: 10px;
  background: #7bac68;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-menu:hover {
  background: #aceeaf;
}

.btn-menu:active {
  transform: scale(0.98);
}

/* ===== DETAIL & CODE ROW ===== */
.menu-item {
  background: var(--card);
  padding: 12px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.detail {
  margin-top: 12px;
  background: var(--card);
  padding: 14px;
  border-radius: 12px;
}

.code-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed #eee;
}

.code-row:last-child {
  border-bottom: none;
}

.code-box {
  min-width: 80px;
  background: #f3f6fb;
  padding: 8px;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
}

.steps {
  margin-top: 8px;
  padding-left: 6px;
  color: var(--muted);
}

a.link-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
}

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

input.search-input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.back {
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}

.btn-header {
  background: #fff;
  color: var(--accent);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  margin-right: 6px;
}

/* ===== FOOTER ===== */
footer {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

#btnLang {
  margin-left: 6px;
}

/* ===== UPDATE BANNER ===== */
.update-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 16px;
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 8px 30px rgba(8,20,40,0.12);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  z-index: 9999;
  font-size: 14px;
}

.update-banner .msg {
  color: #0b1220;
}

.update-banner .actions {
  display: flex;
  gap: 8px;
}

.btn-update {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-dismiss {
  background: #f3f4f6;
  color: #111;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* ===== FLOATING BUTTON ===== */
.fab-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 9999;
}

.fab-btn {
  background-color: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, background-color 0.3s, box-shadow 0.3s;
}

.fab-btn:hover {
  background-color: #1e4a8b;
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.35);
}

/* ===== ERROR CARDS ===== */
.error-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.error-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  padding: 10px;
}

.error-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.25s ease;
  cursor: pointer;
  border: 1px solid #e5e7eb;
}

.error-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

.error-card .kode {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  font-size: 1em;
}

.error-card .desc {
  color: #333;
  font-size: 0.95em;
  white-space: pre-line;
  line-height: 1.5;
  margin-bottom: 6px;
}

.error-card .card-step {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #ddd;
  color: #444;
  font-size: 0.9em;
}

.card-step div {
  white-space: pre-line;
  line-height: 1.6;
  margin-top: 4px;
}
/* 🌙=== DARK MODE OTOMATIS ===*/
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --card: #1e1e1e;
    --muted: #aaa;
    --accent: #4da3ff;
    color-scheme: dark;
  }

  body {
    background: var(--bg);
    color: #f5f5f5;
  }

  header {
    background: linear-gradient(90deg, #1e4a8b 0%, #356fa8 100%);
  }

  .card,
  .menu-item,
  .detail,
  .error-card {
    background: var(--card);
    color: #eee;
    border: 1px solid #333;
  }


  .btn-type,
  .btn-menu,
  .fab-btn,
  .btn-update {
    background: var(--accent);
    color: #fff;
  }

  footer {
    color: #bbb;
  }

  input.search-input,
  #searchInput {
    background: #222;
    border: 1px solid #444;
    color: #ddd;
  }

  .update-banner {
    background: #222;
    color: #eee;
    border: 1px solid #333;
  }

  .btn-dismiss {
    background: #333;
    color: #fff;
  }
}
