:root {
  --primary-color: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --success-color: #059669;
  --background: #f1f5f9;
  --surface: #ffffff;
  --border-color: #e2e8f0;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: var(--background);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

small {
  font-size: 0.75em;
}
/* Main container */
.main-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* Header */
.header-card {
  position: relative;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.brand-header-group {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-header-text {
  min-width: 0;
  flex: 1;
}

.brand-logo-stage {
  position: relative;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  padding: 5px;
  overflow: hidden;
  border-radius: 12px;
  background: #f0f7ff;
  border: 1px solid #bae0f7;
  box-shadow: 0 3px 10px rgba(16, 96, 152, 0.1);
  transition:
    border-color 0.45s ease,
    box-shadow 0.45s ease,
    background-color 0.45s ease;
}

.brand-logo-stage.is-new-active {
  background: #f5fce9;
  border-color: #c8eb9b;
  box-shadow: 0 4px 12px rgba(82, 184, 42, 0.16);
}

.brand-logo-img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  will-change: transform, opacity, filter;
}

.brand-logo-stage:not(.is-ready) .brand-logo-new {
  opacity: 0;
}

.brand-logo-img.is-idle {
  opacity: 0;
  transform: translateY(34%) scale(0.72) rotate(16deg);
  filter: blur(4px);
  transition: none;
}

.brand-logo-img.is-active {
  opacity: 1;
  transform: translateY(0) scale(1) rotate(0deg);
  filter: blur(0);
  transition:
    transform 0.56s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s ease-out,
    filter 0.46s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-logo-img.is-leaving {
  opacity: 0;
  transform: translateY(-34%) scale(0.72) rotate(-16deg);
  filter: blur(4px);
  transition:
    transform 0.38s cubic-bezier(0.7, 0, 0.84, 0),
    opacity 0.28s ease-in,
    filter 0.34s ease-in;
}

.brand-title {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-dark);
  line-height: 1.25;
}

/* Kinetic typography: PT DUNIA TANI INDONESIA <-> PT MITRA TANI INDONESIA */
.brand-kt-stage {
  position: relative;
  display: inline-grid;
  align-items: center;
  overflow: hidden;
  padding: 0.12em 0 0.22em;
  margin: -0.12em 0 -0.22em;
  perspective: 520px;
}

.brand-kt-phrase {
  grid-area: 1 / 1;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  column-gap: 0.28em;
  row-gap: 0.1em;
  line-height: 1.2;
  transform-style: preserve-3d;
}

.brand-kt-old {
  color: #106098;
  user-select: none;
}

.brand-kt-new {
  color: #37991e;
}

.brand-kt-old .kt-char {
  color: #106098;
  background: linear-gradient(90deg, #106098 0%, #15749c 45%, #2d8e3e 100%);
  background-size: 2000% 100%;
  background-position: var(--char-pos, 0%) 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-kt-new .kt-char {
  color: #37991e;
  background: linear-gradient(90deg, #37991e 0%, #52b82a 42%, #e0821c 100%);
  background-size: 2000% 100%;
  background-position: var(--char-pos, 0%) 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-kt-stage:not(.is-ready) .brand-kt-new {
  opacity: 0;
  pointer-events: none;
}

.brand-kt-stage .kt-word {
  display: inline-flex;
  white-space: nowrap;
}

.brand-kt-stage .kt-char {
  display: inline-block;
  transform-origin: 50% 65%;
  backface-visibility: hidden;
  will-change: transform, opacity, filter;
}

/* Idle: menunggu di bawah mask */
.brand-kt-phrase.is-idle .kt-char {
  opacity: 0;
  transform: translateY(135%) rotateX(-38deg) scale(0.92);
  filter: blur(5px);
  transition: none;
}

/* Active: masuk bergelombang per karakter dengan expo-out easing */
.brand-kt-phrase.is-active .kt-char {
  opacity: 1;
  transform: translateY(0) rotateX(0deg) scale(1);
  filter: blur(0);
  transition:
    transform 0.52s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.38s ease-out,
    filter 0.44s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--char-i, 0) * 20ms);
}

/* Leaving: keluar bergelombang ke atas mask dengan blur gerak */
.brand-kt-phrase.is-leaving .kt-char {
  opacity: 0;
  transform: translateY(-135%) rotateX(38deg) scale(0.94);
  filter: blur(4px);
  transition:
    transform 0.38s cubic-bezier(0.7, 0, 0.84, 0),
    opacity 0.28s ease-in,
    filter 0.34s ease-in;
  transition-delay: calc(var(--char-i, 0) * 16ms);
}

/* Garis aksen kinetik untuk kedua nama PT sesuai warna logo masing-masing */
.brand-kt-accent {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.05em;
  height: 2.5px;
  border-radius: 999px;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: right center;
  transition:
    transform 0.52s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.34s ease;
}

.brand-kt-accent-old {
  background: linear-gradient(90deg, #106098 0%, #309040 100%);
}

.brand-kt-accent-new {
  background: linear-gradient(90deg, #52c42c 0%, #e89030 100%);
}

.brand-kt-accent.is-active {
  opacity: 1;
  transform: scaleX(1);
  transform-origin: left center;
  transition-delay: 0.12s;
}

.brand-kt-accent.is-leaving,
.brand-kt-accent.is-idle {
  opacity: 0;
  transform: scaleX(0);
  transform-origin: right center;
  transition-delay: 0s;
}

.brand-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-soft-primary {
  background: var(--primary-soft);
  color: var(--primary-color);
  border: 1px solid #dbeafe;
  border-radius: 7px;
  font-weight: 600;
}

.badge-counter {
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 500;
}

/* WhatsApp */
.btn-whatsapp-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 9px;
  background: var(--success-color);
  color: white;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none !important;
  transition:
    background 0.2s,
    transform 0.2s;
}

.btn-whatsapp-custom:hover {
  background: #047857;
  color: white;
  transform: translateY(-1px);
}

/* Banner */
.banner-container {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: #fff;
  margin-bottom: 22px;
}

.banner-container img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
}

/* Branch navigation */
.nav-pills-custom {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 14px;
}

.nav-pills-custom .nav-item {
  flex: 1;
  min-width: 0;
}

.nav-pills-custom .nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 10px 16px;
  background: white;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
  transition: all 0.2s ease;
}

.nav-pills-custom .nav-link:hover {
  background: var(--primary-soft);
  color: var(--primary-color);
}

.nav-pills-custom .nav-link.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 3px 8px rgba(30, 64, 175, 0.18);
}

/* Content */
.content-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

/* DataTables */
.dataTables_wrapper {
  width: 100%;
}

.dataTables_wrapper .dataTables_filter {
  float: none;
  text-align: left;
  margin-bottom: 16px;
}

.dataTables_wrapper .dataTables_filter label {
  display: block;
  width: 100%;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.dataTables_wrapper .dataTables_filter input {
  display: block;
  width: 100%;
  height: 44px;
  margin: 8px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.dataTables_wrapper .dataTables_length {
  float: none;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.dataTables_wrapper .dataTables_length select {
  height: 36px;
  padding: 4px 28px 4px 10px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background-color: white;
  font-size: 0.82rem;
}

.table {
  width: 100% !important;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  padding: 13px 14px;
  background: #f8fafc;
  color: #475569;
  border-top: none;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  white-space: nowrap;
  vertical-align: middle;
}

.table tbody td {
  padding: 13px 14px;
  border-top: none;
  border-bottom: 1px solid var(--border-color);
  color: #334155;
  font-size: 0.85rem;
  vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
  background: #fbfcfe;
}

.table tbody tr:hover {
  background: #f1f5f9;
}

/* Responsive details */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
  background-color: var(--primary-color);
}

/* DataTables information and pagination */
.dataTables_wrapper .dataTables_info {
  padding-top: 16px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.dataTables_wrapper .dataTables_paginate {
  padding-top: 12px;
}

.dataTables_wrapper .page-link {
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 7px !important;
  margin: 0 2px;
  color: var(--primary-color);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.dataTables_wrapper .page-item.active .page-link {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Image button */
.btn-lihat-gambar {
  min-width: 38px;
  min-height: 38px;
  border-radius: 8px;
}

/* Modal */
#modalGambar .modal-dialog {
  max-width: 420px;
  margin: 1.5rem auto;
}

#modalGambar .modal-content {
  border: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.15);
}

#modalGambar .modal-header {
  padding: 15px 18px;
  background: white;
  border-bottom: 1px solid var(--border-color);
}

#modalGambar .modal-title {
  font-size: 0.95rem;
}

.zoom-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 9px;
  background: #f8fafc;
}

.zoom-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Mobile */
@media (max-width: 767.98px) {
  body {
    font-size: 13px;
  }

  .main-container {
    padding: 12px 10px 30px;
  }

  .header-card {
    padding: 15px;
    margin-bottom: 14px;
    border-radius: 11px;
  }

  .brand-header-group {
    gap: 10px;
  }

  .brand-logo-stage {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    padding: 4px;
    border-radius: 10px;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .brand-subtitle {
    font-size: 0.77rem;
  }

  .header-card > .d-flex {
    flex-direction: column;
    align-items: stretch !important;
    gap: 14px;
  }

  .header-card .btn-whatsapp-custom {
    width: 100%;
  }

  .banner-container {
    margin-bottom: 15px;
    border-radius: 9px;
  }

  .banner-container img {
    max-height: 145px;
  }

  .nav-pills-custom {
    gap: 7px;
    margin-bottom: 10px;
  }

  .nav-pills-custom .nav-link {
    min-height: 44px;
    padding: 9px 5px;
    font-size: 0.77rem;
    gap: 5px;
  }

  .content-card {
    padding: 12px 10px;
    border-radius: 10px;
  }

  .table thead th,
  .table tbody td {
    padding: 10px 8px;
    font-size: 0.78rem;
  }

  .dataTables_wrapper .dataTables_info {
    float: none;
    text-align: center;
    padding-top: 14px;
  }

  .dataTables_wrapper .dataTables_paginate {
    float: none;
    text-align: center;
    padding-top: 12px;
  }

  .dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0;
  }

  .dataTables_wrapper .dataTables_length {
    margin-bottom: 12px;
  }

  #modalGambar .modal-dialog {
    max-width: calc(100% - 24px);
    margin: 12px auto;
  }
}

