/* ==========================================================================
   Know Your Pharmacy Officer - Flashy Search Trigger & Modal Styles
   AP Pharmacists Association (APPA)
   ========================================================================== */

/* ── 1. Flashy Trigger Button in Navbar (No stars, clean & flashy) ── */
.kpo-flashy-btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 74px;
  height: 74px;
  min-width: 74px;
  min-height: 74px;
  max-width: 74px;
  max-height: 74px;
  box-sizing: border-box;
  padding: 5px 3px 4px 3px;
  gap: 3px;
  background: linear-gradient(135deg, #ff8f00 0%, #ff3d00 55%, #c2185b 100%);
  color: #ffffff !important;
  border: 2px solid #ffd700;
  border-radius: 12px;
  margin: 0;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  z-index: 250;
  flex-shrink: 0;
  outline: none;
  overflow: hidden;
  box-shadow: 
    0 0 12px rgba(255, 179, 0, 0.7),
    0 4px 14px rgba(216, 27, 96, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  animation: kpoFlashGlow 2.4s ease-in-out infinite alternate;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
  line-height: 1.1;
}

.kpo-flashy-btn:hover,
.kpo-flashy-btn:focus-visible {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.08);
  box-shadow: 
    0 0 20px rgba(255, 215, 0, 0.9),
    0 6px 20px rgba(255, 61, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.kpo-flashy-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Radiant glow animation */
@keyframes kpoFlashGlow {
  0% {
    box-shadow: 
      0 0 10px rgba(255, 179, 0, 0.6),
      0 3px 10px rgba(255, 61, 0, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: #ffd700;
  }
  50% {
    box-shadow: 
      0 0 18px rgba(255, 235, 59, 0.95),
      0 0 28px rgba(255, 61, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: #fff59d;
  }
  100% {
    box-shadow: 
      0 0 12px rgba(255, 179, 0, 0.75),
      0 4px 14px rgba(194, 24, 91, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-color: #ffd700;
  }
}

/* Light Sheen Sweep across button */
.kpo-flashy-btn::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -80%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 20%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0.05) 80%,
    transparent 100%
  );
  transform: rotate(25deg);
  animation: kpoSheen 3.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes kpoSheen {
  0% { left: -90%; opacity: 0; }
  15% { opacity: 1; }
  55% { left: 140%; opacity: 1; }
  56% { opacity: 0; }
  100% { left: 140%; opacity: 0; }
}

/* Circular Search Icon Badge on the button (NO stars) */
.kpo-search-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  background: #fff9c4;
  border-radius: 50%;
  border: 1.5px solid #d97706;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.kpo-search-svg {
  width: 14px;
  height: 14px;
}

/* Text Content within button */
.kpo-btn-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  line-height: 1.1;
}

.kpo-btn-title {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 5px rgba(255, 215, 0, 0.4);
  white-space: normal;
  text-align: center;
  line-height: 1.12;
  text-transform: uppercase;
}

.kpo-btn-subtitle {
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff9c4;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

/* Desktop layout: place strictly between nav-menu and #appa-nav-actions with zero overlap */
/* Desktop layout: position KPO button cleanly next to #appa-nav-actions with zero disturbance to nav-menu */
@media (min-width: 769px) {
  .navbar .container {
    position: relative !important;
  }
  .nav-menu {
    flex: 0 0 auto !important;
    width: max-content !important;
  }
  .kpo-flashy-btn {
    position: absolute !important;
    right: 215px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    z-index: 210 !important;
    width: 74px !important;
    height: 74px !important;
    min-width: 74px !important;
    min-height: 74px !important;
    max-width: 74px !important;
    max-height: 74px !important;
    border-radius: 12px !important;
    padding: 5px 3px 4px 3px !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .kpo-flashy-btn:hover,
  .kpo-flashy-btn:focus-visible {
    transform: translateY(-52%) scale(1.05) !important;
  }
}

@media (min-width: 769px) and (max-width: 1240px) {
  .kpo-flashy-btn {
    right: 195px !important;
    width: 68px !important;
    height: 68px !important;
    min-width: 68px !important;
    min-height: 68px !important;
    max-width: 68px !important;
    max-height: 68px !important;
    padding: 4px 2px 3px 2px !important;
    border-radius: 10px !important;
  }
  .kpo-btn-title {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 5px rgba(255, 215, 0, 0.4);
  white-space: normal;
  text-align: center;
  line-height: 1.12;
  text-transform: uppercase;
}
  .kpo-search-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  background: #fff9c4;
  border-radius: 50%;
  border: 1.5px solid #d97706;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}
  .kpo-search-svg {
    width: 12px !important;
    height: 12px !important;
  }
}

@media (max-width: 768px) {
  .kpo-flashy-btn {
    position: static !important;
    transform: none !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    flex-direction: row !important;
    padding: 4px 10px 4px 6px !important;
    border-radius: 9999px !important;
    margin: 0 4px !important;
    gap: 6px !important;
  }
  .kpo-btn-title {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 5px rgba(255, 215, 0, 0.4);
  white-space: normal;
  text-align: center;
  line-height: 1.12;
  text-transform: uppercase;
}
}

/* ── 2. Modal Overlay & Container ── */
.kpo-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 11, 38, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.kpo-overlay.kpo-open {
  opacity: 1;
  pointer-events: auto;
}

body.kpo-modal-active {
  overflow: hidden !important;
}

.kpo-modal {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  max-width: 900px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.45),
    0 0 0 2px #ffd700,
    0 0 35px rgba(255, 193, 7, 0.3);
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.kpo-overlay.kpo-open .kpo-modal {
  transform: scale(1);
}

/* ── 3. Modal Header ── */
.kpo-modal-header {
  position: relative;
  background: linear-gradient(135deg, #1b0e3b 0%, #2f185e 50%, #1a3875 100%);
  color: #ffffff;
  padding: 1.25rem 1.5rem 1.1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 3px solid #f59e0b;
  flex-shrink: 0;
}

.kpo-header-title-wrap {
  flex: 1;
}

.kpo-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 215, 0, 0.18);
  border: 1px solid rgba(255, 215, 0, 0.5);
  color: #ffd700;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 9999px;
  margin-bottom: 0.4rem;
}

.kpo-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1.2;
}

.kpo-title-ico {
  font-size: 1.35rem;
}

.kpo-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.kpo-close-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 1.6rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.kpo-close-btn:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: #ef4444;
  transform: rotate(90deg);
}

