/* ==========================================================================
   Leonardo WhatsApp Track & URL Shortener — SaaS Client Dashboard
   Premium Dark / Light Interface CSS
   ========================================================================== */

/* ---------------- CSS Variables & Themes ---------------- */
:root {
  /* Brand WhatsApp */
  --wa-primary: #25D366;
  --wa-primary-hover: #20bd5a;
  --wa-dark-green: #128C7E;
  --wa-deep-green: #075E54;
  --wa-light-green: #dcf8c6;

  /* Dark Theme Default Tokens */
  --bg-app: #0b0f19;
  --bg-sidebar: #0e1424;
  --bg-header: rgba(14, 20, 36, 0.85);
  --bg-card: #131b2e;
  --bg-card-hover: #18223a;
  --bg-card-subtle: #162035;
  --bg-input: #1a233a;
  --bg-input-focus: #1e2942;
  --bg-modal: #131b2e;
  --bg-backdrop: rgba(7, 11, 20, 0.75);

  --border-color: #23304d;
  --border-subtle: #1c2740;
  --border-focus: #25D366;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-inverse: #0b0f19;

  /* Accents */
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, Menlo, Courier, monospace;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.4), 0 4px 10px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 35px -5px rgba(0, 0, 0, 0.6);
  --glow-wa: 0 0 20px rgba(37, 211, 102, 0.25);
  --glow-blue: 0 0 20px rgba(59, 130, 246, 0.25);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;

  --sidebar-width: 260px;
  --header-height: 72px;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.88);
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-card-subtle: #f8fafc;
  --bg-input: #f1f5f9;
  --bg-input-focus: #ffffff;
  --bg-modal: #ffffff;
  --bg-backdrop: rgba(15, 23, 42, 0.45);

  --border-color: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-focus: #128C7E;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --text-inverse: #ffffff;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 10px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 35px -5px rgba(0, 0, 0, 0.15);
  --glow-wa: 0 0 20px rgba(37, 211, 102, 0.15);
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

img, svg {
  display: block;
  max-width: 100%;
}

/* ---------------- Scrollbars ---------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ---------------- Global Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--wa-primary) 0%, #1eb956 100%);
  color: #0b0f19;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.28);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #2ae771 0%, var(--wa-primary-hover) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.38);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card-subtle);
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.btn-danger {
  background: var(--accent-danger);
  color: #ffffff;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 13px 24px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------------- Form Controls ---------------- */
.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
}

.form-group-sm {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label-sm {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.label-with-action, .label-with-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.badge-b2b {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--wa-primary);
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.2px;
}

.text-danger {
  color: var(--accent-danger, #ef4444);
}

.form-control, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.form-control-sm, .form-select-sm {
  padding: 6px 10px;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
}

.form-help {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 5px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.input-wrapper .form-control {
  padding-left: 38px;
}

.btn-toggle-pass, .btn-copy-input {
  position: absolute;
  right: 10px;
  color: var(--text-dim);
  padding: 4px;
}
.btn-toggle-pass:hover, .btn-copy-input:hover {
  color: var(--text-main);
}

.input-slug-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}
.input-slug-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}
.slug-domain {
  padding: 10px 12px;
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  border-right: 1px solid var(--border-color);
  white-space: nowrap;
}
.slug-input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: var(--font-mono);
}