/* Very small devices */
@media (max-width: 380px) {
  .brand-logo-stage {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 9px;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .nav-pills-custom .nav-link {
    font-size: 0.71rem;
  }

  .content-card {
    padding: 10px 7px;
  }
}

/* Reduce motion accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .brand-kt-phrase.is-active .kt-char {
    transition-duration: 0.52s, 0.38s, 0.44s !important;
  }

  .brand-kt-phrase.is-leaving .kt-char {
    transition-duration: 0.38s, 0.28s, 0.34s !important;
  }

  .brand-kt-accent {
    transition-duration: 0.52s, 0.34s !important;
  }

  .brand-logo-stage {
    transition-duration: 0.45s, 0.45s, 0.45s !important;
  }

  .brand-logo-img.is-active {
    transition-duration: 0.56s, 0.4s, 0.46s !important;
  }

  .brand-logo-img.is-leaving {
    transition-duration: 0.38s, 0.28s, 0.34s !important;
  }
}

/* =====================================
   DATATABLES CONTROL ALIGNMENT
===================================== */

/* Baris kontrol: length dan search */
.dataTables_wrapper .row:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Kolom jumlah data */
.dataTables_wrapper .row:first-child > div:first-child {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

/* Kolom pencarian */
.dataTables_wrapper .row:first-child > div:last-child {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* Label pencarian */
.dataTables_wrapper .dataTables_filter {
  width: 100%;
  text-align: right !important;
  margin-bottom: 16px;
}

.dataTables_wrapper .dataTables_filter label {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: auto;
  margin: 0;
}

/* Input pencarian */
.dataTables_wrapper .dataTables_filter input {
  display: inline-block;
  width: 225px;
  max-width: 100%;
  margin: 0 0 0 8px;
}

/* Mobile: kontrol tetap rapi */
@media (max-width: 767.98px) {
  .dataTables_wrapper .row:first-child {
    row-gap: 12px;
  }

  .dataTables_wrapper .row:first-child > div:first-child,
  .dataTables_wrapper .row:first-child > div:last-child {
    width: 100%;
    justify-content: flex-start;
  }

  .dataTables_wrapper .dataTables_filter {
    text-align: left !important;
    margin-bottom: 12px;
  }

  .dataTables_wrapper .dataTables_filter label {
    display: flex;
    width: 100%;
  }

  .dataTables_wrapper .dataTables_filter input {
    flex: 1;
    width: 100%;
    min-width: 0;
  }
}

/* Sticky Header - Final Fix */
.header-card.sticky-top {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0;
  z-index: 1020;
}

/* Chatbot */
.chatbot {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1050;
  font-size: 14px;
}

.chatbot-launcher {
  height: 52px;
  min-width: 52px;
  border: 0;
  border-radius: 26px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 10px 24px rgba(30, 64, 175, 0.28);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.chatbot-launcher:hover,
.chatbot-launcher.active {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.chatbot-launcher i {
  font-size: 20px;
}

.chatbot-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}

.chatbot-panel[hidden] {
  display: none;
}

.chatbot-header {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  background: var(--primary-color);
  color: #fff;
}

.chatbot-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 18px;
}

.chatbot-heading {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  line-height: 1.35;
}

.chatbot-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot-heading strong {
  font-size: 0.94rem;
}

.chatbot-ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.chatbot-heading > span {
  margin-top: 2px;
  color: #dbeafe;
  font-size: 0.74rem;
}

.chatbot-heading > span i {
  color: #86efac;
  font-size: 7px;
  margin-right: 4px;
  vertical-align: middle;
}

.chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.chatbot-icon-btn,
.chatbot-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chatbot-icon-btn:hover,
.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.chatbot-icon-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.chatbot-messages {
  height: calc(100% - 128px);
  overflow-y: auto;
  padding: 14px;
  background: #f8fafc;
  scrollbar-width: thin;
}

.chat-message {
  display: flex;
  margin-bottom: 9px;
}

.chat-message-bot {
  justify-content: flex-start;
}

.chat-message-user {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: 82%;
  padding: 9px 11px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-word;
}

.chat-message-bot .chat-bubble {
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
  background: #fff;
  color: var(--text-dark);
}

.chat-message-user .chat-bubble {
  border-bottom-right-radius: 4px;
  background: var(--primary-color);
  color: #fff;
}

.chat-bubble .chat-code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--primary-color);
  font-size: 0.76rem;
  font-weight: 600;
}

.chat-bubble-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border-color);
}

