/* ============================================================
   Canabidiol JUS – Custom CSS
   Green theme: primary #2d6a4f, accent #52b788
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --green-dark:   #1b4332;
  --green-main:   #2d6a4f;
  --green-mid:    #40916c;
  --green-light:  #52b788;
  --green-pale:   #95d5b2;
  --green-xpale:  #d8f3dc;
  --gold:         #e9c46a;
  --text-dark:    #1a1a2e;
  --text-muted:   #6c757d;
  --bg-light:     #f8fffe;
  --white:        #ffffff;
  --shadow-sm:    0 2px 8px rgba(45,106,79,.12);
  --shadow-md:    0 6px 24px rgba(45,106,79,.18);
  --shadow-lg:    0 12px 40px rgba(45,106,79,.22);
  --radius:       0.75rem;
  --radius-lg:    1.25rem;
  --transition:   all .3s cubic-bezier(.4,0,.2,1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.65;
}

a { color: var(--green-mid); text-decoration: none; }
a:hover { color: var(--green-light); text-decoration: underline; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--green-mid); border-radius: 4px; }

/* ============================================================
   LANDING PAGE
   ============================================================ */

/* ---- Navbar ---- */
.navbar-brand .brand-logo {
  width: 40px;
  height: 40px;
  background: var(--green-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--green-dark);
  font-size: 1.1rem;
  margin-right: 10px;
}

.navbar-landing {
  background: rgba(27,67,50,.97) !important;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  padding: 0.75rem 0;
}

.navbar-landing .navbar-brand,
.navbar-landing .nav-link {
  color: #e0f2e9 !important;
}

.navbar-landing .nav-link:hover { color: var(--green-pale) !important; }

.navbar-landing .nav-link.active {
  color: var(--green-light) !important;
  font-weight: 600;
}

.navbar-landing .btn-navbar {
  background: var(--green-mid);
  color: #fff;
  border: none;
  padding: .45rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: var(--transition);
}

.navbar-landing .btn-navbar:hover {
  background: var(--green-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ---- Hero ---- */
.hero-section {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-main) 55%, var(--green-mid) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 7rem 0 5rem;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(82,183,136,.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 20% 70%, rgba(149,213,178,.12) 0%, transparent 60%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--bg-light);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(82,183,136,.18);
  border: 1px solid rgba(82,183,136,.4);
  color: var(--green-pale);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .4rem 1rem;
  border-radius: 2rem;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.hero-title .highlight {
  color: var(--green-pale);
  position: relative;
}

.hero-title .highlight::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 3px;
  background: var(--green-light);
  border-radius: 2px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(216,243,220,.85);
  max-width: 520px;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.hero-stat {
  text-align: center;
}

.hero-stat .stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--green-pale);
  line-height: 1;
}

.hero-stat .stat-label {
  font-size: .8rem;
  color: rgba(216,243,220,.7);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ---- Lead Form Card ---- */
.form-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  position: relative;
  z-index: 2;
}

.form-card .form-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: .35rem;
}

.form-card .form-subtitle {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.form-card .form-label {
  font-weight: 600;
  font-size: .88rem;
  color: var(--green-dark);
  margin-bottom: .3rem;
}

.form-card .form-control {
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  padding: .65rem .95rem;
  font-size: .95rem;
  transition: var(--transition);
  background: #fafffe;
}

.form-card .form-control:focus {
  border-color: var(--green-light);
  box-shadow: 0 0 0 4px rgba(82,183,136,.15);
  background: #fff;
}

.form-card .form-control.is-invalid {
  border-color: #dc3545;
}

.form-card .form-control.is-valid {
  border-color: var(--green-light);
}

.btn-submit {
  background: linear-gradient(135deg, var(--green-main), var(--green-mid));
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: .8rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  width: 100%;
  transition: var(--transition);
  letter-spacing: .02em;
}

.btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--green-dark), var(--green-main));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: #fff;
}

.btn-submit:disabled {
  opacity: .7;
  cursor: not-allowed;
}

.form-privacy {
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: .75rem;
}

/* Success / Error alerts */
#form-success, #form-error {
  display: none;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-weight: 500;
}