/* ── 4. Search & Filter Controls ── */
.kpo-controls-section {
  background: #f8fafc;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.kpo-search-bar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.kpo-search-bar-icon {
  position: absolute;
  left: 14px;
  font-size: 1.15rem;
  color: #64748b;
  pointer-events: none;
}

.kpo-search-input {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 44px;
  font-size: 1rem;
  font-weight: 500;
  color: #0f172a;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kpo-search-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.kpo-clear-btn {
  position: absolute;
  right: 12px;
  background: #e2e8f0;
  color: #475569;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.kpo-clear-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.kpo-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.kpo-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #475569;
  font-weight: 600;
}

.kpo-select {
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}

.kpo-select:focus {
  border-color: #6366f1;
}

.kpo-results-count {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e40af;
  background: #dbeafe;
  padding: 4px 10px;
  border-radius: 9999px;
  white-space: nowrap;
}

/* ── 5. Password Authentication Bar ── */
.kpo-auth-bar {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.kpo-auth-bar.kpo-auth-success {
  background: #f0fdf4;
  border-bottom-color: #bbf7d0;
}

.kpo-auth-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #78350f;
  flex: 1 1 320px;
}

.kpo-auth-bar.kpo-auth-success .kpo-auth-info {
  color: #166534;
}

.kpo-auth-info code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  font-family: monospace;
  color: #b45309;
}

.kpo-auth-bar.kpo-auth-success .kpo-auth-info code {
  color: #15803d;
}

.kpo-auth-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpo-password-input {
  height: 34px;
  padding: 0 10px;
  font-size: 0.85rem;
  border: 1px solid #d97706;
  border-radius: 7px;
  outline: none;
  width: 170px;
  background: #ffffff;
  transition: all 0.2s ease;
}

