/* ============================================
   MODERN THEME - SYNCED WITH WEB UI
   Primary: #6366f1 → #8b5cf6 (Indigo → Purple)
   ============================================ */

/* Import Inter Font */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  /* Primary Gradient */
  --primary-start: #6366f1;
  --primary-end: #8b5cf6;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  /* Secondary Gradient */
  --secondary-start: #ec4899;
  --secondary-end: #f43f5e;
  --secondary-gradient: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);

  /* Accent Gradient */
  --accent-start: #06b6d4;
  --accent-end: #0ea5e9;
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);

  /* Status Colors */
  --success: #10b981;
  --success-light: #34d399;
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --danger: #ef4444;
  --danger-light: #f87171;
  --info: #3b82f6;

  /* Accent Colors */
  --purple: #8b5cf6;
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --pink: #ec4899;
  --green: #10b981;
  --orange: #f59e0b;

  /* Background & Surface */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-hover: rgba(99, 102, 241, 0.04);
  --bg-active: rgba(99, 102, 241, 0.08);

  /* Text Colors */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-white: #ffffff;

  /* Border */
  --border-color: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.05);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07),
    0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08),
    0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08),
    0 10px 10px -5px rgba(0, 0, 0, 0.03);
  --shadow-primary: 0 4px 14px rgba(99, 102, 241, 0.25);
  --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 50px;
  --radius-circle: 50%;

  /* Transitions */
  --transition-fast: all 0.15s ease;
  --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE STYLES
   ============================================ */
html {
  font-size: 14px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif !important;
  background: var(--bg-body);
  color: var(--text-primary);
  overflow: hidden;
  letter-spacing: 0.2px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Override AG-Grid font */
[class*="ag-theme-"] {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif !important;
}

/* ============================================
   MAIN APP CONTAINER
   ============================================ */
#app {
  padding: 38px 10px 10px 10px !important;
  background: var(--primary-gradient) !important;
  background-image: linear-gradient(
    135deg,
    #6366f1 0%,
    #8b5cf6 100%
  ) !important;
  min-height: 100vh;
}

#app[data="popup"] {
  padding: 20px !important;
  background: var(--primary-gradient) !important;
  background-image: linear-gradient(
    135deg,
    #6366f1 0%,
    #8b5cf6 100%
  ) !important;
}

#app[data="ads"],
#app[data="bm"],
#app[data="clone"],
#app[data="page"],
#app[data="group"],
#app[data="via"] {
  padding: 38px 10px 10px 10px !important;
  background: var(--primary-gradient) !important;
  background-image: linear-gradient(
    135deg,
    #6366f1 0%,
    #8b5cf6 100%
  ) !important;
}

/* ============================================
   HEADER STYLES
   ============================================ */
#header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 38px;
  color: var(--text-white);
  padding: 0 16px;
  z-index: 100;
  display: flex;
  align-items: center;
}

.header-top {
  height: 38px;
  width: 100%;
}

.header-top a:hover {
  transform: translateY(-1px);
}

.header-bottom {
  height: 40px;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
  width: calc(100vw - 400px);
}

.titleBar {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.appVersion {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

/* Header Navigation Pills - Floating Cards Style */
#header .nav-pills-container,
#header .rounded.row {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 0;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  height: auto;
  gap: 6px;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

#header .nav-pills-container a,
#header .rounded.row a {
  border-radius: 8px !important;
  font-weight: 900;
  font-size: 0.85rem;
  -webkit-text-stroke: 0.3px currentColor;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 7px 18px !important;
  height: 28px;
  line-height: 14px;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 1;
  color: rgba(255, 255, 255, 0.85);
  /* Frosted glass button */
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Gradient border animation on hover */
#header .nav-pills-container a::before,
#header .rounded.row a::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4, #6366f1);
  background-size: 300% 300%;
  z-index: -2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#header .nav-pills-container a::after,
#header .rounded.row a::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.2) 0%,
    rgba(139, 92, 246, 0.1) 100%
  );
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Hover state - gradient border reveal */
#header .nav-pills-container a:not(.active):hover::before,
#header .rounded.row a:not(.bg-white):hover::before {
  opacity: 1;
  animation: gradientShift 2s linear infinite;
}

#header .nav-pills-container a:not(.active):hover::after,
#header .rounded.row a:not(.bg-white):hover::after {
  opacity: 1;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

