/* =========================================================================
   IMPORTS & FONTS
========================================================================= */
@import url("https://fonts.googleapis.com/css2?family=Alkatra:wght@400..700&family=Fredoka:wght@300..700&family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap");

/* =========================================================================
   CSS VARIABLES
========================================================================= */
:root {
  /* Colors */
  --bg: #eef3fb;
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 8px rgba(16, 24, 40, 0.09);
  --accent-1: #245cd3;
  --accent-2: #8262d8;
  --muted: #7d7f81;
  --text: #0f172a;
  --white-color: #fff;
  --primary-color: #696cff;
  --dark-btn-color: #194370;
  --card-edge: rgba(12, 18, 60, 0.03);

  /* Status Colors */
  --success: #1ca177;
  --info: #047fb8;
  --warning: #ed9f00;
  --danger: #db1919;
  --whatsapp-green: #075e54;
  --whatsapp-btn-background: #e6f8ed;

  /* Spacing & Sizing */
  --radius: 14px;
  --radius-lg: 18px;
  --radius-sm: 12px;

  /* Typography */
  --para-font-size: 12px;
  --header-font-size: 16px;
  --mini-header-font-size: 14px;
  --label-font-size: 13px;
  --btn-font-size: 12px;
  --font-weight-medium: 500;
}

/* =========================================================================
   RESET & BASE STYLES
========================================================================= */
* {
  box-sizing: border-box;
  font-family: "Fredoka", sans-serif !important;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: linear-gradient(180deg, #f4f7ff 0%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text);
  line-height: 1.45;
}

body.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

/* =========================================================================
   Design Scrollbar
========================================================================= */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  box-shadow: inset 0 0 5px var(--muted);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* =========================================================================
   ACCESSIBILITY & FOCUS STATES
========================================================================= */
:focus {
  outline: 3px solid rgba(37, 99, 235, 0.12);
  outline-offset: 2px;
}

a:focus,
input:focus,
textarea:focus,
label:focus,
select:focus {
  box-shadow: none !important;
  outline: none !important;
}

.sr-only {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* =========================================================================
   GLASS MORPHISM SYSTEM
========================================================================= */
.glass-card,
.glass-section,
.preview-glass,
.dashboard-feature-card,
.chart-container,
.section-title,
.dashboard-section-title {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.glass-card:hover,
.glass-section:hover,
.preview-glass:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(16, 24, 40, 0.09);
}

.glass-section {
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
}

.glass-card {
  padding: 14px;
}

/* =========================================================================
   TYPOGRAPHY
========================================================================= */
.muted {
  color: var(--muted);
  font-size: var(--mini-header-font-size);
}

.section-title,
.dashboard-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: var(--font-weight-medium);
  color: var(--text);
  background: linear-gradient(90deg, var(--glass-bg), var(--glass-border));
  font-size: var(--header-font-size);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: var(--header-font-size);
  font-weight: var(--font-weight-medium);
}

.mini-header-font-size {
  font-size: var(--mini-header-font-size);
  margin-bottom: 0 !important;
}

.label-font-size {
  font-size: 13px;
}

.header-font-size {
  font-size: 18px;
}

.btn-font-size {
  font-size: var(--btn-font-size);
}

strong, b {
  font-weight: var(--font-weight-medium) !important;
}

pre {
  white-space: pre-wrap;
}

/* =========================================================================
   LAYOUT & GRID SYSTEMS
========================================================================= */
.container,
.container-app {
  max-width: 100%;
  margin: 0px auto;
  padding: 18px;
}

.container-app {
  max-width: 1600px;
}

.top-cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(12, 1fr);
  align-items: stretch;
}

.chart-wrapper {
  grid-column: span 8;
  width: 100%;
  max-width: 320px;
}

.metrics-wrapper {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.builder-grid,
.modern-builder {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
}

.flex-wrap-ui {
  display: flex;
  gap: 16px;
  flex-wrap: nowrap;
}

.w-100 {
  width: 100%;
}

.add-btn-width {
  width: 140px !important;
}

.responsive-width {
  width: 50%;
}

.text-danger {
  color: var(--danger) !important;
}

.send-msg-div,
.preview-div {
  width: 50%;
}

/* =========================================================================
   BUTTONS
========================================================================= */
button,
a[role="button"],
.form-check input {
  cursor: pointer;
}

button {
  border: none;
}

.btn-primary,
.primary-btn {
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--accent-1),
    var(--accent-2)
  ) !important;
  color: var(--white-color) !important;
  padding: clamp(12px, 1.2vw, 14px) clamp(14px, 2vw, 24px);
  border-radius: 5px !important;
  border: none !important;
  cursor: pointer;
  font-weight: 400;
  font-size: var(--para-font-size) !important;
  transition: transform 0.12s ease, opacity 0.12s ease;
  text-align: center;
}

.btn-primary.active,
.primary-btn.active {
  background: linear-gradient(135deg, #1e3cff, #3f6cff) !important;
  cursor: default;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #dddddd;
  padding: 3px 8px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}

.btn-ghost:hover {
  background: linear-gradient(
    90deg,
    var(--accent-1),
    var(--accent-2)
  ) !important;
  color: var(--white-color);
}

.btn-delete {
  background: var(--danger);
  color: var(--white-color);
  border: 1px solid rgba(12, 18, 60, 0.06);
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
  text-align: center;
}

.dark-btn {
  display: inline-block;
  color: var(--white-color) !important;
  background-color: var(--dark-btn-color) !important;
  border-color: var(--dark-btn-color);
  box-shadow: 0 0.125rem 0.25rem rgba(35, 52, 70, 0.4);
  cursor: pointer;
  font-size: var(--para-font-size) !important;
  padding: clamp(12px, 1.2vw, 14px) clamp(14px, 2vw, 24px);
  border-radius: 5px !important;
  text-align: center !important;
}

.btn-danger {
  background-color: var(--danger) !important;
  border: none !important;
  color: var(--white-color) !important;
  text-align: center;
}

.bg-danger {
  background-color: var(--danger) !important;
}

.delete-btn {
  padding: clamp(12px, 1.2vw, 14px) clamp(14px, 2vw, 24px);
}

.btn-warning {
  background-color: var(--warning) !important;
  border: none !important;
  color: var(--white-color) !important;
  text-align: center;
  padding: clamp(12px, 1.2vw, 14px) clamp(14px, 2vw, 24px);
}

.btn-success {
  background-color: var(--success) !important;
  border: none !important;
  color: var(--white-color) !important;
  text-align: center;
}

.btn-info,
.bg-info {
  background-color: var(--info) !important;
  border: none !important;
  color: var(--white-color) !important;
  text-align: center;
}

.btn-danger:hover,
.btn-warning:hover,
.btn-success:hover,
.btn-info:hover,
.btn-delete:hover,
.dark-btn:hover,
.btn-primary:hover,
.primary-btn:hover,
.btn-ghost:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.3s ease !important;
  opacity: 0.8 !important;
}