.chat-wa-order-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--success-color);
  color: #fff !important;
  text-decoration: none !important;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.chat-wa-order-btn:hover {
  background: #047857;
  color: #fff !important;
  transform: translateY(-1px);
}

.chat-wa-order-btn i {
  font-size: 1.15rem;
  flex: 0 0 auto;
}

.chat-wa-order-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.chat-wa-order-text strong {
  font-size: 0.76rem;
  font-weight: 700;
}

.chat-wa-order-text small {
  font-size: 0.69rem;
  color: rgba(255, 255, 255, 0.9);
}

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 12px 0;
}

.chat-quick-replies button {
  min-height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 17px;
  padding: 6px 10px;
  background: #fff;
  color: var(--primary-color);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.chat-quick-replies button:hover {
  background: var(--primary-soft);
  border-color: var(--primary-color);
}

.chat-products {
  display: grid;
  gap: 8px;
  margin: 2px 0 10px 0;
}

.chat-product-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.chat-product-card.no-image {
  grid-template-columns: minmax(0, 1fr);
}

.chat-product-thumb {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  overflow: hidden;
  background: #f1f5f9;
  cursor: pointer;
}

.chat-product-thumb img,
.chat-product-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.chat-product-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.chat-product-info strong {
  color: var(--primary-color);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-branch-tag {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-color);
  font-size: 0.66rem;
  font-weight: 700;
}

.chat-product-name {
  overflow: hidden;
  color: #334155;
  font-size: 0.76rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chat-product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}

.chat-product-info small {
  color: var(--success-color);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.chat-product-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chat-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  min-width: 0 !important;
  min-height: 26px !important;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
}

.chat-card-btn:hover {
  background: var(--primary-soft);
  border-color: #bfdbfe;
  color: var(--primary-color);
}

.chat-card-btn-wa {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: var(--success-color);
}

.chat-card-btn-wa:hover {
  background: var(--success-color);
  border-color: var(--success-color);
  color: #fff;
}

.chat-typing .chat-bubble {
  display: flex;
  gap: 4px;
  padding: 12px;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: chatTyping 1s infinite ease-in-out;
}

.chat-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chatTyping {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  30% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.chatbot-form {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border-color);
  padding: 8px 10px;
  background: #fff;
}

.chatbot-form input {
  min-width: 0;
  height: 42px;
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 21px;
  padding: 8px 13px;
  outline: none;
  font-family: inherit;
  font-size: 0.82rem;
}

.chatbot-form input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.08);
}