#header .nav-pills-container a:not(.active):hover,
#header .rounded.row a:not(.bg-white):hover {
  color: #ffffff;
  transform: translateY(-3px) scale(1.02);
  border-color: transparent;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.25),
    0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Active state - Solid gradient background */
#header .nav-pills-container a.active,
#header .rounded.row a.bg-white {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%) !important;
  color: #6366f1 !important;
  font-weight: 700;
  border: none !important;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 -2px 0 rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

/* Active state decorators */
#header .nav-pills-container a.active::before,
#header .rounded.row a.bg-white::before {
  opacity: 0;
}

#header .nav-pills-container a.active::after,
#header .rounded.row a.bg-white::after {
  display: none;
}

/* Press down effect */
#header .nav-pills-container a:active,
#header .rounded.row a:active {
  transform: scale(0.95) translateY(0);
  transition: transform 0.1s ease;
}

/* ============================================
   APP WRAPPER & CARDS
   ============================================ */
.app-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.account-wrapper {
  width: calc(100% - 350px);
  height: calc(100vh - 48px);
}

/* ============================================
   MODERN CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Stats Cards with Icons */
.card .rounded-circle {
  transition: var(--transition-normal);
}

.card:hover .rounded-circle {
  transform: scale(1.05);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  transition: var(--transition-normal);
  border: none;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--primary-gradient);
  box-shadow: var(--shadow-primary);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, #5558e8 0%, #7c4fe6 100%);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
  color: white;
}

.btn-secondary {
  background: var(--bg-body);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Control Buttons */
.control-btn {
  padding: 0 14px 0 10px;
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border-light) !important;
  background: var(--bg-card);
  transition: var(--transition-normal);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.control-btn:hover {
  background: var(--bg-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  border-color: var(--border-color) !important;
}

.control-btn i {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  color: var(--text-white);
  border-radius: 6px;
  font-weight: 400;
  font-size: 12px;
}

/* Icon-only control buttons */
.control-btn.px-2 i {
  margin-right: 0;
  width: 20px;
  height: 20px;
  background: transparent !important;
  color: var(--text-secondary) !important;
  font-size: 18px;
}

.control-btn.px-2:hover i {
  color: var(--primary-start) !important;
}

.control-btn i.ri-play-fill {
  background: none !important;
  color: #10b981 !important;
}

.control-btn i.ri-stop-fill {
  background: none !important;
  color: #ef4444 !important;
}

/* ============================================
   FORM CONTROLS
   ============================================ */
.form-control,
.form-select {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: var(--transition-normal);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-start);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 0.875rem;
}

/* Form Switch - Sleek Minimal Style */
.form-switch .form-check-input {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  border: 2px solid #c7d2e0;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23c7d2e0'/%3e%3c/svg%3e");
  background-position: 2px center;
  background-size: 16px;
  transition: all 0.2s ease-out;
  cursor: pointer;
}

.form-switch .form-check-input:checked {
  border-color: #6366f1;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%236366f1'/%3e%3c/svg%3e");
  background-position: calc(100% - 2px) center;
}

.form-switch .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
  border-color: #6366f1;
}

.form-switch .form-check-input:hover {
  border-color: #a5b4c8;
}

.form-switch .form-check-input:checked:hover {
  border-color: #4f46e5;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%234f46e5'/%3e%3c/svg%3e");
}

/* Checkbox & Radio */
.form-check-input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition-normal);
}

.form-check-input:checked {
  background: var(--primary-gradient);
  border-color: var(--primary-start);
}

.form-check-input[type="radio"] {
  border-radius: var(--radius-circle);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  letter-spacing: 0.3px;
}

.badge.rounded-pill {
  border-radius: var(--radius-pill);
  padding: 4px 10px;
}

.text-bg-primary,
.badge-primary {
  background: var(--primary-gradient) !important;
}

.text-bg-success,
.badge-success {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
}

.text-bg-danger,
.badge-danger {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%) !important;
}

.text-bg-warning,
.badge-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
  color: white !important;
}

.text-bg-info,
.badge-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%) !important;
}

/* ============================================
   PANELS & SIDEBARS
   ============================================ */
#panel,
#adPanel {
  background: var(--bg-body);
  border-left: 1px solid var(--border-light);
}

/* Adjust height to stop above footer bar */
#adPanel {
  top: 98px !important; /* Move up a bit */
  height: calc(
    100% - 153px
  ) !important; /* Adjusted to align with table bottom */
  z-index: 10;
}