.btn-link {
  font-size: 14px;
  color: var(--primary-color);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.btn-link:hover {
  text-decoration: none;
}

.download-btn,
.insights-btn {
  min-width: 140px;
  font-weight: var(--font-weight-medium);
  border-radius: 0.25rem;
}

.insights-btn {
  min-width: 120px;
  margin-top: 0.25rem;
}

.attach-btn {
  background: #f8f9fa;
  color: var(--muted);
  border: 2px solid #e1e8ed;
}

.attach-btn:hover {
  background: #e9ecef;
  color: #333;
}

.copy-btn {
  background: var(--primary-color);
  border: none;
  color: var(--white-color);
  padding: 8px 14px;
  border-radius: 8px;
}

.btn-group {
  gap: 10px !important;
}

.refresh-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  color: var(--white-color);
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}

.refresh-btn i {
  font-size: 20px;
  transition: transform 0.2s linear;
}

.refresh-btn.spinning i {
  animation: rotateRefreshReverse 1s linear infinite;
}

.reply-button {
  background: var(--muted);
  color: var(--white-color) !important;
  border: none;
  padding: 10px 10px;
  border-radius: 6px;
  font-size: 13px;
}

.reply-button:hover {
  background: #374151;
}

.reply-button-modern {
  background: var(--white-color);
  border: 1px solid #cfd8dc;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.reply-button-modern:hover {
  background: #f1f8e9;
  border-color: var(--success);
}

[disabled],
:disabled,
.disabled,
[aria-disabled="true"] {
  cursor: not-allowed !important;
  opacity: 0.7 !important;
  pointer-events: auto !important;
}

button[disabled]:hover,
.disabled:hover,
[aria-disabled="true"]:hover {
  box-shadow: none;
  transform: none;
  opacity: 0.7 !important;
}

/* =========================================================================
   CARDS & CONTAINERS
========================================================================= */
.metric,
.metric-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--glass-bg), var(--glass-border));
}

.metric .left,
.metric-card .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric .icon,
.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--white-color);
  box-shadow: 0 6px 18px rgba(44, 62, 170, 0.18);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

.metric .label {
  color: var(--muted);
  font-size: 14px;
}

.metric .value,
.metric-badge {
  font-weight: var(--font-weight-medium);
  background: var(--white-color);
  padding: 6px 12px;
  border-radius: 10px;
  min-width: 48px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(12, 18, 60, 0.06);
}

.feature-card {
  background: var(--white-color);
  border-radius: 16px;
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.feature-card p {
  flex-grow: 1;
  font-size: var(--para-font-size);
  margin-bottom: 0 !important;
}

.feature-card img {
  width: 100%;
  max-height: 350px;
  object-fit: contain;
  border-radius: var(--radius);
}

.feature-card .actions {
  display: flex;
  gap: 10px;
}

.feature-card .actions .primary-btn {
  flex: 1 !important;
  justify-content: center !important;
}

.chart-container {
  border-radius: 22px;
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  height: 360px;
  display: flex;
  align-items: stretch;
}

.chart-container-modern {
  background: var(--glass-border);
  border-radius: 16px;
  padding: 15px;
  height: 350px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.maincards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 20px;
}

.stats-card {
  display: flex;
  align-items: center;
  gap: 18px;
  border-radius: var(--radius);
  transition: transform 0.2s ease;
}

.stats-card:hover {
  transform: translateX(5px);
}

.stats-icon {
  width: 45px;
  height: 45px;
  border-radius: var(--radius);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 26px;
  color: var(--white-color);
}

.stats-icon.success {
  background: var(--success);
}

.stats-icon.info {
  background: var(--info);
}

.stats-icon.warning {
  background: var(--warning) !important;
}

.text-warning {
  color: var(--warning) !important;
}

.stats-icon.dark {
  background: var(--text);
}

.stats-info span {
  font-size: var(--para-font-size);
  color: var(--muted);
}

.stats-info h3 {
  margin: 0;
  font-weight: var(--font-weight-medium);
  font-size: var(--header-font-size);
}

.message-container {
  background: var(--white-color);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  position: relative;
  border: 1px solid #eee;
}

.content-item {
  background: var(--white-color);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #e6e9ef;
  margin-bottom: 12px;
}

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

.carousel-card {
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 8px;
  background: var(--white-color);
  margin-bottom: 12px;
}

.schedule-card {
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  background: linear-gradient(145deg, var(--glass-bg), var(--glass-border));
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.schedule-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.15);
}

.qr-card {
  backdrop-filter: blur(12px);
  background: linear-gradient(135deg, var(--glass-bg), var(--glass-border));
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.qr-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
}

.ticket-card {
  background: var(--white-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.summary-card {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  background: var(--white-color);
}

.summary-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--white-color);
  border-radius: var(--radius-sm) 12px 0 0;
}

.summary-card .col-md-2 {
  display: flex;
}

.card-title {
  background: linear-gradient(135deg, var(--info), #0053cc);
  color: var(--white-color);
  padding: 12px;
  border-radius: 10px;
  text-align: center;
  font-weight: var(--font-weight-medium);
}

/* =========================================================================
   TEMPLATES
========================================================================= */
.templates-area {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.templates-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.templates-top > .section-title.glass-card {
  justify-content: space-between;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  width: 100%;
  max-width: 100%;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  align-items: stretch;
}

.template-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.08);
}

.template-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 5px 0px;
  background: linear-gradient(90deg, var(--glass-bg), var(--glass-border));
  border-bottom: 1px solid var(--card-edge);
  flex-wrap: nowrap;
  width: 100%;
}

.template-title {
  font-weight: var(--font-weight-medium);
  color: var(--text);
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  font-size: var(--mini-header-font-size);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.template-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.template-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  background: linear-gradient(180deg, var(--glass-bg), var(--glass-border));
  justify-content: space-between;
}

.template-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
}

.template-footer .muted {
  font-size: var(--para-font-size);
}

.template-bubble {
  width: 100%;
  border-radius: var(--radius-sm);
  padding: 10px;
  color: #000;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  font-size: var(--mini-header-font-size);
  text-align: justify;
  background: var(--whatsapp-btn-background);
}

/* =========================================================================
   BADGES & STATUS
========================================================================= */
.badge {
  padding: 10px 10px;
  border-radius: 0.25rem;
  font-weight: var(--font-weight-medium);
  font-size: 11px;
  text-transform: capitalize;
  cursor: default;
}

.badge.success {
  background: var(--whatsapp-btn-background);
  color: var(--success);
}

.badge.warn {
  background: var(--warning);
  color: var(--white-color);
}

.badge.danger {
  background: #ffebe9;
  color: var(--danger);
}

.preview-chip {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  color: var(--white-color);
  cursor: default;
}

.status-chip {
  background: var(--success);
}

.media-chip {
  background: var(--info);
}

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  cursor: default;
}

.status-answered {
  background-color: var(--white-color);
  color: var(--whatsapp-green);
}

.status-open {
  background-color: #d1ecf1;
  color: var(--success);
}

.status-closed {
  background-color: #ff9999cc;
  color: var(--danger);
}

.status-pending {
  background: var(--warning);
  color: var(--muted);
}

.status-success {
  background: var(--success);
  color: var(--white-color);
}

.status-failed {
  background: var(--danger);
  color: var(--white-color);
}

.schedule-status {
  font-size: 12px;
  padding: 6px 12px;
  letter-spacing: 0.4px;
  cursor: default;
}