#form-success { background: var(--green-xpale); color: var(--green-dark); border: 1.5px solid var(--green-pale); }
#form-error   { background: #fff0f0; color: #922; border: 1.5px solid #f5c2c2; }

/* ---- Features Section ---- */
.features-section {
  padding: 5rem 0;
  background: var(--bg-light);
}

.section-label {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--green-mid);
  margin-bottom: .6rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.section-title span { color: var(--green-main); }

.feature-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  border: 2px solid #e9f5ee;
  height: 100%;
  transition: var(--transition);
}

.feature-card:hover {
  border-color: var(--green-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.feature-icon {
  width: 56px;
  height: 56px;
  background: var(--green-xpale);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--green-main);
  margin-bottom: 1.25rem;
}

.feature-card h5 {
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: .5rem;
}

.feature-card p {
  font-size: .92rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---- How it Works ---- */
.how-section {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-main) 100%);
  padding: 5rem 0;
  color: #fff;
}

.how-section .section-title { color: #fff; }
.how-section .section-title span { color: var(--green-pale); }
.how-section .section-label { color: var(--green-pale); }
.how-section p { color: rgba(216,243,220,.8); }

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}

.step-item:hover {
  background: rgba(255,255,255,.1);
  transform: translateX(4px);
}

.step-num {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: var(--green-light);
  color: var(--green-dark);
  font-weight: 800;
  font-size: 1.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-item h6 { font-weight: 700; color: #fff; margin-bottom: .25rem; }
.step-item p  { font-size: .88rem; color: rgba(216,243,220,.75); margin: 0; }

/* ---- Testimonials ---- */
.testimonials-section {
  padding: 5rem 0;
  background: var(--bg-light);
}

.testimonial-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 2px solid #e9f5ee;
  height: 100%;
  position: relative;
}

.testimonial-card .quote-icon {
  font-size: 3rem;
  color: var(--green-xpale);
  line-height: 1;
  font-family: Georgia, serif;
  margin-bottom: .5rem;
}

.testimonial-card p {
  color: var(--text-muted);
  font-size: .95rem;
  font-style: italic;
  margin-bottom: 1.25rem;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green-xpale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--green-main);
  font-size: .95rem;
}

.author-name { font-weight: 700; font-size: .9rem; color: var(--text-dark); margin: 0; }
.author-role { font-size: .8rem; color: var(--text-muted); margin: 0; }

/* ---- CTA Banner ---- */
.cta-section {
  background: linear-gradient(135deg, var(--green-mid), var(--green-dark));
  padding: 4rem 0;
  text-align: center;
}

.cta-section h2 { color: #fff; font-weight: 800; }
.cta-section p  { color: rgba(216,243,220,.85); font-size: 1.1rem; }

.btn-cta {
  background: var(--white);
  color: var(--green-dark);
  font-weight: 700;
  padding: .85rem 2.5rem;
  border-radius: var(--radius);
  border: none;
  font-size: 1.05rem;
  transition: var(--transition);
}

.btn-cta:hover {
  background: var(--green-xpale);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ---- Footer ---- */
.footer {
  background: var(--green-dark);
  color: rgba(216,243,220,.75);
  padding: 3rem 0 1.5rem;
}

.footer h6 { color: #fff; font-weight: 700; margin-bottom: 1rem; }
.footer a  { color: rgba(216,243,220,.65); font-size: .9rem; }
.footer a:hover { color: var(--green-pale); text-decoration: none; }
.footer-brand { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: .5rem; }
.footer-divider { border-color: rgba(255,255,255,.12); margin: 1.5rem 0 1rem; }
.footer-copy { font-size: .82rem; color: rgba(216,243,220,.5); }

/* ============================================================
   DASHBOARD LOGIN PAGE
   ============================================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-main) 60%, var(--green-mid) 100%);
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(82,183,136,.2) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 10% 80%, rgba(149,213,178,.15) 0%, transparent 60%);
  pointer-events: none;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.75rem 2.25rem;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 2;
}

.login-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--green-main), var(--green-mid));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  margin: 0 auto 1.25rem;
  box-shadow: var(--shadow-sm);
}

.login-title {
  text-align: center;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--green-dark);
  margin-bottom: .25rem;
}

.login-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 2rem;
}

/* ============================================================
   DASHBOARD APP
   ============================================================ */

.db-wrapper {
  display: flex;
  min-height: 100vh;
  background: #f0f4f2;
}

/* ---- Sidebar ---- */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--green-dark) 0%, #1a3d2b 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1040;
  transition: transform .3s ease;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-brand .brand-icon {
  width: 38px;
  height: 38px;
  background: var(--green-light);
  border-radius: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--green-dark);
  font-size: .95rem;
  flex-shrink: 0;
}

.sidebar-brand .brand-text {
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  line-height: 1.2;
}

.sidebar-brand .brand-text small {
  display: block;
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar-section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 1rem 1.25rem .4rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .7rem 1.25rem;
  color: rgba(255,255,255,.68);
  font-size: .92rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
  border-radius: 0;
  text-decoration: none;
}

.sidebar-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-left-color: rgba(82,183,136,.5);
}