/* Footer bar - must be above sidebar */
.account-wrapper > .border-top.p-3.py-2 {
  position: relative;
  z-index: 20;
  font-size: 0.85rem;
}

/* Footer stats labels - make all labels bold */
.account-wrapper
  > .border-top.p-3.py-2
  span
  > span:not(.badge):not(.rounded-circle) {
  font-weight: 600;
}

#adPanel > .flex-grow-1 {
  background: var(--bg-body);
}

/* Panel Cards - Sidebar Options */
#adPanel .card,
[data-tool] .card {
  background: var(--bg-card) !important;
  border: none !important;
  border-radius: var(--radius-lg) !important;
  margin-bottom: 12px;
  overflow: hidden;
  transition: var(--transition-normal);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

#adPanel .card:hover,
[data-tool] .card:hover {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1), 0 2px 4px rgba(0, 0, 0, 0.05) !important;
  transform: translateY(-1px);
}

/* Panel Toggle Headers */
#adPanel .card > .p-3:first-child,
[data-tool] .card > .p-3:first-child {
  background: transparent;
  padding: 16px !important;
}

/* Panel Icons - Simple colored icons without background */
#adPanel .form-check-label i,
[data-tool] .form-check-label i {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  font-size: 20px;
  margin-right: 12px !important;
}

/* Colorful Icons - no background, just colored icon */
#adPanel .card:nth-child(1) .form-check-label i {
  color: #6366f1 !important;
}
#adPanel .card:nth-child(2) .form-check-label i {
  color: #ec4899 !important;
}
#adPanel .card:nth-child(3) .form-check-label i {
  color: #10b981 !important;
}
#adPanel .card:nth-child(4) .form-check-label i {
  color: #f59e0b !important;
}
#adPanel .card:nth-child(5) .form-check-label i {
  color: #06b6d4 !important;
}
#adPanel .card:nth-child(6) .form-check-label i {
  color: #8b5cf6 !important;
}
#adPanel .card:nth-child(7) .form-check-label i {
  color: #ef4444 !important;
}
#adPanel .card:nth-child(8) .form-check-label i {
  color: #3b82f6 !important;
}
#adPanel .card:nth-child(9) .form-check-label i {
  color: #14b8a6 !important;
}
#adPanel .card:nth-child(10) .form-check-label i {
  color: #f97316 !important;
}
#adPanel .card:nth-child(11) .form-check-label i {
  color: #84cc16 !important;
}
#adPanel .card:nth-child(12) .form-check-label i {
  color: #06b6d4 !important;
}
#adPanel .card:nth-child(13) .form-check-label i {
  color: #ec4899 !important;
}
#adPanel .card:nth-child(14) .form-check-label i {
  color: #6366f1 !important;
}
#adPanel .card:nth-child(15) .form-check-label i {
  color: #10b981 !important;
}

/* Toolbar Icons - simple colored style */
.control-btn i.ri-filter-line {
  background: transparent !important;
  color: #6366f1 !important;
}
.control-btn i.ri-menu-add-fill {
  background: transparent !important;
  color: #10b981 !important;
}
.control-btn i.ri-loop-left-fill {
  background: transparent !important;
  color: #3b82f6 !important;
}
.control-btn i.ri-layout-line {
  background: transparent !important;
  color: #8b5cf6 !important;
}
.control-btn i.ri-customer-service-line {
  background: transparent !important;
  color: #f59e0b !important;
}
.control-btn i.ri-equalizer-line {
  background: transparent !important;
  color: #06b6d4 !important;
}
.control-btn i.ri-search-line {
  background: transparent !important;
  color: #ec4899 !important;
}

/* Panel Switch Labels */
#adPanel .form-check-label .fw-bold,
[data-tool] .form-check-label .fw-bold {
  color: var(--text-primary);
  font-weight: 600 !important;
  font-size: 0.9rem;
}

/* Panel Inner Content */
#adPanel .border-top,
[data-tool] .border-top {
  border-color: var(--border-light) !important;
  background: rgba(248, 250, 252, 0.5);
  padding: 16px !important;
}

#foldButton {
  position: absolute;
  width: 24px;
  height: 48px;
  background: var(--bg-card);
  right: 349px;
  top: 50%;
  margin-top: -24px;
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
  font-size: 24px;
  line-height: 48px;
  text-align: left;
  cursor: pointer;
  z-index: 99;
  box-shadow: -4px 0 10px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-light);
  border-right: none;
  transition: var(--transition-normal);
  color: var(--text-secondary);
}