.count-badge {
  font-size: 0.7rem;
  background: var(--muted);
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
  color: var(--white-color);
}

/* =========================================================================
   FORMS & INPUTS
========================================================================= */
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 5px !important;
  border: 1px solid #d6d9e0;
  background: var(--white-color);
  font-size: var(--mini-header-font-size) !important;
  color: var(--text);
}

#headerVarInput,
#variable-inputs-container div[data-var-id] {
  gap: 5px !important;
}

.form-check input {
  width: 18px;
  height: 18px;
}

select,
option {
  cursor: pointer;
}

*::placeholder {
  color: #9aa3b2;
  opacity: 1;
}

.search-box {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 240px;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 10px;
}

.search-box:has(.form-control:focus) {
  border: none;
}

.search-box input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px !important;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: var(--glass-bg);
}

.search-box button {
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--accent-1);
  cursor: pointer;
}

.checkbox-group,
.checkbox-group-preview {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 6px 0;
}

.option-item {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.option-item input {
  flex: 1;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.error {
  border-color: var(--danger) !important;
}

.error-message {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

.errorlist {
  list-style: none;
  padding: 10px;
  background: var(--danger);
  border-radius: 5px;
  color: #fff;
  font-size: var(--mini-header-font-size);
}

label.form-check-label,
label[for="id_username_or_email"],
label[for="id_password"],
label[for="add_91"],
label.mini-header-font-size {
  font-size: var(--mini-header-font-size) !important;
  font-weight: var(--font-weight-medium);
  color: #0f172a;
}

.preview-form-group {
  background: var(--white-color);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.preview-form-group input,
.preview-form-group textarea,
.preview-form-group select {
  border-radius: 8px;
  border: 1px solid #d0d7e2;
  background: #f9fbff;
}

.radio-group {
  padding: 6px 0;
}

.file-input,
.visually-hidden-file {
  display: none;
  position: absolute !important;
  opacity: 0 !important;
  width: 0;
  height: 0;
  pointer-events: none;
}

.password-toggle-btn {
  position: absolute;
  top: 10px;
  right: 10px;
}
.change-password-btn {
  width: 150px;
  text-align: center;
}

#passwordForm {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 0.4s ease, opacity 0.3s ease, transform 0.3s ease;
}

/* Active state */
#passwordForm.show {
  max-height: 600px; /* enough to cover form height */
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================================
   MEDIA & PREVIEWS
========================================================================= */
img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

canvas {
  height: 100% !important;
  width: 100% !important;
}

video {
  width: 250px;
  height: 150px;
  border-radius: 5px;
}

audio {
  width: 250px;
  height: 50px;
  margin-left: 15px;
}

.media-preview {
  height: 8rem;
  border-radius: var(--radius-sm);
  display: flex;
  overflow: hidden;
  background: #e9eef1;
  border: 1px solid var(--card-edge);
  width: 100%;
  align-items: center;
  flex-direction: column;
  justify-content: center;
}

.media-preview-text {
  padding: 8px;
  text-align: center;
  color: var(--muted);
  font-size: var(--mini-header-font-size);
}

.media-prev-doc-icon {
  font-size: 35px;
  color: var(--accent-1);
  width: 100%;
  margin: auto;
  display: flex;
  justify-content: center;
}

.media-preview img,
.media-preview video {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}


.media-box {
  width: 92%;
  height: 120px;
  margin: 10px auto;
  background: var(--white-color);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.media-icon {
  width: 80px;
  height: 80px;
  margin: 10px auto;
}

.custom-image img {
  max-width: 20% !important;
  display: block;
}

.logo-img-container img {
  text-align: center;
  margin: auto;
}

.preview-box {
  background: #f7fbff;
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid #dfe9f3;
  max-height: 653px;
  overflow-y: auto;
}

.preview-content {
  background: #f9fbfc;
  border-radius: 10px;
  padding: 14px;
  min-height: 300px;
}

/* =========================================================================
   WHATSAPP PREVIEW STYLES
========================================================================= */
.phone-frame {
  width: 350px;
  height: 600px;
  margin: auto;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  background-color: #333;
  background-image: url("/static/assets/img/backgrounds/whatsappbg.png");
  background-size: cover;
  border: 2px solid var(--glass-border);
}

.phone-header {
  width: 100%;
  padding: 16px;
  background: var(--whatsapp-green);
  color: var(--white-color);
  font-weight: var(--font-weight-medium);
  position: absolute;
  top: 0;
  z-index: 99;
}

.phone-inner {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px;
  display: block;
  background: transparent;
}

.footer-buttons {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px;
  background: var(--glass-bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: var(--radius) 14px 0 0;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.1);
}

.footer-buttons i {
  font-size: var(--header-font-size);
  color: var(--accent-1);
}

.wa-frame {
  width: 360px;
  margin: auto;
  background: #e5ddd5;
  background-size: cover;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
  padding-bottom: 30px;
}

.wa-header-text {
  display: inline-block;
  max-width: 100%;
  font-weight: var(--font-weight-medium);
  font-size: var(--mini-header-font-size);
  word-wrap: break-word;
}

.wa-media {
  width: 100%;
  background: var(--white-color);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.wa-media-img {
  width: 100%;
  display: block;
  border-radius: 5px;
}

.wa-media-video {
  width: 100%;
  border-radius: 10px;
}

.wa-doc {
  background: var(--white-color);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 12px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  font-size: 50px;
}

.wa-audio {
  background: var(--white-color);
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.wa-buttons,
.wa-buttons-modern {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wa-buttons-modern {
  border-top: 1px solid #eee;
  padding-top: 6px;
}

.wa-btn,
.wa-qr-btn {
  padding: 8px;
  border-radius: 8px;
  font-weight: var(--font-weight-medium);
  text-align: center;
  cursor: default;
  transition: background 0.2s;
  background: var(--whatsapp-btn-background);
  color: var(--success);
  word-wrap: break-word;
  font-size: var(--para-font-size);
}

.wa-qr-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.wa-topbar-modern {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--whatsapp-green);
  color: var(--white-color);
  padding: 14px 18px;
  font-size: var(--mini-header-font-size);
  font-weight: bold;
}

.wa-avatar {
  width: 36px;
  height: 36px;
  background: var(--success);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: var(--font-weight-medium);
}

.wa-title {
  font-size: 14px;
  font-weight: var(--font-weight-medium);
}

.wa-subtitle {
  font-size: 11px;
  opacity: 0.9;
  font-weight: var(--font-weight-medium);
}

.wa-body-modern {
  min-height: 400px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  max-height: 455px;
  overflow: auto;
}

.template-meta {
  word-wrap: break-word;
}

.wa-bubble-modern {
  background: var(--white-color);
  padding: 7px;
  border-radius: 10px;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  margin-bottom: 5px;
  font-size: var(--mini-header-font-size);
  display: inline-block;
  word-wrap: break-word;
}

.wa-message-bubble {
  background: var(--white-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wa-bubble-body {
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.wa-footer {
  font-size: 12px;
  color: var(--muted);
}

.modern-preview {
  border-radius: 16px;
  padding: 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  z-index: 99 !important;
}

.preview-header,
.panel-header,
.chat-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: var(--font-weight-medium);
  margin-bottom: 10px;
}

.preview-header span,
.panel-header span {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: center;
}

.preview-row-modern {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.preview-card {
  min-width: 250px;
  max-width: 220px;
  background: var(--white-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.preview-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.preview-card-body {
  padding: 10px;
  font-size: 13px;
  word-wrap: break-word;
}

.preview-button {
  background: var(--whatsapp-btn-background);
  color: var(--success) !important;
  padding: 8px;
  border-radius: 8px;
  font-weight: var(--font-weight-medium);
  text-align: center;
  cursor: default;
  transition: background 0.2s;
  margin-top: 5px;
  font-size: var(--para-font-size);
}

.preview-button a {
  text-decoration: none;
  font-size: var(--para-font-size);
}

.preview-card.single {
  width: 100%;
  max-width: 100%;
}

.preview-card.multi {
  min-width: 190px;
  max-width: 220px;
}

.preview-panel {
  background: linear-gradient(180deg, #f8f9fb, var(--white-color));
  overflow: hidden;
  word-wrap: break-word;
  width: 50%;
}

.modern-preview-content {
  background: #f3f6fb;
  border-radius: var(--radius-sm);
  padding: 18px;
  min-height: 460px;
  overflow-y: auto;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

.modern-preview-content h1 {
  font-size: 1.8rem;
  font-weight: var(--font-weight-medium);
  margin-bottom: 1.5rem;
  text-align: center;
}

.modern-preview-content h3 {
  font-size: 1.25rem;
  font-weight: var(--font-weight-medium);
}

.modern-preview-content p {
  font-size: 0.95rem;
  line-height: 1.6;
}

.editor-panel {
  min-height: 480px;
  width: 50%;
}

.editor-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-preview {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.empty-preview .empty-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

/* =========================================================================
   CHAT & MESSAGING
========================================================================= */
.chat-container-modern {
  background: var(--white-color);
  border-radius: var(--radius);
  padding: 12px;
  max-height: 520px;
  overflow-y: auto;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

.chat-bubble {
  position: relative;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.user-bubble {
  align-self: flex-start;
  background: var(--white-color);
  border-radius: 0 10px 10px 10px;
}

.bot-bubble {
  align-self: flex-end;
  background: #dcf8c6;
  border-radius: 10px 0 10px 10px;
}

.bubble-label {
  display: block;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--muted);
  margin-bottom: 4px;
}

.bot-label {
  color: var(--success);
}

.user-message {
  background: #d6e2f9;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-weight: var(--font-weight-medium);
}

.bot-message {
  background: #e3e3e3;
  padding: 10px;
  border-radius: 8px;
}

.user-int-message {
  max-width: 70%;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
}

.message-messages {
  background: var(--white-color);
  border: 1px solid #e5e7eb;
  align-self: flex-start;
}

.message-df {
  background: var(--primary-color);
  color: var(--white-color);
  align-self: flex-end;
}

.messages-container {
  background: #f9fafb;
  border-radius: var(--radius-sm);
}

.button-container {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.delete-button,
.bot-delete-button {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  z-index: 999;
}

.bot-delete-button {
  top: 10px;
  right: 20px;
}

.message-container:hover .delete-button,
.message-container:hover .bot-delete-button {
  display: block;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8f9fa;
}

.message {
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
}

.message.user {
  justify-content: flex-end;
}

.message.admin {
  justify-content: flex-start;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white-color);
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
}

.avatar-user {
  background: var(--primary-color);
}

.avatar-admin {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  color: var(--muted);
}

.message-content {
  max-width: 70%;
  margin: 0 15px;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  position: relative;
  word-wrap: break-word;
  font-size: 14px
}

.message.user .message-bubble {
  background: var(--primary-color);
  color: var(--white-color);
  border-bottom-right-radius: 5px;
}

.message.admin .message-bubble {
  background: var(--white-color);
  color: var(--muted);
  border: 1px solid #e1e8ed;
  border-bottom-left-radius: 5px;
  
}

.message-time {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 5px;
}

.message.user .message-time {
  text-align: right;
}

.message-attachment {
  margin-top: 10px;
}

.attachment-item {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  background: var(--glass-bg);
  border-radius: 8px;
  margin-right: 10px;
  margin-bottom: 5px;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
}

.message.admin .attachment-item {
  background: #f8f9fa;
  color: #333;
}

.attachment-item i {
  margin-right: 8px;
}

.chat-input,
.chat-input-form {
  padding: 5px;
  background: var(--white-color);
  border-top: 1px solid #e1e8ed;
  position: sticky;
  bottom: 0;
}

.chat-input-form {
  padding-top: 10px;
}

.input-container {
  display: flex;
  align-items: flex-end;
  gap: 15px;
  max-width: 100%;
}

.message-input {
  flex: 1;
  min-height: 50px;
  max-height: 150px;
  padding: 15px 20px;
  border: 2px solid #e1e8ed;
  border-radius: 25px;
  font-size: 16px;
  resize: none;
  outline: none;
  font-family: "Fredoka", sans-serif !important;
}

.message-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-actions {
  display: flex;
  gap: 10px;
}

.upload-container {
  position: relative;
}

.upload-container input {
  display: none;
}

.icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f4f6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-wrapper:hover {
  background: #e0e7ff;
}

.typing-indicator {
  display: none;
  padding: 15px 20px;
  font-style: italic;
  color: var(--muted);
  font-size: 14px;
}

.typing-dots {
  display: inline-block;
  position: relative;
  width: 20px;
  height: 4px;
}

.typing-dots::before,
.typing-dots::after,
.typing-dots {
  background: #999;
  border-radius: 50%;
  width: 4px;
  height: 4px;
  animation: typing 1.4s infinite ease-in-out;
  animation-fill-mode: both;
}

.typing-dots::before,
.typing-dots::after {
  content: "";
  position: absolute;
  top: 0;
}

.typing-dots::before {
  left: -8px;
  animation-delay: -0.32s;
}

.typing-dots::after {
  left: 8px;
  animation-delay: -0.16s;
}

.connection-status {
  padding: 10px 20px;
  text-align: center;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
}

.status-connected {
  background: var(--success);
  color: var(--success);
}

.status-disconnected {
  background: var(--danger);
  color: var(--danger);
}

.file-preview {
  margin-top: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  display: none;
}

.file-preview.active {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-preview img {
  max-width: 100px;
  max-height: 100px;
  border-radius: 4px;
  object-fit: contain;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: var(--font-weight-medium);
  word-break: break-all;
}

.file-type {
  color: var(--muted);
  font-size: 0.8rem;
}

.remove-preview {
  color: var(--danger);
  cursor: pointer;
  font-size: 0.9rem;
}

.remove-preview:hover {
  text-decoration: underline;
}

.phone-selector {
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#phoneNumberContainer {
  overflow-y: auto;
  gap: 6px;
  margin: 0 auto;
  width: 100%;
}

.phone-number-btn {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: var(--white-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.phone-number-btn:hover {
  background: #f4f6ff;
}

.phone-number-btn.active {
  background: #eef2ff;
  border-color: var(--primary-color);
}

/* =========================================================================
   NAVIGATION & DROPDOWNS
========================================================================= */
.menu-item div {
  font-size: var(--mini-header-font-size) !important;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.menu .app-brand.demo {
  margin-top: 0 !important;
}

.menu-item:hover:not(.menu-item.active) {
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
}

.menu-link:hover {
  background-color: #dce5ef !important;
}

.menu-link {
  text-decoration: none !important;
  margin: 0rem 10px !important;
}

.menu-item.active .menu-link {
  font-weight: var(--font-weight-medium);
  background-color: rgb(0 5 255 / 16%) !important;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-menu[data-bs-popper] {
  top: 100%;
  left: -190px;
  margin-top: 0.525rem;
}

.menu-vertical .menu-header {
  margin: 0 !important;
}

.bg-menu-theme .menu-sub > .menu-item > .menu-link:before {
  background: none !important;
}
a.dropdown-item:not(.text-danger):hover {
  background-color: #eef6ff;
  color: var(--primary-color) !important;
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
}

a.dropdown-item.text-danger:hover {
  background-color: #eeee;
  color: var(--danger) !important;
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
}

a.dropdown-item.text-danger {
  color: var(--danger) !important;
}

.modern-profile-dropdown {
  min-width: 230px;
  border-radius: var(--radius);
  padding: 5px;
  background: var(--white-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  animation: dropdownFade 0.18s ease-out;
}

.modern-profile-dropdown .dropdown-item-text {
  padding: 10px 12px;
  font-size: 15px;
  color: var(--muted);
  cursor: default;
}

.modern-profile-dropdown .dropdown-divider {
  margin: 8px 0;
  opacity: 1;
}

.modern-profile-dropdown .dropdown-item {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  /* transition: all 0.2s ease; */
}

.modern-profile-dropdown .dropdown-item i.bx-log-out {
  color: var(--danger);
}

.modern-profile-dropdown .dropdown-item i:not(.bx-log-out) {
  font-size: 18px;
  color: var(--primary-color);
}

.modern-profile-dropdown .dropdown-item:hover {
  background: rgba(105, 108, 255, 0.12);
  transform: translateX(3px);
}

.modern-profile-dropdown .dropdown-item.text-danger:hover {
  background: rgba(220, 53, 69, 0.12) !important;
}

.notification-dropdown {
  width: 350px;
  max-height: 410px;
  overflow-y: auto;
  padding: 0.5rem 0;
  background: var(--white-color);
  border-radius: var(--radius-sm);
}

.notification-dropdown .dropdown-header {
  font-weight: var(--font-weight-medium);
  font-size: 14px;
}

.notification-dropdown .dropdown-item {
  padding: 10px 14px;
  white-space: normal;
  transition: background 0.2s ease;
}

.notification-dropdown .dropdown-item:hover {
  background-color: #eef6ff;
}

.notification-dropdown .notification-item.pending {
  border-left: 3px solid var(--warning);
}

.notification-dropdown .notification-item.success {
  border-left: 3px solid var(--primary-color);
}

.notification-dropdown .notification-item.failed {
  border-left: 3px solid var(--danger);
}

.view-report-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-color);
}

.view-report-link i {
  color: var(--primary-color) !important;
}

.view-report-link:hover {
  text-decoration: underline;
  color: var(--primary-color);
}

#layout-navbar .dropdown .nav-link {
  padding: 0 !important;
}

.layout-menu-toggle i {
  color: black;
}

.avatar-letter {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, var(--primary-color)) !important;
  color: var(--white-color);
  font-weight: var(--font-weight-medium);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  box-shadow: 0 3px 10px var(--primary-color);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: none;
}

.avatar-letter:hover {
  box-shadow: 0 8px 15px var(--primary-color);
}

.nav-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.25s ease;
  cursor: pointer;
}

.nav-icon i {
  font-size: 18px;
  color: var(--white-color);
}

.nav-icon:hover {
  transform: translateY(-2px);
}

.coin-icon {
  background: linear-gradient(135deg, #389159, var(--success));
}

.coin-icon:hover {
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.5);
}

.notification-icon {
  background: linear-gradient(135deg, #3b82f6, var(--info));
}

.notification-icon:hover {
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.5);
}

.notif-badge,
.notification_count {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #000;
}

.notification_count {
  top: 40%;
  right: 15px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 20px;
  width: auto;
  height: auto;
  border: none;
  color: var(--white-color);
}

.support-icon {
  background: linear-gradient(135deg, #f59e0b, var(--warning));
}

.support-icon:hover {
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5);
}

.navbar-nav .d-flex.gap-2 {
  gap: 12px !important;
}

.user-greeting {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 6px;
  line-height: 1.25;
  width: max-content;
  animation: fadeSlideIn 0.4s ease-in-out;
}

.greeting-title {
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  color: #111827;
  display: flex;
  align-items: center;
  gap: 4px;
}

.greeting-title span,
.greeting-title .emoji {
  font-size: 15px;
  font-weight: var(--font-weight-medium);
}

.greeting-subtitle {
  font-size: 13px;
  color: var(--muted);
  font-weight: var(--font-weight-medium);
  opacity: 0.9;
}

.back-link {
  color: var(--primary-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  margin-bottom: 15px;
}

.back-link:hover {
  text-decoration: underline;
}

.back-link i {
  margin-right: 8px;
}

/* =========================================================================
   MODALS & OVERLAYS
========================================================================= */

.template-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  padding: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.template-modal-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}
.error-modal {
  position: fixed;
  z-index: 99999 !important;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px) saturate(200%);
  background-color: rgba(0, 0, 0, 0.17);
}

.error-content {
  background: #f8d7da;
  border: 2px solid var(--danger);
  border-radius: 8px;
  padding: 20px;
  max-width: 540px;
  width: 90%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
}

.error-title {
  color: var(--danger);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.error-icon {
  background: var(--danger);
  color: var(--white-color);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.error-details {
  color: var(--danger);
}

.trace-id {
  font-size: 0.85rem;
  color: #6c757d;
  word-break: break-all;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  color: var(--danger);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-btn:hover {
  color: var(--danger);
}

.close-btn-notification {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

.reschedule-overlay,
.popup-main {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.popup-main {
  margin: auto;
  max-width: 720px;
  max-height: 520px;
  background: var(--white-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  gap: 12px;
}

.popup {
  background: #f7f9fb;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  overflow: auto;
}

.popup_close {
  position: absolute;
  right: 10px;
  top: 10px;
}

.reschedule-modal {
  width: 380px;
  max-width: 92%;
  background: linear-gradient(145deg, var(--glass-bg), var(--glass-border));
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  animation: modalPop 0.25s ease-out;
}

.reschedule-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.reschedule-modal-header h5 {
  font-weight: var(--font-weight-medium);
  font-size: 18px;
  color: var(--primary-color);
  margin: 0;
}

.reschedule-close {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
}

.reschedule-close:hover {
  color: var(--white-color);
}

.reschedule-body label {
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  margin-top: 12px;
  display: block;
}

.reschedule-body input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  margin-top: 4px;
}

.reschedule-body input:focus {
  outline: none;
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.reschedule-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.reschedule-footer button {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 14px;
  border: none;
  cursor: pointer;
}

.reschedule-update {
  background: var(--danger);
  color: var(--white-color);
}

.reschedule-update:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.reschedule-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  display: none;
}

.insights-modal .modal-content {
  border-radius: var(--radius);
}

.insights-modal .modal-dialog {
  max-width: 80%;
}

.insights-content {
  max-height: 500px;
  overflow-y: auto;
}

.insight-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
}

.insight-title {
  font-weight: var(--font-weight-medium);
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.insight-value {
  font-size: 1.1rem;
  font-weight: var(--font-weight-medium);
}

.insight-description {
  color: #6c757d;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.modal-title {
  font-weight: var(--font-weight-medium) !important;
}

/* =========================================================================
   TABLES & DATA DISPLAY
========================================================================= */
.table-container {
  max-height: 600px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  text-align: center;
  z-index: 99 !important;
}

.table-hover tbody tr:hover {
  background-color: rgba(79, 70, 229, 0.05);
}

table thead tr th {
  padding: 8px !important;
  cursor: default !important;
}

table tbody tr td {
  padding: 8px !important;
}

tabletable-striped .tickets-table {
  background: var(--white-color);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: centertitle= "Coins";
}

.tickets-table table {
  width: 100%;
}

.tickets-table tbody tr {
  transition: background 0.15s ease;
}

.tickets-table tbody tr:hover {
  background: rgba(13, 110, 253, 0.04);
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.875rem;
}

.page-link {
  border-radius: 6px;
}

.page-item.active .page-link {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  border-color: transparent;
}

.empty-icon {
  font-size: 4rem;
  opacity: 0.4;
}

.no-tickets {
  text-align: center;
  padding: 60px 20px;
}

.no-tickets p {
  color: var(--muted);
  margin-top: 10px;
}

/* =========================================================================
   PAGINATION
========================================================================= */
.pagination {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

.pagination .page-active,
.page-btn.active {
  background: var(--accent-1) !important;
}

.pagination-wrapper {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pagination-nav {
  display: flex;
  gap: 5px;
}

.pagination-info {
  font-size: 14px;
  color: #555;
}

/* =========================================================================
   ANIMATIONS
========================================================================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalPop {
  from {
    transform: translateY(15px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes rotateRefreshReverse {
  from {
    transform: rotate(-360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes glowPulse {
  0% {
    box-shadow: 0 0 0 rgba(0, 82, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 22px rgba(0, 82, 255, 0.65);
  }
  100% {
    box-shadow: 0 0 0 rgba(0, 82, 255, 0.4);
  }
}

@keyframes floatUp {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes sparkleMove {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 500px 700px, -500px -700px;
  }
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
}

.slide-up {
  opacity: 0;
  animation: slideUp 0.9s ease forwards;
}

/* =========================================================================
   LOADERS & SPINNERS
========================================================================= */
#app-loader,
#loadingOverlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

#app-loader .loader-backdrop,
#loadingOverlay .loader-backdrop {
  position: absolute;
  inset: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

#app-loader .loader-card,
#loadingOverlay .loader-card {
  background: var(--white-color);
  border-radius: var(--radius-lg);
  padding: 28px 34px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px var(--glass-border);
  animation: loaderFadeIn 0.25s ease-out;
  min-width: 200px;
}

#app-loader .loader-ring,
#loadingOverlay .loader-ring {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--accent-1);
  border-right-color: var(--accent-2);
  animation: spin 0.9s linear infinite;
}

#loadingOverlay .loader-ring {
  border-top-color: var(--accent-1);
  border-right-color: var(--accent-2);
}

#app-loader .loader-text,
#loadingOverlay .loader-text {
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  color: #111827;
  letter-spacing: 0.2px;
}

#app-loader .loader-subtext,
#loadingOverlay .loader-subtext {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.loading {
  color: var(--white-color);
}

.loading-overlay {
  margin: auto;
}

.processing {
  display: none;
  color: var(--primary-color);
}

.download-ready {
  display: none;
  color: var(--success);
}

.download-failed {
  display: none;
  color: var(--danger);
}

.insights-loading {
  color: var(--white-color);
}

.insights-ready {
  display: none;
  color: var(--primary-color);
}

.insights-failed {
  display: none;
  color: var(--danger);
}

.progress {
  height: 8px;
  border-radius: 6px;
  overflow: hidden;
}

.progress-container {
  display: none;
}

/* =========================================================================
   UTILITIES & HELPERS
========================================================================= */
.d-none,
.hidden {
  display: none !important;
}

.fw-medium {
  font-weight: var(--font-weight-medium) !important;
}

a {
  text-decoration: none !important;
}

.text-primary,
.primary-text {
  opacity: 1;
  color: var(--primary-color) !important;
  text-decoration: none;
}

.text-success,
.alert-success {
  color: var(--success) !important;
}

.alert-success {
  background: var(--whatsapp-btn-background) !important;
  border: none !important;
}

.alert-danger,
.alert-error {
  color: var(--danger) !important;
  background: #ffebee !important;
  border: none !important;
}

.alert-info {
  color: var(--info) !important;
  background: #e3f2fd !important;
  border: none !important;
}

.alert-warning {
  color: var(--white-color) !important;
  background: var(--warning) !important;
  border: none !important;
}

.cursor-default {
  cursor: default;
}

.icon-size {
  font-size: 20px;
}

.bx.bx-refresh {
  font-size: 20px !important;
}

.debug-box {
  background: #0f172a;
  color: #e5e7eb;
  padding: 10px;
  border-radius: 8px;
  max-height: 240px;
  overflow: auto;
  font-size: 12px;
}

.dashboard-wrapper {
  margin: 25px;
  animation: fadeIn 0.8s ease-out;
}

.dashboard-title {
  font-size: var(--header-font-size);
  font-weight: var(--font-weight-medium);
  color: #1a1a1a;
  margin-bottom: 15px;
}

.feature-body {
  flex: 1;
}

.feature-body a {
  margin-right: 10px;
}

.feature-stats {
  display: flex;
  gap: 20px;
}
.stats-small {
  margin-bottom: 10px;
}

.stats-small span {
  font-size: 14px;
  color: var(--muted);
}

.stats-small h4 {
  margin: 3px 0;
  font-weight: var(--font-weight-medium);
}

.info-row {
  font-size: 14px;
  color: var(--muted);
}

.schedule-title {
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  color: var(--muted);
}

.schedule-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

.schedule-meta i {
  color: var(--primary-color);
}

.schedule-divider {
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
  margin: 12px 0;
}

.schedule-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.schedule-actions .btn-danger {
  font-size: var(--para-font-size);
  padding: clamp(12px, 1.2vw, 14px) clamp(14px, 2vw, 24px);
}

.filter-section {
  border-radius: var(--radius-sm);
}

.qr-title {
  font-size: 1.4rem;
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: 10px;
}

.qr-subtitle {
  font-size: 0.9rem;
  color: #6c757d;
}

#messageInput {
  border-radius: var(--radius);
  padding: 14px;
  font-size: 0.95rem;
}

#messageInput:focus {
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
}

#generateButton {
  border-radius: var(--radius);
  padding: 12px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.3px;
}

.qr-preview-box {
  border-radius: 16px;
  padding: 20px;
  background: var(--glass-bg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

#qrCanvas {
  max-width: 260px;
}

.qr-actions button {
  border-radius: 5px !important;
  font-weight: var(--font-weight-medium);
  font-size: var(--para-font-size) !important;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ticket-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ticket-meta {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
  flex-wrap: wrap;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-direction: column;
}

.notification-meta {
  font-size: 13px;
  color: var(--muted);
}

.notification-message {
  font-size: 14px;
  margin-top: 6px;
}

.notification {
  position: fixed;
  top: 20px;
  right: -420px;
  width: 360px;
  padding: 16px;
  background: var(--white-color);
  border-left: 5px solid var(--success);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: right 0.4s ease;
  z-index: 99999;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.notification.show {
  right: 20px;
}

.notification-content {
  margin-right: 15px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.screen-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  border-radius: 8px;
  cursor: pointer;
  background: #e7e7e7;
  margin-bottom: 6px;
  font-weight: var(--font-weight-medium);
}

.screen-tab.active {
  background: linear-gradient(
    90deg,
    var(--accent-1),
    var(--accent-2)
  ) !important;
  color: var(--white-color);
}

.delete-screen {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--danger);
}

.delete-screen:hover {
  background: rgba(220, 53, 69, 0.12);
}

/* =========================================================================
   LOGIN & AUTHENTICATION
========================================================================= */
.login-card {
  width: 100%;
  max-width: 530px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.08);
  animation: fadeUp 0.6s ease;
}

.login-card .login-title {
  text-align: center;
  font-size: 30px;
  font-weight: var(--font-weight-medium);
  color: var(--dark-btn-color);
}

.login-card .login-subtitle {
  text-align: center;
  font-size: 15px;
  color: var(--success);
  margin-bottom: 15px;
  font-weight: var(--font-weight-medium);
}

.login-card form p {
  margin-bottom: 14px;
}

.login-card input[type="text"],
.login-card input[type="email"],
.login-card input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #d9e1ec;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.login-card input:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 2px rgba(0, 106, 255, 0.15);
}

.login-card .terms {
  font-size: 13px;
  margin-top: 6px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 7px;
}

.login-card .terms a {
  color: var(--success);
  font-weight: var(--font-weight-medium);
}

.center-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 91vh;
  padding: 20px;
}

.error-box {
  text-align: center;
  padding: 40px 30px;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  font-family: "Fredoka", sans-serif !important;
}

.error-box h1 {
  color: var(--success);
  font-size: 36px;
  margin-bottom: 16px;
  font-weight: var(--font-weight-medium);
}

.error-image img {
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 20px auto;
  display: block;
}

.error-text p {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 24px;
}

#errorMsg {
  font-weight: var(--font-weight-medium);
}

/* =========================================================================
   STATISTICS & METRICS
========================================================================= */
.stat-item {
  transition: transform 0.2s ease-in-out;
  border-radius: 5px;
  margin-bottom: 10px;
  width: 100%;
  height: 170px;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

.total-numbers {
  background-color: #e3f2fd;
  color: var(--info);
}

.total-delivered {
  background-color: #e8f5e8;
  color: var(--success);
}

.total-failed {
  background-color: #ffebee;
  color: var(--danger);
}

.total-pending {
  background: var(--warning);
  color: var(--white-color);
}

.total-not-found {
  background-color: #f3e5f5;
  color: var(--primary-color);
}

.stat-number {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 0;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0;
}

.flip-card {
  perspective: 1400px;
  width: 100%;
  height: 170px;
}

.flip-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 5px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}

.flip-card-front {
  background: var(--white-color);
  border: 1px solid #dee2e6;
}

.flip-card-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: var(--white-color);
  flex-direction: column;
}

.back-stat-item {
  width: 90%;
  border-radius: 5px;
  margin-bottom: 6px;
  text-align: center;
}

.devivered-success{
  background-color: var(--success);
}

.sent-success{
  background-color: var(--info);
}

.read-success{
  background-color: var(--primary-color);
}

.back-stat-number {
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  margin-bottom: 5px;
}

.back-stat-label {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 0;
  font-weight: var(--font-weight-medium);
}

.tabs-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.tabs {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.tab {
  font-size: 0.9rem;
  font-weight: var(--font-weight-medium);
  color: var(--muted);
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab:hover {
  color: var(--primary-color);
}

.profile-circle {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, var(--primary-color), #5a5fdb);
  color: var(--white-color);
  font-size: 36px;
  font-weight: var(--font-weight-medium);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  box-shadow: 0 10px 20px rgba(105, 108, 255, 0.35);
}

.profile-name {
  font-weight: var(--font-weight-medium);
}

.info-muted {
  font-size: 14px;
  color: #6c757d;
}

.card + .card {
  margin-top: 16px;
}

.token-actions button {
  min-width: 48px;
}

.token-actions {
  gap: 10px;
}

/* =========================================================================
   COINS & TRANSACTIONS
========================================================================= */
.coin_body {
  padding: 5px;
  border-radius: 5px;
  width: fit-content;
  font-weight: bold;
}

.hover-text {
  position: absolute;
  top: 45px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: var(--white-color);
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
  display: none;
  font-size: 13px;
  line-height: 1.5;
  z-index: 999999;
  white-space: nowrap;
}

.hover-text::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent rgba(15, 23, 42, 0.95) transparent;
}

.coin-icon:hover .hover-text {
  display: block;
}

.coin-history-list .coin-row {
  border: none;
  background: transparent;
  padding: 8px;
}

.coin-row-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--white-color);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.coin-row-inner:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.coin-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 75%;
}

.coin-date {
  font-size: 12px;
  color: var(--muted);
}

.coin-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.coin-type-text {
  font-weight: var(--font-weight-medium);
  color: var(--muted);
}

.coin-badge {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 20px;
}

.coin-credit {
  background: rgba(40, 167, 69, 0.12);
  color: var(--success);
}

.coin-debit {
  background: rgba(220, 53, 69, 0.12);
  color: var(--danger);
}

.coin-meta-text {
  font-size: 13px;
  color: var(--muted);
}

.coin-meta-text code {
  background: #f1f3f6;
  padding: 2px 6px;
  border-radius: 4px;
}

.coin-reason {
  font-size: 14px;
  color: #495057;
  line-height: 1.4;
}

.coin-right {
  text-align: right;
  font-size: 22px;
  font-weight: var(--font-weight-medium);
  min-width: 90px;
  align-self: center;
}

.coin-right span {
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  display: block;
}

.amount-credit {
  color: var(--success);
}

.amount-debit {
  color: var(--danger);
}

/* =========================================================================
   MEDIA UPLOAD
========================================================================= */
.media-upload-container {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.08);
}

.upload-zone {
  border: 2px dashed #cfd6e3;
  border-radius: 16px;
  padding: 45px 25px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(180deg, #f9fbff, var(--white-color));
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary-color);
  background: #f0f3ff;
}

.upload-icon {
  font-size: 46px;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.upload-text {
  font-size: 18px;
  font-weight: var(--font-weight-medium);
}

.upload-subtext {
  font-size: 13px;
  color: var(--muted);
}

.response-section {
  margin-top: 35px;
  padding: 25px;
  border-radius: 16px;
  background: #f5fff7;
  border: 1px solid #d6f0dc;
}

.media-id-display {
  background: var(--white-color);
  border-radius: var(--radius);
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.media-id-value {
  font-family: "Fredoka", sans-serif !important;
  font-size: 14px;
  word-break: break-all;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-top: 40px;
}

.media-feature-card {
  background: var(--white-color);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.feature-icon {
  font-size: 26px;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.media-file-info {
  display: none;
  margin-top: 25px;
}

.media-file-preview {
  display: flex;
  align-items: center;
  gap: 15px;
}

.media-file-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: #eef1ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--primary-color);
}

.media-progress-container {
  display: none;
  margin-top: 15px;
}

.media-progress-container {
  display: none;
  margin-top: 15px;
}

.media-progress {
  height: 8px;
  border-radius: 10px;
  overflow: hidden;
}

.media-progress-bar {
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--primary-color)
  );
  transition: width 0.3s ease;
}

/* Toast */
.media-notification {
  position: fixed;
  top: 25px;
  right: 25px;
  padding: 12px 20px;
  border-radius: 8px;
  color: var(--white-color);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 9999;
}

.media-notification.success {
  background: var(--success);
}
.media-notification.error {
  background: var(--danger);
}

.media-notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================================
  OFFER POPUP
========================================================================= */

.offer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 10px;
}

.offer-modal {
  width: 100%;
  max-width: 520px;
  padding: 28px;
  border-radius: 22px;
  text-align: center;
  position: relative;

  background: linear-gradient(
        rgba(255, 255, 255, 0.96),
        rgba(255, 255, 255, 0.96)
      )
      padding-box,
    linear-gradient(135deg, #ff3c7e, #0052ff) border-box;

  border: 2px solid transparent;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  animation: popIn 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(#ff3c7e 1px, transparent 1px),
    radial-gradient(#0052ff 1px, transparent 1px);
  background-size: 40px 40px, 60px 60px;
  animation: sparkleMove 14s linear infinite;
  opacity: 0.25;
  border-radius: inherit;
}

.offer-gif img {
  width: 70%;
  margin: auto;
  animation: floatUp 3s ease-in-out infinite;
}

.offer-header {
  font-size: 1.7rem;
  font-weight: 800;
  background: linear-gradient(90deg, #ff3c7e, #0052ff);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.offer-text {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 16px;
}

.offer-list {
  list-style: none;
  padding: 0;
  margin-bottom: 22px;
}

.offer-list li {
  font-size: 0.93rem;
  margin: 7px 0;
}

.offer-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.glow-btn {
  animation: glowPulse 1.8s infinite;
}

.offer-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: none;
  font-size: 1.7rem;
  cursor: pointer;
}

.carousel-img-box {
  position: relative;
  width: 100%;
  height: 120px;
  border-radius: var(--radius-sm);
  border: 2px dashed #e5e7eb;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; 
}

.carousel-img-box > div[id^="placeholder"] {
  text-align: center;
  pointer-events: none;
}

.carousel-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;           /* 🔥 uniform crop */
  display: block;
}

.carousel-img-box .remove-img {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
}

.carousel-img-box .remove-img:hover {
  background: rgba(220, 38, 38, 0.85);
}

.contact-skeleton {
  padding: 12px;
}

.skeleton-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e0e0;
  animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-lines {
  flex: 1;
}

.skeleton-line {
  height: 12px;
  background: #e0e0e0;
  margin-bottom: 6px;
  border-radius: 4px;
  animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-line.short {
  width: 40%;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}
.m-auto {
  margin: auto !important;
}

#chatText {
  width: 75% !important;
}

.password-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 35px;
  cursor: pointer;
  font-size: 18px;
  color: #777;
}

.password-toggle:hover {
  color: #000;
}

.drop-zone {
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: linear-gradient(145deg, var(--glass-bg), transparent);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.04);
}

.media-preview audio {
  width: 100%;
}

.media-preview .file-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px;
  border-radius: 10px;
}

.preview-images-section{
  justify-content: space-evenly;
}

.preview-images-section > div {
  width: 300px;
  height: 300px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Images inside preview */
.preview-images-section img {
  height: 100%;
  object-fit: cover;
}

.preview-buttons{
  text-align: center;
}

.filter-actions{
  display: flex;
  gap: 12px;
}

#headerVariableError,
#bodyVariableError {
  white-space: pre-line;
}

/* =====================================================
   MOBILE FIRST (≤ 576px)
===================================================== */
@media (max-width: 576px) {
  /* Feature cards */
  .feature-card .actions {
    flex-direction: column;
  }

  .feature-card .actions .primary-btn {
    width: 100%;
  }

  /* Notifications */
  .notification {
    width: 300px !important;
  }

  .notification.show {
    right: 10px !important;
  }
}

/* =====================================================
   SMALL DEVICES (≤ 804px)
===================================================== */
@media (max-width: 804px) {
  .user-greeting {
    display: none;
    width: 100%;
    margin-bottom: 10px;
  }

  .navbar-nav {
    text-align: center;
  }

  .feature-body a {
    width: 100%;
    margin-bottom: 5px;
  }
}

@media (max-width: 370px){
  .badge-section{
    flex-direction: column;
  }
}

/* =====================================================
   TABLET & BELOW (≤ 991px)
===================================================== */
@media (max-width: 991px) {
  /* Layout fixes */
  .container-app {
    padding: 10px !important;
  }

  .wa-frame,
  .editor-panel,
  .preview-panel,
  .send-msg-div,
  .preview-div,
  #submitBtn,
  #toggleScheduleButton {
    width: 100%;
  }

  /* Flex direction changes */
  .message-selection,
  .builder-grid,
  .send-message-section {
    flex-direction: column-reverse !important;
  }

  .carousel-actions,
  .flow-button-section,
  .user-message-section,
  .jump-area-section,
  .preview-images-section {
    flex-direction: column;
  }

  .preview-images-section{
    justify-content: center;
  }

  .preview-images-section > div{
    width: 100%;
  }

  /* Mobile responsive action section */
  .mobile-resp-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: center;
  }

  .mobile-resp-section button {
    margin-bottom: 5px;
  }

  /* Tabs */
  .tabs {
    gap: 10px !important;
  }

  /* Dropdown positioning */
  .dropdown-menu[data-bs-popper] {
    left: -120px;
  }

  .modern-profile-dropdown {
    left: -165px !important;
  }

  .notification-dropdown {
    width: 285px;
  }

  .feature-image-container{
    display: flex !important;
    flex-wrap: wrap;
    flex-direction: column;
  }

  .feature-section{
    width: 100% !important;
  }
}

@media (max-width: 767px) {
  .search-btn-group,.filter-actions{
    flex-direction: column;
  }
  .content-section{
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 545px) {
  .search-box-container {
    flex-direction: column;
  }
}

/* =====================================================
   DESKTOP MEDIUM (992px – 1390px)
===================================================== */
@media (min-width: 992px) and (max-width: 1390px) {
  .feature-card {
    min-height: 420px;
  }

  .feature-card .actions {
    flex-direction: column;
  }

  .feature-card .actions .primary-btn {
    width: 100%;
  }
}