.chatbot-form button {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 0;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  cursor: pointer;
}

.chatbot-form button:disabled {
  opacity: 0.55;
  cursor: wait;
}

@media (max-width: 767.98px) {
  .chatbot {
    right: 12px;
    bottom: 12px;
  }

  .chatbot-launcher {
    width: 52px;
    padding: 0;
  }

  .chatbot-launcher-label {
    display: none;
  }

  .chatbot-panel {
    right: 0;
    bottom: 62px;
    width: calc(100vw - 24px);
    height: min(520px, calc(100vh - 88px));
  }
}

/* =====================================
   PWA INSTALL BANNER, MODAL & CHAT CARD
===================================== */

.pwa-install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.08);
}

.pwa-install-banner[hidden] {
  display: none;
}

.pwa-install-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.pwa-install-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.14);
}

.pwa-install-copy {
  min-width: 0;
  flex: 1;
}

.pwa-install-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 2px;
}

.pwa-install-title strong {
  color: var(--text-dark);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}

.pwa-install-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--primary-color);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pwa-install-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 15px;
  border: 0;
  border-radius: 9px;
  background: var(--primary-color);
  color: #fff;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.pwa-install-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.pwa-install-dismiss {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.pwa-install-dismiss:hover {
  background: #f1f5f9;
  color: var(--text-dark);
}