#foldButton:hover {
  color: var(--primary-start);
  background: var(--bg-hover);
}

/* ============================================
   CONTENT AREA
   ============================================ */
#viaPanel {
  background: var(--bg-body) !important;
  padding: 24px !important;
}

/* ============================================
   MODALS
   ============================================ */
.modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  background: var(--bg-body);
  border-bottom: 1px solid var(--border-light);
  padding: 20px 24px;
}

.modal-title {
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  background: var(--bg-body);
  border-top: 1px solid var(--border-light);
  padding: 10px 24px;
}

.btn-close {
  opacity: 0.5;
  transition: var(--transition-normal);
}

.btn-close:hover {
  opacity: 1;
}

/* ============================================
   DROPDOWNS
   ============================================ */
.dropdown-menu {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  animation: fadeInDown 0.2s ease;
}

.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--primary-start);
}

/* ============================================
   TABS
   ============================================ */
.cat-item,
.tool-item,
#addCategory {
  border: 0;
  padding: 12px 24px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  height: 45px;
  display: inline-block;
  background: transparent;
  font-size: 0.875rem;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  position: relative;
  transition: var(--transition-normal);
}

.cat-item.active,
.tool-item.active {
  color: var(--text-primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.cat-item:not(.active):hover,
.tool-item:not(.active):hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* ============================================
   LOADING STATES
   ============================================ */
#loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-circle);
  border: 4px solid var(--border-light);
  border-top-color: var(--primary-start);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#loadingData strong {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-body);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-sm);
  transition: var(--transition-normal);
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================
   CONTEXT MENU
   ============================================ */
#contextMenu,
#contextMenuCategory,
#contextMenuPhoi,
#contextMenuWhatsApp,
#contextMenuInsta {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 9999999 !important;
  position: fixed;
  padding: 8px;
  animation: fadeInScale 0.15s ease;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================
   AVATAR
   ============================================ */
.avatar-letter {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  font-size: 14px;
  font-family: "Inter", sans-serif;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

/* ============================================
   SELECT2 OVERRIDES
   ============================================ */
.select2-container .select2-selection--single {
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition-normal);
}

.select2-container--default .select2-selection--single:focus,
.select2-container--open .select2-selection--single {
  border-color: var(--primary-start);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  line-height: 40px;
  color: var(--text-primary);
  font-weight: 500;
}

.select2-dropdown {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.select2-results__option--selected {
  background: var(--bg-hover) !important;
}

.select2-results__option--highlighted {
  background: var(--primary-gradient) !important;
}

/* ============================================
   SWEETALERT2 OVERRIDES
   ============================================ */
.swal2-popup {
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-xl) !important;
  border: none !important;
  padding: 24px !important;
}

.swal2-title {
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}

.swal2-html-container {
  color: var(--text-secondary) !important;
}

.swal2-confirm {
  background: var(--primary-gradient) !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
  box-shadow: var(--shadow-primary) !important;
}

.swal2-deny {
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
}

.swal2-cancel {
  background: var(--bg-body) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-md) !important;
}

.swal2-container {
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(4px);
}

/* ============================================
   AG-GRID OVERRIDES
   ============================================ */
[class*="ag-theme-"] {
  font-family: "Inter", sans-serif !important;
}

.ag-root-wrapper.ag-layout-normal {
  border: none !important;
  border-radius: var(--radius-lg);
}

.ag-header {
  background: var(--bg-body) !important;
  border-bottom: 1px solid var(--border-light) !important;
}

.ag-header-cell {
  font-weight: 800 !important;
  font-size: 0.86rem !important;
  color: var(--text-secondary);
}

.ag-header-cell-text {
  font-weight: 800 !important;
  font-size: 0.86rem !important;
}

.ag-row {
  border-color: var(--border-light) !important;
  transition: var(--transition-fast);
}

.ag-row:hover {
  background: var(--bg-hover) !important;
}

.ag-row-selected {
  background: var(--bg-active) !important;
}

/* ============================================
   POPUP SPECIFIC STYLES
   ============================================ */
#app[data="popup"] {
  border-radius: var(--radius-xl);
}

#app[data="popup"] .rounded {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl) !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-lg);
}