.kpo-password-input:focus {
  border-color: #b45309;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
}

.kpo-input-pulse {
  animation: kpoInputShake 0.6s ease-in-out;
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3) !important;
}

@keyframes kpoInputShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.kpo-unlock-btn {
  height: 34px;
  padding: 0 12px;
  background: #d97706;
  color: #ffffff;
  border: none;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.1s ease;
}

.kpo-unlock-btn:hover {
  background: #b45309;
}

.kpo-lock-btn {
  height: 32px;
  padding: 0 12px;
  background: #ffffff;
  color: #15803d;
  border: 1px solid #16a34a;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kpo-lock-btn:hover {
  background: #dcfce7;
}

.kpo-auth-error {
  background: #fef2f2;
  color: #b91c1c;
  border-bottom: 1px solid #fecaca;
  padding: 0.4rem 1.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* ── 6. Results Body ── */
.kpo-results-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  background: #f1f5f9;
  min-height: 240px;
  max-height: 52vh;
  box-sizing: border-box;
}

/* Welcome state */
.kpo-welcome-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #475569;
}

.kpo-welcome-icon {
  font-size: 3rem;
  margin-bottom: 0.6rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
}

.kpo-welcome-state h3 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  color: #1e293b;
  font-weight: 700;
}

.kpo-welcome-state p {
  margin: 0 auto 1.2rem;
  max-width: 520px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #64748b;
}

.kpo-quick-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.kpo-tag-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
}

.kpo-tag-btn {
  background: #ffffff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kpo-tag-btn:hover {
  background: #eff6ff;
  border-color: #60a5fa;
  transform: translateY(-1px);
}

/* No results state */
.kpo-no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
}

.kpo-no-icon {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
}

.kpo-no-results h3 {
  margin: 0 0 0.35rem;
  color: #1e293b;
  font-size: 1.15rem;
}

/* Results Cards Grid */
.kpo-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}

@media (max-width: 600px) {
  .kpo-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Component */
.kpo-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kpo-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.1);
}

.kpo-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.kpo-officer-info {
  flex: 1;
}

.kpo-officer-name {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.kpo-officer-role {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.kpo-role-badge {
  background: #ede9fe;
  color: #5b21b6;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #ddd6fe;
}

.kpo-district-pill {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 9999px;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid #bae6fd;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.kpo-district-pill:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.kpo-pill-arrow {
  font-size: 0.85rem;
}

/* Card details list */
.kpo-card-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.83rem;
  background: #f8fafc;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}

.kpo-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}

.kpo-detail-label {
  color: #64748b;
  font-weight: 600;
  flex-shrink: 0;
}

.kpo-detail-val {
  color: #1e293b;
  font-weight: 600;
  word-break: break-word;
}

.kpo-email-link {
  color: #2563eb;
  text-decoration: none;
  word-break: break-all;
}

.kpo-email-link:hover {
  text-decoration: underline;
}

/* Phone Number Box */
.kpo-card-phone-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 0.4rem;
  border-top: 1px dashed #e2e8f0;
}

.kpo-phone-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpo-phone-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.88rem;
}

.kpo-phone-locked {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
}

.kpo-phone-masked {
  font-family: monospace;
  font-weight: 800;
  letter-spacing: 0.15em;
  font-size: 0.95rem;
  color: #b45309;
}

.kpo-unlock-prompt-btn {
  background: #d97706;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.kpo-unlock-prompt-btn:hover {
  background: #b45309;
}