/* Chatbot PWA Reminder Card */
.chat-pwa-card {
  margin: 2px 0 12px;
  padding: 10px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.07);
}

.chat-pwa-card[hidden] {
  display: none;
}

.chat-pwa-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 9px;
}

.chat-pwa-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.chat-pwa-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-pwa-text strong {
  color: var(--text-dark);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.chat-pwa-text span {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.chat-pwa-close {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.chat-pwa-close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-dark);
}

.chat-pwa-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: var(--primary-color);
  color: #fff;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chat-pwa-action-btn:hover {
  background: var(--primary-hover);
}

/* Inline Install Action inside AI Chat Bubble */
.chat-pwa-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 11px;
  border: 0;
  border-radius: 9px;
  background: var(--primary-color);
  color: #fff;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.chat-pwa-inline-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.chat-pwa-inline-btn i {
  font-size: 1rem;
  flex: 0 0 auto;
}

/* Modal Panduan Install PWA */
#modalInstallPwa .modal-dialog {
  max-width: 440px;
  margin: 1.5rem auto;
}

#modalInstallPwa .modal-content {
  border: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 38px rgba(15, 23, 42, 0.18);
}

#modalInstallPwa .modal-header {
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
}

.pwa-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pwa-modal-icon {
  border-radius: 7px;
  object-fit: cover;
}

.pwa-modal-intro {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.pwa-guide-box {
  padding: 11px 13px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #f8fafc;
}

.pwa-guide-box.is-highlighted {
  border-color: #93c5fd;
  background: #eff6ff;
}

.pwa-guide-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--text-dark);
  font-size: 0.83rem;
}

.pwa-guide-heading i {
  color: var(--primary-color);
  font-size: 0.95rem;
}

.pwa-guide-steps {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  font-size: 0.8rem;
  line-height: 1.5;
}

.pwa-guide-steps li + li {
  margin-top: 4px;
}

.pwa-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: var(--primary-color);
  font-size: 0.75rem;
}

.pwa-modal-footer-actions {
  margin-top: 12px;
}

.pwa-modal-ok {
  min-height: 40px;
  border-radius: 9px;
  background: var(--primary-color);
  border-color: var(--primary-color);
  font-size: 0.85rem;
  font-weight: 600;
}

.pwa-modal-ok:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

@media (max-width: 767.98px) {
  .pwa-install-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    margin-bottom: 14px;
    border-radius: 10px;
  }

  .pwa-install-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .pwa-install-title strong {
    font-size: 0.86rem;
  }

  .pwa-install-copy p {
    font-size: 0.75rem;
  }

  .pwa-install-actions {
    width: 100%;
  }

  .pwa-install-btn {
    flex: 1;
    min-height: 38px;
    font-size: 0.8rem;
  }

  #modalInstallPwa .modal-dialog {
    max-width: calc(100% - 24px);
    margin: 12px auto;
  }
}