#app[data="popup"] .border-bottom {
  border-color: var(--border-light) !important;
}

/* Popup Icons - Simple colored icons without background */
#app[data="popup"] strong i {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  font-size: 18px;
}

/* Different colors for each popup menu item - no background */
#app[data="popup"] .border-bottom:nth-child(1) strong i {
  color: #6366f1 !important;
}
#app[data="popup"] .border-bottom:nth-child(2) strong i {
  color: #10b981 !important;
}
#app[data="popup"] .border-bottom:nth-child(3) strong i {
  color: #f59e0b !important;
}
#app[data="popup"] .border-bottom:nth-child(4) strong i {
  color: #3b82f6 !important;
}
#app[data="popup"] .border-bottom:nth-child(5) strong i {
  color: #ec4899 !important;
}
#app[data="popup"] .border-bottom:nth-child(6) strong i {
  color: #06b6d4 !important;
}
#app[data="popup"] .border-bottom:nth-child(7) strong i {
  color: #8b5cf6 !important;
}
#app[data="popup"] .border-bottom:nth-child(8) strong i {
  color: #ef4444 !important;
}

/* Popup Icon Style */
.popup-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.popup-icon i {
  color: white !important;
}

.popup-item {
  transition: var(--transition-fast);
}

.popup-item:hover {
  background: rgba(99, 102, 241, 0.03);
}

/* ============================================
   SETTING PAGE
   ============================================ */
#app[data="setting"] {
  background: var(--bg-card) !important;
  padding: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-primary {
  background: var(--primary-gradient) !important;
}

.bg-gradient-secondary {
  background: var(--secondary-gradient) !important;
}

.bg-gradient-accent {
  background: var(--accent-gradient) !important;
}

.shadow-primary {
  box-shadow: var(--shadow-primary) !important;
}

.hover-lift {
  transition: var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Text Colors using new palette */
.text-primary-new {
  color: var(--primary-start) !important;
}

/* Border helpers */
.border-light-new {
  border-color: var(--border-light) !important;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
[data-bs-theme="dark"] {
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-sidebar: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .card {
  background: var(--bg-card);
  border-color: var(--border-light) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .modal-content {
  background: var(--bg-card);
}

[data-bs-theme="dark"] .dropdown-menu {
  background: var(--bg-card);
  border-color: var(--border-light);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--bg-card);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   NAVIGATION PILLS (HEADER)
   ============================================ */
.nav-pills-container {
  transition: var(--transition-normal);
  flex-wrap: nowrap !important;
  white-space: nowrap;
}

.nav-pills-container .nav-pill {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-pill {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: var(--transition-normal);
  border-radius: var(--radius-sm) !important;
}

.nav-pill:hover:not(.active) {
  background: rgba(255, 255, 255, 0.15);
}

.nav-pill.active {
  color: var(--primary-start) !important;
  background: white !important;
  box-shadow: var(--shadow-md) !important;
}

/* ============================================
   STAT CARDS (HOME PAGE)
   ============================================ */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 20px;
  border: 1px solid var(--border-light);
  transition: var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white !important;
}

.stat-icon.pink {
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  color: white;
}

.stat-icon.purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  color: white;
}

.stat-icon.orange {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: white;
}

.stat-icon.blue {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  color: white;
}

.stat-icon.green {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  color: white;
}

.stat-icon.cyan {
  background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
  color: white;
}

.stat-icon.indigo {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  color: white;
}

.stat-icon.red {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  color: white;
}

/* ============================================
   DATA TABLE CARDS
   ============================================ */
.data-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.data-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.data-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.data-card-body {
  padding: 0;
}

.data-list-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  transition: var(--transition-fast);
}

.data-list-item:last-child {
  border-bottom: none;
}

.data-list-item:hover {
  background: var(--bg-hover);
}

/* ============================================
   INFO ROWS (POPUP & DETAILS)
   ============================================ */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row:hover {
  background: var(--bg-hover);
}

.info-label {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-weight: 500;
}

.info-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  color: white;
  font-size: 14px;
}

.info-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-action {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  transition: var(--transition-normal);
}

.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.quick-action img {
  margin-right: 12px;
}

/* ============================================
   FILTER DROPDOWN
   ============================================ */
.filter-item {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  transition: var(--transition-fast);
  cursor: pointer;
}

.filter-item:hover {
  border-color: var(--primary-start);
  background: var(--bg-hover);
}

.filter-item:last-child {
  margin-bottom: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-circle);
  margin-right: 8px;
}