/* Custom Checkbox */
.custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}
.checkmark {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all var(--transition-fast);
}
.custom-checkbox input:checked ~ .checkmark {
  background: var(--wa-primary);
  border-color: var(--wa-primary);
}
.custom-checkbox input:checked ~ .checkmark::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #0b0f19;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}
.checkbox-label {
  line-height: 1.4;
}
.checkbox-subtext {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Password Strength Bar */
.password-strength-bar {
  height: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  margin-top: 6px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background 0.3s ease;
}

/* ---------------- Toast Notifications ---------------- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: calc(100% - 40px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  color: var(--text-main);
  animation: toastSlideIn 0.3s ease forwards;
  transition: all 0.25s ease;
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.toast-body {
  flex: 1;
}
.toast-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 2px;
}
.toast-msg {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.toast-close {
  color: var(--text-dim);
  padding: 2px;
}
.toast-close:hover {
  color: var(--text-main);
}

.toast.success { border-left: 4px solid var(--wa-primary); }
.toast.success .toast-icon { color: var(--wa-primary); }
.toast.error { border-left: 4px solid var(--accent-danger); }
.toast.error .toast-icon { color: var(--accent-danger); }
.toast.info { border-left: 4px solid var(--accent-primary); }
.toast.info .toast-icon { color: var(--accent-primary); }
.toast.warning { border-left: 4px solid var(--accent-warning); }
.toast.warning .toast-icon { color: var(--accent-warning); }

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* ---------------- Spinners ---------------- */
.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.btn.loading .spinner {
  display: inline-block;
}
.btn.loading .btn-text {
  display: none;
}
.spinner-lg {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--wa-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================================================================
   AUTH SCREEN STYLES
   ========================================================================= */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(circle at 50% 20%, rgba(37, 211, 102, 0.08) 0%, transparent 60%),
              var(--bg-app);
}

.auth-card-wrapper {
  width: 100%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.brand-logo-icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--wa-primary) 0%, #128C7E 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b0f19;
  box-shadow: var(--glow-wa);
  flex-shrink: 0;
}

.brand-text h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-text h2 span {
  color: var(--wa-primary);
}
.brand-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 28px 24px;
}

.auth-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--border-subtle);
}

.auth-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.auth-tab.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}
.auth-divider span {
  padding: 0 10px;
}

.auth-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

.link-subtle {
  font-size: 0.82rem;
  color: var(--wa-primary);
}
.link-subtle:hover {
  text-decoration: underline;
}

/* =========================================================================
   APP MAIN LAYOUT (SIDEBAR + MAIN CONTENT)
   ========================================================================= */
.app-screen {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-info {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--wa-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.btn-close-sidebar {
  display: none;
  margin-left: auto;
  color: var(--text-muted);
}

.sidebar-action-box {
  padding: 16px 16px 8px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 12px 10px 6px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}
.nav-link:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}
.nav-link.active {
  background: var(--bg-card);
  color: var(--wa-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.nav-icon {
  display: flex;
  align-items: center;
  color: inherit;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 7px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}
.nav-link.active .nav-badge {
  background: rgba(37, 211, 102, 0.15);
  color: var(--wa-primary);
}

.pulse-dot {
  margin-left: auto;
  width: 7px;
  height: 7px;
  background: var(--accent-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-success);
}

/* Sidebar Footer */
.sidebar-user-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-card-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-purple) 100%);
  color: #ffffff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.user-name {
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon-subtle {
  padding: 7px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}
.btn-icon-subtle:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.btn-theme-toggle .icon-sun { display: none; }
.btn-theme-toggle .icon-moon { display: block; }
[data-theme="light"] .btn-theme-toggle .icon-sun { display: block; }
[data-theme="light"] .btn-theme-toggle .icon-moon { display: none; }

/* ---------------- Main Content Area ---------------- */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-mobile-menu {
  display: none;
  color: var(--text-main);
  padding: 6px;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.plan-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--wa-primary);
}
.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--wa-primary);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--wa-primary);
}

.tab-content-wrapper {
  padding: 28px;
  flex: 1;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 24px;
}
.tab-pane.active {
  display: flex;
  animation: fadeIn 0.2s ease forwards;
}

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

/* ---------------- Card Components ---------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* =========================================================================
   TAB 1: ANALYTICS & DASHBOARD STYLES
   ========================================================================= */

/* Filter Toolbar */
.analytics-filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.filter-row-primary {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.btn-group-segmented {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border-subtle);
}
.seg-btn {
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
}
.seg-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.custom-date-box {
  display: flex;
  align-items: center;
  gap: 6px;
}
.date-sep {
  color: var(--text-dim);
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* KPI Metrics Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
}

.kpi-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-green { background: rgba(37, 211, 102, 0.12); color: var(--wa-primary); }
.kpi-blue { background: rgba(59, 130, 246, 0.12); color: var(--accent-primary); }
.kpi-purple { background: rgba(139, 92, 246, 0.12); color: var(--accent-purple); }
.kpi-amber { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); }

