/* ====================================================================
   ZALO INTEGRATION & AUTO-GRADING SETTINGS STYLES (AUTOGRADING)
   Tuân thủ chuẩn mực B2B thương mại, hỗ trợ Dark/Light mode & Mobile -> Desktop
   ==================================================================== */

:root {
  --zalo-primary: #0068ff;
  --zalo-primary-hover: #0053cc;
  --zalo-primary-soft: rgba(0, 104, 255, 0.08);
  --zalo-primary-border: rgba(0, 104, 255, 0.25);
  --zalo-success: #10b981;
}

/* --- Quick Toggle in Exam Detail Action Bar --- */
.assessment-autograde-control {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.assessment-autograde-control:hover {
  border-color: var(--zalo-primary-border);
  box-shadow: 0 2px 6px rgba(0, 104, 255, 0.08);
}

.switch-control-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  margin: 0;
  user-select: none;
}

.switch-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary, #475569);
  letter-spacing: -0.01em;
}

.custom-switch-wrap {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.custom-switch-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.custom-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-color, #cbd5e1);
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 999px;
}

.custom-switch-slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.custom-switch-input:checked + .custom-switch-slider {
  background-color: var(--zalo-success, #10b981);
}

.custom-switch-input:checked + .custom-switch-slider::before {
  transform: translateX(14px);
}

.switch-status-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  min-width: 48px;
}