/* ============================================
   PANEL CARDS (SIDEBAR)
   ============================================ */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.panel-card-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-card-title {
  display: flex;
  align-items: center;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-card-title i {
  margin-right: 10px;
  font-size: 18px;
  color: var(--primary-start);
}

.panel-card-body {
  padding: 16px;
  border-top: 1px solid var(--border-light);
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.status-badge.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.status-badge.info {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  margin-bottom: 16px;
}

/* ============================================
   TOOLBAR STYLES
   ============================================ */
.border-bottom.bg-white {
  background: var(--bg-card) !important;
  border-bottom: 1px solid var(--border-light) !important;
}

/* Search Input */
#search {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-body);
  transition: var(--transition-normal);
}

#search:focus {
  background: var(--bg-card);
  border-color: var(--primary-start);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Luong/Delay Inputs */
input[name="limit"],
input[name="delay"] {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-weight: 600;
}

input[name="limit"]:focus,
input[name="delay"]:focus {
  border-color: var(--primary-start);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ============================================
   STATUS BAR (FOOTER)
   ============================================ */
.status-bar,
body > div:last-child .badge,
#app ~ .fixed-bottom,
.position-fixed.bottom-0 {
  background: var(--primary-gradient);
}

/* ============================================
   FOOTER STATUS BAR - BOTTOM
   ============================================ */
#app > .position-fixed,
.position-fixed.bottom-0.start-0.end-0 {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  padding: 8px 16px !important;
  border-top: none !important;
}

/* Status counts in footer */
#app .position-fixed .badge,
.position-fixed.bottom-0 .badge {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}

/* Footer text colors */
.position-fixed.bottom-0 span,
#app .position-fixed span {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 0.8rem;
}

/* Status Footer Text */
[style*="background: linear-gradient"] .text-success,
.text-success {
  color: #10b981 !important;
}

[style*="background: linear-gradient"] .text-danger,
.text-danger {
  color: #ef4444 !important;
}

[style*="background: linear-gradient"] .text-warning,
.text-warning {
  color: #f59e0b !important;
}

[style*="background: linear-gradient"] .text-info,
.text-info {
  color: #06b6d4 !important;
}

/* ============================================
   AG-GRID TABLE ENHANCEMENTS
   ============================================ */
.ag-root-wrapper {
  border: none !important;
  border-radius: 0 !important;
}

.ag-header {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-bottom: 1px solid var(--border-light) !important;
}

.ag-header-cell {
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
  font-size: 0.8rem !important;
}

.ag-header-cell-label {
  padding: 0 !important;
}

.ag-cell {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
}

.ag-row {
  border-bottom: 1px solid var(--border-light) !important;
}

.ag-row:hover {
  background: rgba(99, 102, 241, 0.04) !important;
}

.ag-row-selected {
  background: rgba(99, 102, 241, 0.08) !important;
}

.ag-row-selected:hover {
  background: rgba(99, 102, 241, 0.12) !important;
}

/* ============================================
   FOOTER STATUS COUNTS
   ============================================ */
.badge.rounded-pill {
  font-weight: 600;
  font-size: 0.7rem;
  padding: 3px 8px;
}

/* Custom Primary Colors for Bootstrap */
.bg-primary {
  background: var(--primary-gradient) !important;
}

.text-primary {
  color: var(--primary-start) !important;
}

.border-primary {
  border-color: var(--primary-start) !important;
}

.btn-outline-primary {
  color: var(--primary-start);
  border-color: var(--primary-start);
}

.btn-outline-primary:hover {
  background: var(--primary-gradient);
  border-color: var(--primary-start);
  color: white;
}

/* ============================================
   TOOLBAR AREA
   ============================================ */
.border-bottom.bg-white .p-3 {
  background: var(--bg-card);
}

.border-end {
  border-color: var(--border-light) !important;
}

/* Input with label overlay */
.position-relative label.position-absolute {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary-start);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   MISC IMPROVEMENTS
   ============================================ */

/* App Version Badge */
.appVersion {
  background: rgba(255, 255, 255, 0.2) !important;
  padding: 3px 10px !important;
  border-radius: 20px !important;
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  backdrop-filter: blur(4px);
}

/* Title Bar */
.titleBar {
  font-size: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.3px;
}

/* Shadow utilities */
.shadow-sm {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.03) !important;
}