.kpo-phone-unlocked {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.kpo-phone-val {
  font-weight: 800;
  font-family: monospace;
  font-size: 0.95rem;
  color: #047857;
}

.kpo-phone-call-btn {
  background: #059669;
  color: #ffffff !important;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.kpo-phone-call-btn:hover {
  background: #047857;
}

.kpo-wa-btn {
  background: #25d366;
  color: #ffffff !important;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.kpo-wa-btn:hover {
  background: #128c7e;
}

.kpo-phone-na {
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 0.78rem;
  font-style: italic;
}

.kpo-highlight {
  background: #fef08a;
  color: #854d0e;
  font-weight: 800;
  padding: 0 2px;
  border-radius: 2px;
}

.kpo-more-notice {
  grid-column: 1 / -1;
  text-align: center;
  padding: 0.85rem;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  font-size: 0.85rem;
  color: #475569;
}

/* ── 7. Modal Footer ── */
.kpo-modal-footer {
  background: #ffffff;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #64748b;
}

.kpo-footer-close {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kpo-footer-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ── 8. Responsive Adjustments ── */
@media (max-width: 768px) {
  .kpo-flashy-btn {
    padding: 3px 8px 3px 5px !important;
    margin: 0 4px !important;
  }
  .kpo-search-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  background: #fff9c4;
  border-radius: 50%;
  border: 1.5px solid #d97706;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}
  .kpo-search-svg {
    width: 12px !important;
    height: 12px !important;
  }
  .kpo-btn-title {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 5px rgba(255, 215, 0, 0.4);
  white-space: normal;
  text-align: center;
  line-height: 1.12;
  text-transform: uppercase;
}
  .kpo-btn-subtitle {
    display: none !important;
  }
  .kpo-modal {
    max-height: 96vh;
    border-radius: 14px;
  }
  .kpo-modal-header {
    padding: 1rem;
  }
  .kpo-title {
    font-size: 1.2rem;
  }
  .kpo-controls-section {
    padding: 0.75rem 1rem;
  }
  .kpo-auth-bar {
    padding: 0.6rem 1rem;
  }
  .kpo-results-body {
    padding: 0.75rem 1rem;
  }
}

/* ==========================================================================
   Know Your Pharmacy Officer - Ultra-Compact High-Visibility Modal Styles
   ========================================================================== */
.kpo-overlay {
  padding: 0.75rem !important;
}

.kpo-modal {
  max-width: 760px !important;
  max-height: 88vh !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.4), 0 0 0 2px #ffd700, 0 0 24px rgba(255, 193, 7, 0.22) !important;
}

.kpo-modal-header {
  padding: 0.7rem 1.1rem 0.65rem !important;
  gap: 0.75rem !important;
  align-items: center !important;
  border-bottom: 2.5px solid #f59e0b !important;
}

.kpo-header-badge {
  font-size: 0.60rem !important;
  padding: 1.5px 6px !important;
  margin-bottom: 0.2rem !important;
}

.kpo-title {
  font-size: 1.15rem !important;
  gap: 0.35rem !important;
  line-height: 1.2 !important;
}

.kpo-title-ico {
  font-size: 1.05rem !important;
}

.kpo-subtitle {
  margin: 0.15rem 0 0 !important;
  font-size: 0.76rem !important;
  line-height: 1.3 !important;
}

.kpo-close-btn {
  width: 30px !important;
  height: 30px !important;
  font-size: 1.3rem !important;
}

.kpo-controls-section {
  padding: 0.55rem 1.1rem 0.45rem !important;
  background: #f8fafc !important;
}

.kpo-search-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}

.kpo-search-bar-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  flex: 1 !important;
  margin-bottom: 0 !important;
}

.kpo-search-btn {
  height: 38px !important;
  padding: 0 14px !important;
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  color: #ffffff !important;
  border: 1px solid #1e3a8a !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.3) !important;
  transition: all 0.2s ease !important;
}

.kpo-search-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  box-shadow: 0 4px 10px rgba(30, 64, 175, 0.4) !important;
  transform: translateY(-1px) !important;
}

.kpo-search-btn:active {
  transform: translateY(0) !important;
}

.kpo-search-btn-ico {
  font-size: 0.88rem !important;
}

.kpo-search-bar-icon {
  left: 12px !important;
  font-size: 0.95rem !important;
}

.kpo-search-input {
  height: 38px !important;
  padding: 0 34px 0 36px !important;
  font-size: 0.88rem !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px !important;
}

.kpo-clear-btn {
  right: 10px !important;
  width: 20px !important;
  height: 20px !important;
  font-size: 0.95rem !important;
}