.switch-status-text.active {
  color: var(--zalo-success, #10b981);
}

.btn-outline-zalo {
  color: var(--zalo-primary, #0068ff) !important;
  border-color: var(--zalo-primary-border, #bfdbfe) !important;
  background: var(--zalo-primary-soft, rgba(0, 104, 255, 0.05)) !important;
  font-weight: 700 !important;
}

.btn-outline-zalo:hover {
  background: var(--zalo-primary, #0068ff) !important;
  color: #ffffff !important;
  border-color: var(--zalo-primary, #0068ff) !important;
}

/* --- Modal Layout & Glassmorphic Container --- */
.zalo-modal-container {
  max-width: 680px;
  width: 95%;
  height: min(720px, 92vh);
  min-height: min(600px, 90vh);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card, #ffffff);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);
  border: 1px solid var(--border-color, #e2e8f0);
  overflow: hidden;
  animation: modalScaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.zalo-modal-header {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to right, var(--bg-card, #ffffff), var(--bg-secondary, #f8fafc));
  flex-shrink: 0;
}

.zalo-modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.zalo-brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0068ff 0%, #004ecc 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 104, 255, 0.25);
  flex-shrink: 0;
}

.zalo-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.01em;
}

.zalo-modal-subtitle {
  margin: 0.15rem 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}

/* --- Modal Tabs --- */
.zalo-modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-secondary, #f8fafc);
  padding: 0.3rem 1.4rem 0 1.4rem;
  gap: 0.5rem;
  flex-shrink: 0;
}

.zalo-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
}

.zalo-tab-btn:hover {
  color: var(--text-primary, #0f172a);
}

.zalo-tab-btn.active {
  color: var(--zalo-primary, #0068ff);
  border-bottom-color: var(--zalo-primary, #0068ff);
  background: var(--bg-card, #ffffff);
  border-radius: 8px 8px 0 0;
}

.zalo-modal-body {
  padding: 1.15rem 1.4rem;
  flex: 1 1 auto;
  max-height: calc(94vh - 125px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* --- Disconnected QR Hero Card --- */
.zalo-qr-hero-card {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 1.25rem;
  align-items: center;
  background: var(--bg-secondary, #f8fafc);
  padding: 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--border-color, #e2e8f0);
}

.instruction-heading {
  margin: 0 0 0.65rem 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.instruction-steps {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.825rem;
  line-height: 1.55;
  color: var(--text-secondary, #334155);
}

.instruction-steps li {
  margin-bottom: 0.3rem;
}

.zalo-security-notice {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  background: var(--bg-card, #ffffff);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
}

/* QR Canvas Wrapper */
.zalo-qr-display-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.qr-canvas-wrapper {
  position: relative;
  width: 170px;
  height: 170px;
  background: #ffffff;
  border-radius: 12px;
  padding: 8px;
  border: 2px solid var(--border-color, #e2e8f0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.zalo-qr-svg-target {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zalo-qr-svg-target svg,
.zalo-qr-svg-target img,
.zalo-qr-image {
  width: 100% !important;
  height: 100% !important;
  max-width: 154px;
  max-height: 154px;
  display: block;
  object-fit: contain;
  border-radius: 6px;
}

.qr-placeholder-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  text-align: center;
}

.zalo-qr-expired-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  backdrop-filter: blur(2px);
}

.qr-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  background: var(--bg-card, #ffffff);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-color, #e2e8f0);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--zalo-success, #10b981);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Quick Actions for Zalo QR Saving & Deep Link */
.zalo-qr-actions-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.btn-zalo-save-action {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  color: var(--zalo-primary, #0068ff);
  border: 1.5px solid var(--zalo-primary, #0068ff);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-zalo-save-action:hover:not(:disabled) {
  background: var(--zalo-primary, #0068ff);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 104, 255, 0.2);
}

.btn-zalo-save-action:disabled,
.btn-zalo-save-action.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-zalo-direct-action {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, #0068ff, #0052cc);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 104, 255, 0.3);
}

.btn-zalo-direct-action:hover {
  background: linear-gradient(135deg, #0056d6, #0042a6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 104, 255, 0.4);
}

.btn-zalo-direct-action.pulse-highlight {
  animation: pulseBlueHighlight 1.5s infinite;
}

@keyframes pulseBlueHighlight {
  0% { box-shadow: 0 0 0 0 rgba(0, 104, 255, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(0, 104, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 104, 255, 0); }
}

.btn-link-subtle {
  background: transparent;
  border: none;
  color: #0068ff;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  margin-top: 0.2rem;
  transition: background 0.15s;
}

.btn-link-subtle:hover {
  background: rgba(0, 104, 255, 0.08);
  text-decoration: underline;
}

/* Mobile Step-by-Step Quick Guide Card */
.zalo-mobile-guide-box {
  width: 100%;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  margin-top: 0.4rem;
  text-align: left;
}

.guide-header-compact {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #1e3a8a;
  margin-bottom: 0.45rem;
}

.guide-steps-compact {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: #1e293b;
  line-height: 1.35;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #0068ff;
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* --- Connected View Section --- */
.zalo-connected-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--zalo-primary-soft, rgba(0, 104, 255, 0.08));
  border: 1.5px solid var(--zalo-primary-border, rgba(0, 104, 255, 0.25));
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.25rem;
}

.zalo-profile-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.zalo-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0068ff, #004ecc);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(0, 104, 255, 0.3);
  overflow: hidden;
}

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

.zalo-user-details {
  display: flex;
  flex-direction: column;
}

.zalo-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.zalo-phone-text {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

/* --- Group Picker & Actions --- */
.zalo-group-picker-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 380px;
  position: relative;
}

.card-subtitle {
  margin: 0 0 0.85rem 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.form-group-custom {
  margin-bottom: 0.85rem;
}

.form-label-custom {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary, #334155);
  margin-bottom: 0.35rem;
}

.select-with-refresh {
  display: flex;
  gap: 0.45rem;
}

.form-select-custom, .form-textarea-custom {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  font-size: 0.85rem;
  transition: border-color 0.15s ease;
}

.form-select-custom:focus, .form-textarea-custom:focus {
  outline: none;
  border-color: var(--zalo-primary, #0068ff);
  box-shadow: 0 0 0 3px rgba(0, 104, 255, 0.12);
}

.zalo-exam-context-box {
  margin-top: 1.15rem;
  background: var(--bg-secondary, #f8fafc);
  border: 1px dashed var(--border-color, #cbd5e1);
  border-radius: 10px;
  padding: 1rem;
}

.exam-dispatch-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.zalo-test-box {
  margin-top: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

.zalo-test-hint {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

/* --- TAB 2: Settings Card --- */
.auto-grade-settings-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.setting-item-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.setting-text {
  flex: 1;
}

.setting-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  color: var(--text-primary, #0f172a);
}

.setting-description {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
}

.setting-divider {
  height: 1px;
  background: var(--border-color, #e2e8f0);
}

.override-radios {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.65rem;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary, #334155);
  cursor: pointer;
}

/* Custom Large Toggle Switch for Settings */
.custom-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.custom-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-color, #cbd5e1);
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 999px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.custom-toggle-switch input:checked + .toggle-slider {
  background-color: var(--zalo-primary, #0068ff);
}

.custom-toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.settings-save-footer {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.save-status-msg {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--zalo-success, #10b981);
}

/* --- Modal Footer --- */
.zalo-modal-footer {
  padding: 0.85rem 1.4rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-secondary, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-help-text {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

/* --- Responsive Adaptations (Mobile 320px - 640px) --- */
@media (max-width: 640px) {
  /* Full-bleed overlay: Remove outer padding and centering that shrinks the modal on phones */
  .modal-backdrop#modal-zalo-integration.active,
  .modal-backdrop#modal-exam-zalo-dispatch.active,
  .modal-backdrop#modal-student-zalo-dispatch.active,
  #modal-zalo-integration.modal-backdrop,
  #modal-exam-zalo-dispatch.modal-backdrop,
  #modal-student-zalo-dispatch.modal-backdrop {
    padding: 0 !important;
    margin: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    inset: 0 !important;
  }

  /* Full viewport immersion, zero borders or floating margin */
  .zalo-modal-container,
  .modal-dialog.zalo-modal-container,
  .student-zalo-modal-container,
  .exam-zalo-modal-container {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    animation: none !important;
    box-shadow: none !important;
  }

  .zalo-modal-header {
    padding: 0.75rem 1rem !important;
    flex-shrink: 0 !important;
  }

  .zalo-brand-badge {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }

  .zalo-brand-badge svg {
    width: 18px !important;
    height: 18px !important;
  }

  .zalo-modal-title {
    font-size: 0.95rem !important;
    line-height: 1.25 !important;
  }

  .zalo-modal-subtitle {
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
  }

  /* 2-column grid for tabs on mobile */
  .zalo-modal-tabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.35rem !important;
    padding: 0.35rem 0.65rem 0 0.65rem !important;
    flex-shrink: 0 !important;
  }

  .zalo-tab-btn {
    padding: 0.55rem 0.35rem !important;
    font-size: 0.8rem !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 0.35rem !important;
  }

  .zalo-modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0.85rem 1rem !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .zalo-modal-footer {
    padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom, 16px)) 1rem !important;
    flex-shrink: 0 !important;
  }

  .footer-help-text {
    font-size: 0.72rem !important;
  }

  .zalo-qr-hero-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 1rem;
  }

  .instruction-steps {
    text-align: left;
  }

  .override-radios {
    flex-direction: column;
    gap: 0.45rem;
  }

  .assessment-autograde-control {
    padding: 0.2rem 0.5rem;
  }

  .switch-title {
    font-size: 0.72rem;
  }

  /* --- Zalo Target Picker: Mobile Full-Screen Drawer Experience --- */
  .zalo-target-picker-wrapper.is-open {
    margin-bottom: 0 !important;
  }

  .zalo-picker-trigger {
    min-height: 48px !important;
    padding: 0.65rem 0.85rem !important;
    font-size: 0.92rem !important;
  }

  /* Full Screen Mobile Drawer Overlay */
  .zalo-picker-popover {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 10001 !important;
    flex-direction: column !important;
    background: var(--bg-card, #ffffff) !important;
    animation: zaloDrawerSlideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  @keyframes zaloDrawerSlideUp {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Mobile Drawer Header */
  .zalo-picker-mobile-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.85rem 1rem !important;
    border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
    background: var(--bg-card, #ffffff) !important;
    flex-shrink: 0 !important;
  }

  .zalo-picker-mobile-title-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    min-width: 0 !important;
  }

  .zalo-picker-mobile-icon {
    font-size: 1.15rem !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
  }

  .zalo-picker-mobile-title {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: var(--text-main, #0f172a) !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .zalo-picker-mobile-close-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    background: var(--bg-secondary, #f1f5f9) !important;
    color: var(--text-secondary, #475569) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    touch-action: manipulation !important;
    flex-shrink: 0 !important;
  }

  .zalo-picker-mobile-close-btn:active {
    background: #e2e8f0 !important;
    transform: scale(0.92) !important;
  }

  /* Search Bar */
  .zalo-picker-search-bar {
    padding: 0.75rem 1rem !important;
    flex-shrink: 0 !important;
    background: var(--bg-secondary, #f8fafc) !important;
    border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
  }

  .zalo-picker-search-input {
    font-size: 16px !important; /* CRITICAL: 16px prevents iOS Safari automatic zoom on focus */
    min-height: 38px !important;
  }

  /* Filter Tabs */
  .zalo-picker-tabs {
    padding: 0.5rem 1rem !important;
    flex-shrink: 0 !important;
    gap: 0.45rem !important;
    border-bottom: 1px solid var(--border-color, #f1f5f9) !important;
  }

  .zalo-tab-pill {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.82rem !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  /* List & Items */
  .zalo-picker-list-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0.5rem 0.75rem max(1rem, env(safe-area-inset-bottom, 20px)) 0.75rem !important;
  }

  .zalo-picker-item {
    padding: 0.75rem 0.85rem !important;
    min-height: 58px !important;
    margin-bottom: 0.35rem !important;
    border-radius: 10px !important;
  }

  .zalo-picker-item:active {
    background: var(--bg-hover, #f1f5f9) !important;
    transform: scale(0.985) !important;
  }

  .zalo-item-avatar-wrap,
  .zalo-item-avatar-img,
  .zalo-item-avatar-placeholder {
    width: 44px !important;
    height: 44px !important;
  }

  .zalo-item-avatar-placeholder {
    font-size: 1.05rem !important;
  }

  .zalo-item-name {
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .zalo-item-sub {
    font-size: 0.78rem !important;
    margin-top: 2px !important;
  }

  .zalo-type-tag {
    padding: 0.25rem 0.55rem !important;
    font-size: 0.74rem !important;
  }

  /* Dark mode overrides for drawer on mobile */
  [data-theme="dark"] .zalo-picker-popover {
    background: var(--bg-card, #1e293b) !important;
  }

  [data-theme="dark"] .zalo-picker-mobile-header {
    background: var(--bg-card, #1e293b) !important;
    border-bottom-color: var(--border-color, #334155) !important;
  }

  [data-theme="dark"] .zalo-picker-mobile-title {
    color: var(--text-primary, #f1f5f9) !important;
  }

  [data-theme="dark"] .zalo-picker-mobile-close-btn {
    background: var(--bg-secondary, #334155) !important;
    border-color: var(--border-color, #475569) !important;
    color: var(--text-primary, #f1f5f9) !important;
  }

  [data-theme="dark"] .zalo-picker-mobile-close-btn:active {
    background: #475569 !important;
  }
}

/* --- Unauthenticated Gate Card in Modal --- */
.zalo-unauth-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--bg-card, #ffffff);
  border: 1.5px dashed var(--border-color, #cbd5e1);
  border-radius: 12px;
  max-width: 480px;
  margin: 1.5rem auto;
}

.zalo-unauth-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--zalo-primary-soft, rgba(0, 104, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.zalo-unauth-icon {
  font-size: 1.8rem;
}

.zalo-unauth-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main, #1e293b);
  margin-bottom: 0.5rem;
}

.zalo-unauth-desc {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.zalo-unauth-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .zalo-unauth-card {
    padding: 1.5rem 1rem;
    margin: 0.75rem auto;
  }
  .zalo-unauth-actions {
    flex-direction: column;
    width: 100%;
  }
  .zalo-unauth-actions .btn {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }
}

/* ====================================================================
   ZALO TARGET PICKER (SMART COMBOBOX & REALTIME SEARCH)
   ==================================================================== */
.zalo-target-picker-wrapper {
  position: relative;
  width: 100%;
  font-family: inherit;
  transition: margin-bottom 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.zalo-target-picker-wrapper.is-open {
  margin-bottom: 280px;
}

.zalo-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-color, #cbd5e1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.zalo-picker-trigger:hover {
  border-color: var(--zalo-primary, #0068ff);
}

.zalo-picker-trigger:focus-visible,
.zalo-picker-trigger.active {
  outline: none;
  border-color: var(--zalo-primary, #0068ff);
  box-shadow: 0 0 0 3px rgba(0, 104, 255, 0.15);
}

.zalo-picker-selected-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.zalo-picker-placeholder {
  color: var(--text-muted, #94a3b8);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zalo-selected-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: 100%;
}

.zalo-selected-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.zalo-selected-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zalo-selected-sub {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  flex-shrink: 0;
}

.zalo-picker-trigger-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.zalo-picker-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 0.8rem;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.zalo-picker-clear-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

.zalo-picker-chevron {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  transition: transform 0.2s;
}

.zalo-picker-trigger.active .zalo-picker-chevron {
  transform: rotate(180deg);
}

/* --- Popover Dropdown Panel --- */
.zalo-picker-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  flex-direction: column;
  overflow: hidden;
  animation: zaloPickerFadeIn 0.18s ease-out;
}

@keyframes zaloPickerFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Drawer Header - hidden on desktop */
.zalo-picker-mobile-header {
  display: none;
}

.zalo-picker-search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.zalo-search-icon {
  font-size: 0.95rem;
  color: var(--text-muted, #64748b);
}

.zalo-picker-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  color: var(--text-main, #0f172a);
  outline: none;
  padding: 0;
}

.zalo-picker-search-input::placeholder {
  color: var(--text-muted, #94a3b8);
}

.zalo-picker-search-clear {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
}

.zalo-picker-search-clear:hover {
  color: var(--text-main, #0f172a);
  background: #e2e8f0;
}

/* Tabs Bar */
.zalo-picker-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  background: var(--bg-card, #ffffff);
  border-bottom: 1px solid var(--border-color, #f1f5f9);
  overflow-x: auto;
}

.zalo-tab-pill {
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  color: var(--text-secondary, #475569);
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.zalo-tab-pill:hover {
  background: #f1f5f9;
  color: var(--text-main, #0f172a);
}

.zalo-tab-pill.active {
  background: var(--zalo-primary, #0068ff);
  color: #ffffff;
  border-color: var(--zalo-primary, #0068ff);
  box-shadow: 0 1px 3px rgba(0, 104, 255, 0.25);
}

/* List Items Container */
.zalo-picker-list-container {
  max-height: 350px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.zalo-picker-list {
  padding: 0.35rem;
}

.zalo-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.zalo-picker-item:hover,
.zalo-picker-item.highlighted {
  background: var(--bg-hover, #f1f5f9);
}

.zalo-picker-item.selected {
  background: var(--zalo-primary-soft, rgba(0, 104, 255, 0.08));
}

.zalo-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.zalo-item-avatar-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
}

.zalo-item-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-color, #e2e8f0);
}

.zalo-item-avatar-placeholder {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.zalo-item-avatar-placeholder.bg-group {
  background: linear-gradient(135deg, #0068ff 0%, #3b82f6 100%);
}

.zalo-item-avatar-placeholder.bg-user {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.zalo-item-avatar-placeholder.avatar-palette-0 {
  background: linear-gradient(135deg, #0068ff 0%, #3b82f6 100%);
}

.zalo-item-avatar-placeholder.avatar-palette-1 {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.zalo-item-avatar-placeholder.avatar-palette-2 {
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
}

.zalo-item-avatar-placeholder.avatar-palette-3 {
  background: linear-gradient(135deg, #ea580c 0%, #f59e0b 100%);
}

.zalo-item-avatar-placeholder.avatar-palette-4 {
  background: linear-gradient(135deg, #e11d48 0%, #db2777 100%);
}

.zalo-item-avatar-placeholder.avatar-palette-5 {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
}

.zalo-item-info {
  min-width: 0;
  flex: 1;
}

.zalo-item-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zalo-item-sub {
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zalo-item-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.zalo-type-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  white-space: nowrap;
}

.zalo-type-pill.badge-group {
  background: rgba(0, 104, 255, 0.1);
  color: var(--zalo-primary, #0068ff);
  border: 1px solid rgba(0, 104, 255, 0.2);
}

.zalo-type-pill.badge-user {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.zalo-item-check {
  color: var(--zalo-primary, #0068ff);
  font-weight: 800;
  font-size: 0.95rem;
}

.zalo-picker-match {
  background: #fef08a;
  color: #854d0e;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 800;
}

.zalo-picker-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted, #64748b);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.zalo-picker-empty .empty-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

/* ====================================================================
   LIVE PREVIEW MESSAGE CARD (EXAM & STUDENT REPORTS)
   ==================================================================== */
.zalo-live-preview-box {
  background: #f0f2f5;
  border-radius: 12px;
  padding: 0.85rem;
  border: 1px solid #e4e6eb;
  margin-top: 0.75rem;
}

.zalo-live-preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #65676b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.zalo-bubble-chat {
  background: #ffffff;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-size: 0.84rem;
  line-height: 1.55;
  color: #050505;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  border-left: 3.5px solid var(--zalo-primary, #0068ff);
}

/* ====================================================================
   STUDENT SINGLE ZALO DISPATCH MODAL
   ==================================================================== */
.student-zalo-modal-container {
  max-width: 540px;
}

.student-info-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.student-summary-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.student-summary-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.student-summary-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main, #0f172a);
}

.student-summary-meta {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

.student-summary-score-badge {
  text-align: right;
}

.student-score-num {
  font-size: 1.25rem;
  font-weight: 900;
  color: #059669;
}

.student-score-max {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

.student-smart-suggest-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ecfdf5;
  border: 1px dashed #6ee7b7;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
}

.smart-suggest-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #065f46;
}

.smart-suggest-btn {
  background: #10b981;
  color: white;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.smart-suggest-btn:hover {
  background: #059669;
}

/* Submissions Table Zalo Button */
.btn-zalo-single-student {
  color: var(--zalo-primary, #0068ff) !important;
  border-color: var(--zalo-primary-border, rgba(0, 104, 255, 0.35)) !important;
  background: var(--zalo-primary-soft, rgba(0, 104, 255, 0.06)) !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-zalo-single-student:hover {
  background: var(--zalo-primary, #0068ff) !important;
  color: #ffffff !important;
  border-color: var(--zalo-primary, #0068ff) !important;
}

/* Exam Zalo Dispatch Modal Styles */
.exam-zalo-mode-card {
  display: block;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.exam-zalo-mode-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.exam-zalo-mode-card.active {
  border-color: var(--zalo-primary, #0068ff);
  background: var(--zalo-primary-soft, rgba(0, 104, 255, 0.05));
  box-shadow: 0 0 0 1px var(--zalo-primary, #0068ff);
}

.exam-zalo-student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
  cursor: pointer;
}

.exam-zalo-student-row:hover {
  background: #e2e8f0;
}

.exam-zalo-student-row.selected {
  background: #eff6ff;
}

.exam-zalo-student-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.exam-zalo-student-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.exam-zalo-student-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-zalo-student-score {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.exam-zalo-student-score.score-high {
  background: #dcfce7;
  color: #166534;
}

.exam-zalo-student-score.score-mid {
  background: #fef3c7;
  color: #92400e;
}

.exam-zalo-student-score.score-low {
  background: #fee2e2;
  color: #991b1b;
}

.exam-zalo-student-score.score-pending {
  background: #f1f5f9;
  color: #64748b;
}

@media (max-width: 640px) {
  .exam-zalo-modes-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ====================================================================
   QUICK MOBILE SHARE BAR (SAO CHÉP & MỞ ZALO APP)
   ==================================================================== */
.zalo-mobile-quick-actions {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.zalo-mobile-quick-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
}

.zalo-mobile-quick-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.btn-zalo-quick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 40px;
  touch-action: manipulation;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-zalo-quick:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-zalo-quick:active {
  transform: translateY(0);
}

.btn-zalo-quick .btn-icon {
  font-size: 1rem;
  line-height: 1;
}

.btn-zalo-quick.btn-open-app {
  background: linear-gradient(135deg, #0068ff 0%, #0056d6 100%);
  border-color: #0068ff;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 104, 255, 0.25);
}

.btn-zalo-quick.btn-open-app:hover {
  background: linear-gradient(135deg, #005ce6 0%, #004bbd 100%);
  border-color: #005ce6;
  box-shadow: 0 4px 10px rgba(0, 104, 255, 0.35);
}

.btn-zalo-quick.copied {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3) !important;
}

@media (max-width: 480px) {
  .zalo-mobile-quick-btns {
    grid-template-columns: 1fr;
  }
}

/* --- Compact Mode for Small Height Viewports on Desktop (<= 650px) --- */
@media (max-height: 650px) and (min-width: 641px) {
  .zalo-modal-container {
    height: 98vh !important;
    max-height: 98vh !important;
  }

  .zalo-modal-header {
    padding: 0.5rem 1rem !important;
  }

  .zalo-modal-footer {
    padding: 0.5rem 1rem !important;
  }

  .zalo-modal-tabs {
    padding: 0.2rem 1rem 0 1rem !important;
  }

  .zalo-connected-banner {
    padding: 0.45rem 0.75rem !important;
    margin-bottom: 0.65rem !important;
  }

  .zalo-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
  }

  .zalo-picker-list-container {
    max-height: 220px !important;
  }
}

/* --- Compact Mode for Mobile Landscape (<= 500px height) --- */
@media (max-height: 500px) and (max-width: 640px) {
  .zalo-modal-header {
    padding: 0.4rem 0.85rem !important;
  }

  .zalo-picker-mobile-header {
    padding: 0.45rem 0.85rem !important;
  }

  .zalo-picker-search-bar {
    padding: 0.4rem 0.85rem !important;
  }

  .zalo-picker-tabs {
    padding: 0.3rem 0.85rem !important;
  }
}