.shadow {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07),
    0 2px 4px -1px rgba(0, 0, 0, 0.04) !important;
}

/* Improve rounded corners */
.rounded {
  border-radius: var(--radius-md) !important;
}

.rounded-4 {
  border-radius: var(--radius-lg) !important;
}

/* Fix dropdown shadows */
.dropdown-menu {
  border: 1px solid var(--border-light) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12) !important;
  border-radius: var(--radius-lg) !important;
  padding: 8px !important;
}

.dropdown-item {
  border-radius: var(--radius-sm) !important;
  padding: 8px 12px !important;
  font-weight: 500 !important;
  font-size: 0.85rem !important;
}

.dropdown-item:hover {
  background: rgba(99, 102, 241, 0.08) !important;
  color: var(--primary-start) !important;
}

/* Fix Modal styling */
.modal-content {
  border: none !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border-light) !important;
  padding: 20px 24px !important;
}

.modal-footer {
  border-top: 1px solid var(--border-light) !important;
  padding: 10px 24px !important;
}

/* Better focus states */
.form-control:focus,
.form-select:focus {
  border-color: var(--primary-start) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12) !important;
}

/* Quality indicator in header */
#quality {
  display: flex;
  align-items: center;
}

#quality .badge {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(4px);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
}

/* ============================================
   HOME PAGE - MODERN DASHBOARD STYLING
   ============================================ */

/* Profile Card - Hero Section */
.home-profile-card {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  border-radius: 20px;
  padding: 2px;
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}

.home-profile-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 60%
  );
  animation: shimmer 8s linear infinite;
}

@keyframes shimmer {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.profile-card-inner {
  background: #ffffff;
  border-radius: 18px;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.profile-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar-wrapper {
  position: relative;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-status-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: #10b981;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  letter-spacing: -0.3px;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-uid,
.profile-email {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

.profile-uid {
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 0.8rem;
  color: #8b5cf6;
}

.profile-right {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  padding: 16px 24px;
  border-radius: 14px;
}

.profile-info-box {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
}

.profile-info-box i {
  font-size: 1.3rem;
  opacity: 0.9;
}

.profile-info-box > div {
  display: flex;
  flex-direction: column;
}

.profile-info-box .info-value {
  font-size: 1rem;
  font-weight: 700;
  color: white;
}

.profile-info-box .info-label {
  font-size: 0.75rem;
  opacity: 0.85;
  font-weight: 500;
  color: white;
}

.profile-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.25);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  opacity: 0.05;
  transform: translate(30%, -30%);
}

.stat-card-balance::after {
  background: #ec4899;
}
.stat-card-bm::after {
  background: #8b5cf6;
}
.stat-card-ads::after {
  background: #f59e0b;
}
.stat-card-page::after {
  background: #06b6d4;
}

.stat-icon-wrapper {
  flex-shrink: 0;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4rem;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.stat-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  letter-spacing: -0.5px;
}

.stat-trend {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.stat-trend-up {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

/* Home Content Grid */
.home-content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.home-column {
  display: flex;
  flex-direction: column;
}

/* Home Cards */
.home-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
  height: 411px;
}

.home-card.mb-4 {
  height: 411px;
}

.home-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.home-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.home-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.card-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #6366f1;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.08);
  transition: all 0.2s ease;
}

.card-action-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
}

.home-card-body {
  padding: 20px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  text-align: center;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.empty-icon i {
  font-size: 1.8rem;
  color: #94a3b8;
}

.empty-state p {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* Modern Button */
.btn-modern {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
}

/* Quick Actions Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.quick-action-card {
  background: white;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.quick-action-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
}

/* Ad Details List */
.ad-details-list {
  padding: 0 16px 16px;
}

.ad-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ad-detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 500;
}

.detail-label i {
  color: #6366f1;
  font-size: 1rem;
}

.detail-value {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.9rem;
}

/* Versions List */
.versions-list {
  max-height: 300px;
  overflow-y: auto;
}

.versions-list::-webkit-scrollbar {
  width: 4px;
}

.versions-list::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 2px;
}

.versions-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-content-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .home-content-grid {
    grid-template-columns: 1fr;
  }

  .profile-card-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .profile-left {
    flex-direction: column;
  }

  .profile-right {
    width: 100%;
    justify-content: center;
  }
}