.kpi-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kpi-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 2px 0;
  letter-spacing: -0.02em;
}
.kpi-value-text {
  font-size: 1.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* Charts */
.chart-main-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
}

.chart-mode-toggles {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.btn-chart-mode {
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
}
.btn-chart-mode.active {
  background: var(--bg-card);
  color: var(--text-main);
}

.chart-container {
  position: relative;
  height: 320px;
  width: 100%;
}

.grid-2-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.doughnut-chart-wrapper {
  display: flex;
  align-items: center;
  gap: 24px;
}
.doughnut-canvas-box {
  width: 180px;
  height: 180px;
  position: relative;
  flex-shrink: 0;
}
.breakdown-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
}
.breakdown-lbl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.breakdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.breakdown-val {
  color: var(--text-muted);
}
.breakdown-bar {
  height: 5px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.breakdown-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}
.data-table th {
  padding: 10px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:hover td {
  background: var(--bg-card-hover);
}
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.badge-subtle {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 8px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

/* =========================================================================
   TAB 2: MY LINKS MANAGEMENT STYLES
   ========================================================================= */
.links-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.control-search-box {
  flex: 1;
  min-width: 260px;
  position: relative;
}
.control-search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.control-search-box .form-control {
  padding-left: 38px;
}

.control-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.links-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Link Item Card */
.link-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: all var(--transition-fast);
}
.link-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.link-main-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow: hidden;
}

.link-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.link-card-title {
  font-size: 1.05rem;
  font-weight: 700;
}
.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.status-pill.active {
  background: rgba(37, 211, 102, 0.15);
  color: var(--wa-primary);
}
.status-pill.inactive {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
}

.link-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.link-short-url {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-copy-link-inline {
  padding: 3px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-muted);
  gap: 4px;
}
.btn-copy-link-inline:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--text-dim);
}

.link-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.link-phone-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--wa-primary);
  font-weight: 600;
}
.link-msg-snippet {
  color: var(--text-dim);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Link Stats & Actions */
.link-side-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.link-clicks-box {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.clicks-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}
.clicks-lbl {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.link-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-action-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-action-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--text-dim);
}
.btn-action-icon.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
  border-color: var(--accent-danger);
}

/* Empty State Card */
.empty-state-card {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-xl);
  padding: 60px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.empty-icon-circle {
  width: 80px;
  height: 80px;
  background: var(--bg-input);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wa-primary);
  margin-bottom: 8px;
}
.empty-state-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
}
.empty-state-card p {
  color: var(--text-muted);
  max-width: 480px;
  font-size: 0.92rem;
}

.loading-state-card {
  padding: 60px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
}

/* =========================================================================
   TAB 3: INTEGRATIONS & CRM STYLES
   ========================================================================= */
.integrations-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.webhook-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}
.webhook-status-badge.badge-active {
  background: rgba(37, 211, 102, 0.15);
  color: var(--wa-primary);
}
.webhook-status-badge.badge-inactive {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.webhook-form {
  margin-top: 10px;
}
.form-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.webhook-test-result-box {
  margin-top: 20px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.test-title {
  font-weight: 700;
  font-size: 0.9rem;
}
.test-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.metric-item {
  display: flex;
  flex-direction: column;
}
.metric-lbl {
  font-size: 0.74rem;
  color: var(--text-dim);
}
.metric-val {
  font-size: 0.95rem;
  font-weight: 700;
}
.test-body-preview {
  margin-top: 8px;
}
.preview-label {
  font-size: 0.74rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 4px;
}
.preview-code {
  background: var(--bg-input);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  max-height: 120px;
  overflow-y: auto;
}

/* CRM Guides */
.crm-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 18px;
  overflow-x: auto;
}
.crm-tab {
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
}
.crm-tab.active {
  background: var(--wa-primary);
  color: #0b0f19;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.guide-step {
  display: flex;
  gap: 14px;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--wa-primary);
  flex-shrink: 0;
}
.step-text strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 3px;
}
.step-text p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.payload-example-box {
  margin-top: 24px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.payload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.payload-title {
  font-size: 0.84rem;
  font-weight: 600;
}
.json-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-app);
  padding: 14px;
  border-radius: var(--radius-md);
  overflow-x: auto;
}