.kpo-results-count-compact {
  font-size: 0.74rem !important;
  margin-top: 0.25rem !important;
  padding-left: 0.15rem !important;
  color: #475569 !important;
}

.kpo-auth-bar {
  padding: 0.32rem 1rem !important;
  justify-content: center !important;
  gap: 0.5rem !important;
}

.kpo-auth-info {
  display: none !important;
}

.kpo-password-input {
  height: 29px !important;
  font-size: 0.78rem !important;
  padding: 0 8px !important;
  width: 210px !important;
  border-radius: 6px !important;
}

.kpo-unlock-btn, .kpo-lock-btn {
  height: 29px !important;
  padding: 0 10px !important;
  font-size: 0.75rem !important;
  border-radius: 6px !important;
}

.kpo-auth-error {
  padding: 0.25rem 1rem !important;
  font-size: 0.74rem !important;
}

.kpo-results-body {
  padding: 0.7rem 1rem !important;
  min-height: 180px !important;
  max-height: 56vh !important;
}

.kpo-welcome-state {
  padding: 1.3rem 0.75rem !important;
}

.kpo-welcome-icon {
  font-size: 2.1rem !important;
  margin-bottom: 0.35rem !important;
}

.kpo-welcome-state h3 {
  font-size: 1.05rem !important;
  margin: 0 0 0.25rem !important;
}

.kpo-welcome-state p {
  font-size: 0.82rem !important;
  margin: 0 auto 0.75rem !important;
  max-width: 480px !important;
  line-height: 1.4 !important;
}

.kpo-quick-tags {
  gap: 5px !important;
}

.kpo-tag-label {
  font-size: 0.74rem !important;
}

.kpo-tag-btn {
  padding: 3px 8px !important;
  font-size: 0.73rem !important;
}

.kpo-no-results {
  padding: 1.8rem 1rem !important;
}

.kpo-no-icon {
  font-size: 2rem !important;
  margin-bottom: 0.35rem !important;
}

.kpo-no-results h3 {
  font-size: 1rem !important;
  margin: 0 0 0.25rem !important;
}

.kpo-cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)) !important;
  gap: 0.65rem !important;
}

.kpo-card {
  padding: 0.75rem 0.85rem !important;
  border-radius: 10px !important;
  gap: 0.5rem !important;
}

.kpo-card-top {
  gap: 0.5rem !important;
}

.kpo-officer-name {
  font-size: 0.95rem !important;
  margin: 0 0 0.15rem !important;
  line-height: 1.25 !important;
}

.kpo-role-badge {
  font-size: 0.68rem !important;
  padding: 1.5px 5px !important;
  border-radius: 4px !important;
}

.kpo-district-pill {
  font-size: 0.70rem !important;
  padding: 2.5px 7px !important;
}

.kpo-card-details {
  padding: 0.45rem 0.6rem !important;
  gap: 0.22rem !important;
  font-size: 0.78rem !important;
  border-radius: 6px !important;
}

.kpo-detail-row {
  gap: 4px !important;
  line-height: 1.35 !important;
}

.kpo-card-phone-section {
  gap: 3px !important;
  padding-top: 0.3rem !important;
}

.kpo-phone-lbl {
  font-size: 0.68rem !important;
}

.kpo-phone-box {
  padding: 4px 8px !important;
  font-size: 0.82rem !important;
  border-radius: 6px !important;
  gap: 0.4rem !important;
}

.kpo-phone-masked, .kpo-phone-val {
  font-size: 0.88rem !important;
}

.kpo-unlock-prompt-btn, .kpo-phone-call-btn, .kpo-wa-btn {
  padding: 2.5px 7px !important;
  font-size: 0.70rem !important;
  border-radius: 5px !important;
}

.kpo-more-notice {
  padding: 0.55rem !important;
  font-size: 0.78rem !important;
  border-radius: 8px !important;
}

.kpo-modal-footer {
  padding: 0.45rem 1.1rem !important;
  font-size: 0.74rem !important;
}

.kpo-footer-close {
  padding: 3.5px 11px !important;
  font-size: 0.76rem !important;
  border-radius: 6px !important;
}