.sidebar-link.active {
  background: rgba(82,183,136,.18);
  color: var(--green-pale);
  border-left-color: var(--green-light);
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: rgba(255,255,255,.06);
  border-radius: var(--radius);
  margin-bottom: .75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--green-mid);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
}

.user-name  { font-size: .88rem; font-weight: 600; color: #fff; line-height: 1.2; }
.user-role  { font-size: .74rem; color: rgba(255,255,255,.45); }

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .6rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  color: rgba(255,255,255,.65);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  background: rgba(220,53,69,.2);
  border-color: rgba(220,53,69,.4);
  color: #f8a5a5;
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Topbar ---- */
.topbar {
  background: #fff;
  padding: .85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5ebe8;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-dark);
}

.topbar-sub {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .1rem;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--green-main);
  cursor: pointer;
  padding: .25rem .5rem;
}

/* ---- Page Content ---- */
.page-content {
  padding: 1.75rem;
  flex: 1;
}

.section-page { display: none; }
.section-page.active { display: block; }

/* ---- KPI Cards ---- */
.kpi-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1.5px solid #e5ebe8;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  border-radius: 4px 0 0 4px;
}

.kpi-card.kpi-green::before  { background: var(--green-mid); }
.kpi-card.kpi-teal::before   { background: #0d9488; }
.kpi-card.kpi-blue::before   { background: #2563eb; }
.kpi-card.kpi-orange::before { background: #d97706; }

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.kpi-green  .kpi-icon { background: var(--green-xpale); color: var(--green-main); }
.kpi-teal   .kpi-icon { background: #ccfbf1; color: #0d9488; }
.kpi-blue   .kpi-icon { background: #dbeafe; color: #2563eb; }
.kpi-orange .kpi-icon { background: #fef3c7; color: #d97706; }

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1;
  margin-bottom: .3rem;
}

.kpi-label {
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-trend {
  font-size: .78rem;
  font-weight: 600;
  margin-top: .5rem;
}

.kpi-trend.up   { color: var(--green-mid); }
.kpi-trend.down { color: #dc3545; }

/* ---- Content Cards ---- */
.content-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1.5px solid #e5ebe8;
  overflow: hidden;
}

.content-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5ebe8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

.content-card-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-dark);
  margin: 0;
}

.content-card-body { padding: 1.25rem 1.5rem; }

/* ---- Tables ---- */
.table-custom { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-custom thead tr { background: #f6faf7; }
.table-custom thead th {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: .85rem 1rem;
  border-bottom: 2px solid #e5ebe8;
  white-space: nowrap;
}

.table-custom tbody tr {
  transition: background .15s;
}

.table-custom tbody tr:hover { background: #f6faf7; }

.table-custom tbody td {
  padding: .85rem 1rem;
  border-bottom: 1px solid #f0f4f2;
  font-size: .9rem;
  color: var(--text-dark);
  vertical-align: middle;
}

.table-custom tbody tr:last-child td { border-bottom: none; }

/* ---- Badges ---- */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .76rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border-radius: 2rem;
}

.badge-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-novo      { background: #dbeafe; color: #1d4ed8; }
.badge-atribuido { background: #fef3c7; color: #92400e; }
.badge-ativo     { background: var(--green-xpale); color: var(--green-dark); }
.badge-inativo   { background: #fee2e2; color: #991b1b; }
.badge-convertido { background: #ede9fe; color: #5b21b6; }
.badge-pendente  { background: #ffedd5; color: #9a3412; }

/* ---- Filters ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.filter-bar .form-control,
.filter-bar .form-select {
  font-size: .88rem;
  padding: .45rem .8rem;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius);
  transition: var(--transition);
}

.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(82,183,136,.12);
}

.btn-filter {
  background: var(--green-main);
  color: #fff;
  border: none;
  padding: .45rem 1rem;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.btn-filter:hover { background: var(--green-dark); }

.btn-secondary-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid #d1d5db;
  padding: .45rem 1rem;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.btn-secondary-outline:hover {
  border-color: var(--green-light);
  color: var(--green-main);
}

/* ---- Pagination ---- */
.pagination-custom {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

.page-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #d1d5db;
  border-radius: .45rem;
  font-size: .85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  background: #fff;
}

.page-btn:hover { border-color: var(--green-light); color: var(--green-main); }
.page-btn.active { background: var(--green-main); border-color: var(--green-main); color: #fff; font-weight: 700; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

.pagination-info {
  font-size: .82rem;
  color: var(--text-muted);
}

/* ---- Action Buttons ---- */
.btn-action {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: .45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
}

.btn-action.edit  { color: #2563eb; }
.btn-action.edit:hover   { background: #dbeafe; }
.btn-action.delete{ color: #dc3545; }
.btn-action.delete:hover { background: #fee2e2; }
.btn-action.assign{ color: var(--green-main); }
.btn-action.assign:hover { background: var(--green-xpale); }
.btn-action.toggle{ color: #d97706; }
.btn-action.toggle:hover { background: #fef3c7; }
.btn-action.view  { color: #6b7280; }
.btn-action.view:hover   { background: #f3f4f6; }

/* ---- Modals ---- */
.modal-header-green {
  background: linear-gradient(135deg, var(--green-main), var(--green-mid));
  color: #fff;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0 !important;
  padding: 1.25rem 1.5rem;
}

.modal-header-green .modal-title { font-weight: 700; color: #fff; }
.modal-header-green .btn-close   { filter: invert(1); }

/* ---- Chart Placeholder ---- */
.chart-placeholder {
  height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f9fbf9;
  border-radius: var(--radius);
  border: 2px dashed #d1e8da;
  color: var(--text-muted);
  font-size: .9rem;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 120px;
  margin-bottom: 1rem;
}

.chart-bar {
  width: 28px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, var(--green-main), var(--green-light));
  opacity: .8;
  transition: opacity .2s;
}

.chart-bar:hover { opacity: 1; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  color: var(--green-pale);
  margin-bottom: 1rem;
  display: block;
}

.empty-state p { margin: 0; font-size: .95rem; }

/* ---- Loading Spinner ---- */
.spinner-green {
  color: var(--green-mid);
}

/* ---- Toast ---- */
.toast-container-custom {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.toast-custom {
  background: #fff;
  border-radius: var(--radius);
  padding: .85rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 280px;
  animation: toastIn .35s ease forwards;
  border-left: 4px solid;
}

.toast-custom.toast-success { border-left-color: var(--green-mid); }
.toast-custom.toast-error   { border-left-color: #dc3545; }
.toast-custom.toast-info    { border-left-color: #2563eb; }

.toast-custom .toast-icon { font-size: 1.15rem; }
.toast-success .toast-icon { color: var(--green-mid); }
.toast-error   .toast-icon { color: #dc3545; }
.toast-info    .toast-icon { color: #2563eb; }

.toast-custom .toast-msg { font-size: .9rem; color: var(--text-dark); flex: 1; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---- Activity Feed ---- */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .75rem 0;
  border-bottom: 1px solid #f0f4f2;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.activity-item .a-title { font-size: .88rem; font-weight: 600; color: var(--text-dark); margin-bottom: .1rem; }
.activity-item .a-sub   { font-size: .8rem; color: var(--text-muted); margin: 0; }
.activity-item .a-time  { font-size: .75rem; color: var(--text-muted); white-space: nowrap; margin-left: auto; }

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: block;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1039;
  }

  .sidebar-overlay.show { display: block; }
}

@media (max-width: 575.98px) {
  .page-content { padding: 1rem; }
  .topbar { padding: .75rem 1rem; }
  .kpi-value { font-size: 1.6rem; }
  .content-card-header { padding: 1rem; }
  .content-card-body { padding: 1rem; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   WhatsApp Floating Widget
   ============================================================ */

/* FAB Button */
#wz-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

#wz-fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.45);
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
  animation: wz-pulse 2.5s infinite;
}

#wz-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37,211,102,.6);
  animation: none;
}

@keyframes wz-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37,211,102,.45); }
  50%       { box-shadow: 0 4px 28px rgba(37,211,102,.75), 0 0 0 8px rgba(37,211,102,.12); }
}

/* Notification badge */
#wz-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  animation: wz-badge-bounce .8s ease infinite alternate;
}

@keyframes wz-badge-bounce {
  from { transform: scale(1); }
  to   { transform: scale(1.2); }
}

#wz-badge.hidden { display: none; }

/* Chat Panel */
#wz-panel {
  width: 330px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  overflow: hidden;
  display: none;
  flex-direction: column;
  transform: translateY(10px);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}

#wz-panel.wz-open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

/* Header */
.wz-header {
  background: #075E54;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wz-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wz-header-info { flex: 1; }

.wz-header-name {
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  margin: 0;
  line-height: 1.2;
}

.wz-header-status {
  color: rgba(255,255,255,.75);
  font-size: .75rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.wz-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ADE80;
  display: inline-block;
}

.wz-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color .15s;
}

.wz-close:hover { color: #fff; }

/* Body */
.wz-body {
  padding: 16px;
  background: #ECE5DD;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Chat bubble */
.wz-bubble {
  background: #fff;
  border-radius: 0 10px 10px 10px;
  padding: 10px 13px;
  font-size: .88rem;
  color: #303030;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  position: relative;
  max-width: 90%;
}

.wz-bubble p { margin: 0; line-height: 1.45; }

.wz-bubble-time {
  display: block;
  text-align: right;
  font-size: .68rem;
  color: #8a8a8a;
  margin-top: 4px;
}

/* Form fields */
#wz-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wz-field input {
  width: 100%;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1.5px solid #ddd;
  font-size: .875rem;
  background: #fff;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}

.wz-field input:focus { border-color: #25D366; }
.wz-field input.wz-invalid { border-color: #ef4444; }

/* Error message */
.wz-error-msg {
  background: #fef2f2;
  color: #dc2626;
  font-size: .8rem;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #fecaca;
}

/* Submit button */
#wz-submit {
  width: 100%;
  padding: 11px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .2s;
}

#wz-submit:hover:not(:disabled) { background: #1ebe5b; }
#wz-submit:disabled { opacity: .7; cursor: not-allowed; }

/* Spinner animation */
.wz-spinner { animation: wz-spin .7s linear infinite; }
@keyframes wz-spin { to { transform: rotate(360deg); } }

/* Privacy note */
.wz-privacy {
  text-align: center;
  font-size: .72rem;
  color: #8a8a8a;
  margin: 2px 0 0;
}

/* Success state */
#wz-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 4px;
  gap: 6px;
}

.wz-success-icon {
  width: 52px;
  height: 52px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
}

.wz-success-title {
  font-weight: 700;
  font-size: 1rem;
  color: #075E54;
  margin: 0;
}

.wz-success-subtitle {
  font-size: .85rem;
  color: #555;
  margin: 0;
}

/* Protocol box */
.wz-protocol-box {
  background: #fff;
  border: 1.5px solid #25D366;
  border-radius: 10px;
  padding: 8px 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.wz-protocol-label {
  font-size: .7rem;
  color: #8a8a8a;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.wz-protocol-num {
  font-size: .95rem;
  font-weight: 700;
  color: #075E54;
  font-family: monospace;
  letter-spacing: .05em;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  #wz-widget {
    bottom: 16px;
    right: 16px;
  }
  #wz-panel {
    width: calc(100vw - 32px);
    max-width: 330px;
  }
}