/* =========================================================================
   TAB 4: BILLING & PRICING STYLES
   ========================================================================= */
.billing-hero-card {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%),
              var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.hero-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--wa-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hero-text h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 4px 0;
}
.hero-text p {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.hero-stats {
  display: flex;
  gap: 16px;
}
.stat-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
}
.stat-lbl {
  font-size: 0.72rem;
  color: var(--text-dim);
}
.stat-val {
  font-size: 1.1rem;
  font-weight: 800;
}

.billing-period-selector {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}
.period-pills-wrap {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px;
}
.period-pill {
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.period-pill.active {
  background: var(--wa-primary);
  color: #0b0f19;
}
.discount-tag {
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--accent-danger);
  color: #ffffff;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}
.period-pill.active .discount-tag {
  background: #0b0f19;
  color: var(--wa-primary);
}

.pricing-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--transition-fast);
}
.pricing-card:hover {
  transform: translateY(-4px);
}
.pricing-card.featured {
  border-color: var(--wa-primary);
  box-shadow: var(--glow-wa);
}
.featured-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--wa-primary);
  color: #0b0f19;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}

.pricing-card-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
  margin-bottom: 20px;
}
.plan-name {
  font-size: 1.25rem;
  font-weight: 800;
}
.plan-for {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.plan-price-wrap {
  margin-top: 14px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.plan-currency {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--wa-primary);
}
.plan-amount {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.plan-period {
  font-size: 0.84rem;
  color: var(--text-dim);
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 26px;
  flex: 1;
}
.plan-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.plan-features li svg {
  color: var(--wa-primary);
  flex-shrink: 0;
}

.payment-guarantee-note {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* =========================================================================
   MODAL DIALOGS
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}
.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  width: 100%;
  max-width: 580px;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
}
.modal-dialog-lg {
  max-width: 720px;
}
.modal-dialog-sm {
  max-width: 420px;
}
.modal-backdrop.show .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-content {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
}
.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-modal-close {
  color: var(--text-dim);
  padding: 4px;
}
.btn-modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-modal);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Quick Emoji Bar */
.quick-emoji-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.emoji-lbl {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-right: 4px;
}
.btn-emoji {
  padding: 4px 6px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}
.btn-emoji:hover {
  background: var(--bg-card-hover);
  transform: scale(1.15);
}

/* UTM Builder Section in Modal */
.utm-builder-section {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.utm-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.utm-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.utm-icon {
  font-size: 1.3rem;
}
.utm-title {
  font-size: 0.95rem;
  font-weight: 700;
}
.utm-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.utm-presets-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.presets-label {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-weight: 600;
}
.btn-preset {
  padding: 4px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}
.btn-preset:hover {
  border-color: var(--wa-primary);
  color: var(--text-main);
}

.utm-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.live-url-preview-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.preview-url-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.preview-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-dim);
}
.btn-copy-sm {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  color: var(--wa-primary);
  font-weight: 600;
}
.preview-url-text {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--wa-primary);
  word-break: break-all;
}

/* QR Code Modal Box */
.qr-code-box {
  background: #ffffff;
  padding: 20px;
  border-radius: var(--radius-xl);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-lg);
}
.qr-canvas-container canvas, .qr-canvas-container img {
  display: block;
}
.qr-badge-logo {
  position: absolute;
  background: #ffffff;
  padding: 4px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.qr-target-url {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.qr-download-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================= */
@media (max-width: 1080px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pricing-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .btn-close-sidebar {
    display: block;
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-backdrop);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
  }
  .sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
  }

  .app-main {
    margin-left: 0;
  }
  .btn-mobile-menu {
    display: block;
  }
  .grid-2-col {
    grid-template-columns: 1fr;
  }
  .link-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .link-side-controls {
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid var(--border-subtle);
    padding-top: 14px;
  }
  .link-clicks-box {
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .tab-content-wrapper {
    padding: 16px;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .form-row-2, .utm-inputs-grid {
    grid-template-columns: 1fr;
  }
  .doughnut-chart-wrapper {
    flex-direction: column;
  }
  .header-right .plan-status-pill {
    display: none;
  }
}
