/* =====================================================
   SMM PANEL — CLEAN MINIMAL DESIGN SYSTEM
   ===================================================== */

/* --- CSS Variables / Theme --- */
:root {
  /* Colors */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-active: #eef2ff;
  --bg-input: #ffffff;
  --bg-badge: #f1f5f9;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* Accent */
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #eef2ff;
  --accent-rgb: 99, 102, 241;

  /* Status */
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #3b82f6;
  --info-light: #eff6ff;
  --pending: #8b5cf6;
  --pending-light: #f5f3ff;

  /* Borders */
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: var(--accent);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 64px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* =====================================================
   DARK MODE
   ===================================================== */
[data-theme="dark"] {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-sidebar: #141620;
  --bg-card: #1a1d27;
  --bg-hover: #252836;
  --bg-active: #1e2235;
  --bg-input: #1a1d27;
  --bg-badge: #252836;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-light: #1e2235;
  --accent-rgb: 129, 140, 248;

  --success: #34d399;
  --success-light: #0d2818;
  --warning: #fbbf24;
  --warning-light: #2d2305;
  --danger: #f87171;
  --danger-light: #2d1010;
  --info: #60a5fa;
  --info-light: #0d1b2e;
  --pending: #a78bfa;
  --pending-light: #1c1530;

  --border: #2a2d3a;
  --border-light: #1f2231;
  --border-focus: var(--accent);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px 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 15px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.2);

  color-scheme: dark;
}

/* Dark mode — body & background */
[data-theme="dark"] body {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Dark mode — sidebar */
[data-theme="dark"] .sidebar {
  background: var(--bg-sidebar);
  border-color: var(--border);
}

[data-theme="dark"] .sidebar-header {
  border-color: var(--border);
}

[data-theme="dark"] .sidebar-footer {
  border-color: var(--border);
}

[data-theme="dark"] #sidebarServiceSearch {
  background: var(--bg-input) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

/* Dark mode — topbar */
[data-theme="dark"] .topbar {
  background: rgba(15, 17, 23, 0.85);
  border-color: var(--border);
}

[data-theme="dark"] .page-title {
  color: var(--text-primary);
}

/* Dark mode — cards */
[data-theme="dark"] .card {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .card-header {
  border-color: var(--border);
}

/* Dark mode — tables */
[data-theme="dark"] .table > thead > tr > th {
  background: var(--bg-hover) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .table > tbody > tr > td {
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .table > tbody > tr:hover {
  background: var(--bg-hover) !important;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
  background: rgba(255,255,255,0.02);
}

/* Dark mode — forms (content area) */
[data-theme="dark"] .content-wrapper .form-control {
  background-color: var(--bg-input) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .content-wrapper .form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15) !important;
}

[data-theme="dark"] .content-wrapper label:not(.label):not(.badge),
[data-theme="dark"] .content-wrapper .control-label {
  color: var(--text-primary) !important;
}

/* Dark mode — dropdowns */
[data-theme="dark"] .dropdown-menu-custom {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .dropdown-item:hover {
  background: var(--bg-hover);
}

/* Dark mode — alerts */
[data-theme="dark"] .alert-success { background: var(--success-light); color: var(--success); }
[data-theme="dark"] .alert-danger { background: var(--danger-light); color: var(--danger); }
[data-theme="dark"] .alert-warning { background: var(--warning-light); color: var(--warning); }
[data-theme="dark"] .alert-info { background: var(--info-light); color: var(--info); }

/* Dark mode — buttons */
[data-theme="dark"] .btn-default,
[data-theme="dark"] .btn-outline {
  background: var(--bg-hover);
  border-color: var(--border);
  color: var(--text-primary);
}

[data-theme="dark"] .btn-default:hover,
[data-theme="dark"] .btn-outline:hover {
  background: var(--bg-active);
}

/* Dark mode — well */
[data-theme="dark"] .well {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}

/* Dark mode — balance badge */
[data-theme="dark"] .balance-badge {
  background: var(--bg-hover);
  border-color: var(--border);
}

/* Dark mode — pagination */
[data-theme="dark"] .pagination > li > a,
[data-theme="dark"] .pagination > li > span {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-theme="dark"] .pagination > li.active > a {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Dark mode — nav pills / tabs */
[data-theme="dark"] .nav-pills > li > a,
[data-theme="dark"] .nav-tabs > li > a {
  color: var(--text-secondary);
}

[data-theme="dark"] .nav-tabs {
  border-color: var(--border);
}

/* Dark mode — guest layout */
[data-theme="dark"] .guest-wrapper {
  background: #0f1117;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(129,140,248,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(129,140,248,0.04) 0%, transparent 60%);
}

[data-theme="dark"] .guest-navbar {
  background: rgba(15, 17, 23, 0.92);
  border-color: var(--border);
}

[data-theme="dark"] .auth-card {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 2px 4px rgba(0,0,0,0.2),
    0 12px 32px rgba(0,0,0,0.4);
}

[data-theme="dark"] .auth-card .form-control {
  background: var(--bg-input) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .auth-card .form-control:focus {
  border-color: var(--accent) !important;
  background: var(--bg-primary) !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15) !important;
}

[data-theme="dark"] .auth-card .auth-title {
  color: var(--text-primary);
}

[data-theme="dark"] .auth-card .form-group label {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .auth-card .btn-primary {
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(var(--accent-rgb), 0.3);
}

[data-theme="dark"] .auth-card .btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.35);
}

/* Dark mode — modal */
[data-theme="dark"] .modal-content {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}

/* Dark mode — input group */
[data-theme="dark"] .content-wrapper .input-group-addon {
  background: var(--bg-hover) !important;
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
}

[data-theme="dark"] .content-wrapper .input-group-btn .btn {
  border-color: var(--border) !important;
}

/* Dark mode — sidebar overlay */
[data-theme="dark"] .sidebar-overlay {
  background: rgba(0, 0, 0, 0.6);
}

/* Dark mode — user avatar */
[data-theme="dark"] .user-avatar {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Dark mode — currency / lang button */
[data-theme="dark"] .currency-btn,
[data-theme="dark"] .lang-btn {
  color: var(--text-secondary);
  border-color: var(--border);
}

/* Dark mode toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  transition: opacity 0.2s, transform 0.3s;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

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

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* =====================================================
   TYPOGRAPHY
   ===================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0.5em;
}

h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }

.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}


/* =====================================================
   LAYOUT — AUTHENTICATED (SIDEBAR + TOPBAR)
   ===================================================== */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: width var(--transition-base), transform var(--transition-base);
  overflow: hidden;
}

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

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-logo img {
  height: 32px;
  width: auto;
  flex-shrink: 0;
}

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

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 8px 12px 6px;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-link.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-link i,
.nav-link .nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.nav-link:hover i,
.nav-link:hover .nav-icon,
.nav-link.active i,
.nav-link.active .nav-icon {
  opacity: 1;
}

.nav-link .nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar Search Results */
.sidebar-search-item:hover {
  background: var(--bg-hover) !important;
}
#sidebarSearchResults {
  scrollbar-width: thin;
}
#sidebarSearchResults::-webkit-scrollbar {
  width: 4px;
}
#sidebarSearchResults::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* --- Topbar --- */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 1030;
  transition: left var(--transition-base);
}

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

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
}

/* Balance Badge */
.balance-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.balance-badge:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
  text-decoration: none;
  color: var(--text-primary);
}

.balance-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
}

.user-avatar:hover {
  border-color: var(--accent);
}

/* Currency Dropdown */
.currency-dropdown {
  position: relative;
}

.currency-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.currency-btn:hover {
  border-color: var(--text-muted);
}

/* Dropdown Menus */
.dropdown-menu-custom {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
  z-index: 1050;
}

.dropdown-menu-custom.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu-custom .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.dropdown-menu-custom .dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.dropdown-menu-custom .dropdown-item.active {
  background: var(--accent-light);
  color: var(--accent);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* --- Main Content Area --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
  transition: margin-left var(--transition-base);
  min-height: 100vh;
}

.content-wrapper {
  padding: 28px;
  max-width: 1400px;
  animation: fadeInUp 0.4s ease;
}

/* --- Sidebar Collapsed State --- */
.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar .nav-label,
.sidebar-collapsed .sidebar .nav-section-title,
.sidebar-collapsed .sidebar .sidebar-logo span {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-collapsed .topbar {
  left: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}


/* =====================================================
   LAYOUT — GUEST (CENTERED)
   ===================================================== */

.guest-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f0f2f5;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(99,102,241,0.05) 0%, transparent 60%);
}

.guest-navbar {
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.guest-navbar-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.guest-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.guest-nav-links li {
  list-style: none;
}

.guest-nav-links a {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.guest-nav-links a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.guest-nav-links .active a {
  color: var(--accent);
  background: var(--accent-light);
}

.guest-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* Language Dropdown */
.lang-dropdown {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}


/* =====================================================
   CARDS
   ===================================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
}

.card-header h3,
.card-header .card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.card-body {
  padding: 22px;
}

.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

/* Stat Cards */
.stat-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition-base);
}

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

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-icon.accent {
  background: var(--accent-light);
  color: var(--accent);
}

.stat-icon.success {
  background: var(--success-light);
  color: var(--success);
}

.stat-icon.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.stat-icon.danger {
  background: var(--danger-light);
  color: var(--danger);
}

.stat-icon.info {
  background: var(--info-light);
  color: var(--info);
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}


/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  font-family: var(--font-family);
  line-height: 1.5;
}

.btn:active {
  transform: scale(0.97);
}

/* Primary */
.btn-primary,
.btn-default {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}

.btn-primary:hover,
.btn-default:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--text-inverse);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

/* Secondary / Outline */
.btn-secondary,
.btn-outline {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover,
.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Success */
.btn-success {
  background: var(--success);
  color: var(--text-inverse);
  border-color: var(--success);
}

.btn-success:hover {
  background: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: var(--text-inverse);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Warning */
.btn-warning {
  background: var(--warning);
  color: var(--text-inverse);
  border-color: var(--warning);
}

/* Info */
.btn-info {
  background: var(--info);
  color: var(--text-inverse);
  border-color: var(--info);
}

/* Sizes */
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

/* Button with ripple effect */
.btn .btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}


/* =====================================================
   FORMS
   ===================================================== */

.form-group {
  margin-bottom: 18px;
}

.form-label,
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-control,
.form-select,
select.form-control {
  width: 100%;
  padding: 9px 14px;
  font-size: 14px;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
  line-height: 1.5;
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus,
.form-select:focus,
select.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:disabled,
.form-control[readonly] {
  background: var(--bg-primary);
  color: var(--text-muted);
  cursor: not-allowed;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Select dropdown arrow */
select.form-control,
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

/* Input Group */
.input-group {
  position: relative;
  display: flex;
}

.input-group .form-control {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group-btn .btn,
.input-group .input-group-append .btn {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-left: none;
}

.input-group-addon {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  font-size: 13px;
  color: var(--text-muted);
}

.input-group-addon + .form-control {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Help text */
.help-block {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Checkbox & Radio */
.checkbox-custom,
.radio-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}

.checkbox-custom input,
.radio-custom input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Form Auth Card */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.03),
    0 2px 4px rgba(0,0,0,0.04),
    0 12px 32px rgba(0,0,0,0.08);
  padding: 44px 40px;
  animation: fadeInUp 0.5s ease;
}

.auth-card .form-group {
  margin-bottom: 18px;
}

.auth-card .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}

.auth-card .form-control {
  width: 100%;
  display: block;
  padding: 11px 14px;
  font-size: 14px;
  color: #0f172a;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
}

.auth-card .form-control:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.auth-card .form-control::placeholder {
  color: #94a3b8;
}

.auth-card .btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #6366f1;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(99,102,241,0.3);
}

.auth-card .btn-primary:hover {
  background: #4f46e5;
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
  transform: translateY(-1px);
}

.auth-card .btn-primary:active {
  transform: translateY(0);
}

.auth-card .auth-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  color: #0f172a;
  margin-bottom: 6px;
}

.auth-card .auth-subtitle {
  text-align: center;
  color: #64748b;
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}


/* =====================================================
   TABLES
   ===================================================== */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table thead th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: left;
}

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--bg-hover);
}

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

/* Table with no border variant */
.table-clean {
  border: none;
}

.table-clean thead th {
  background: transparent;
  border-bottom: 2px solid var(--border);
}


/* =====================================================
   STATUS BADGES
   ===================================================== */

.badge,
.label {
  display: inline;
  padding: 2px 6px;
  font-size: 75%;
  font-weight: 700;
  border-radius: 2px;
  white-space: nowrap;
  line-height: 1;
  text-align: center;
  vertical-align: baseline;
  background: transparent;
  color: inherit;
}

.badge-primary, .label-primary {
  background: #6366f1;
  color: #fff !important;
}

.badge-success, .label-success {
  background: #10b981;
  color: #fff !important;
}

.badge-warning, .label-warning {
  background: #f59e0b;
  color: #fff !important;
}

.badge-danger, .label-danger {
  background: #ef4444;
  color: #fff !important;
}

.badge-info, .label-info {
  background: #3b82f6;
  color: #fff !important;
}

.badge-pending, .label-default {
  background: #6b7280;
  color: #fff !important;
}

.badge-muted {
  background: #e2e8f0;
  color: #64748b !important;
}

/* Status dot indicator */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.online { background: var(--success); }
.status-dot.pending { background: var(--warning); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.error { background: var(--danger); }

.status-dot.pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}


/* =====================================================
   TABS & PILLS
   ===================================================== */

.nav-tabs-custom {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

.nav-tabs-custom .tab-item {
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-tabs-custom .tab-item:hover {
  color: var(--text-primary);
}

.nav-tabs-custom .tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-pills-custom {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.nav-pills-custom .pill-item {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-pills-custom .pill-item.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}


/* =====================================================
   ALERTS / NOTIFICATIONS
   ===================================================== */

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid transparent;
  animation: fadeIn 0.3s ease;
}

.alert-success {
  background: var(--success-light);
  color: #065f46;
  border-color: #a7f3d0;
}

.alert-danger {
  background: var(--danger-light);
  color: #991b1b;
  border-color: #fecaca;
}

.alert-warning {
  background: var(--warning-light);
  color: #92400e;
  border-color: #fde68a;
}

.alert-info {
  background: var(--info-light);
  color: #1e40af;
  border-color: #bfdbfe;
}

/* Toast Notification */
#notify-wrapper {
  position: fixed !important;
  top: 20px;
  right: 20px;
  z-index: 9999 !important;
  min-width: 300px;
  max-width: 420px;
  padding: 14px 20px !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-xl) !important;
  animation: slideInRight 0.4s ease !important;
  font-size: 13.5px;
  border: 1px solid var(--border) !important;
}


/* =====================================================
   PAGINATION
   ===================================================== */

.pagination {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.pagination li a,
.pagination li span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.pagination li a:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
  text-decoration: none;
}

.pagination li.active a,
.pagination li.active span {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}

.pagination li.disabled a,
.pagination li.disabled span {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.5;
}


/* =====================================================
   MODAL / PANEL OVERRIDES
   ===================================================== */

.modal-content {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-header .modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-backdrop.in {
  opacity: 0.4;
}


/* =====================================================
   PANELS (Bootstrap override)
   ===================================================== */

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  margin-bottom: 20px;
}

.panel-default {
  border-color: var(--border);
}

.panel-heading {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.panel-body {
  padding: 22px;
}

.panel-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}


/* =====================================================
   EMPTY STATE
   ===================================================== */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  max-width: 360px;
  margin: 0 auto 20px;
}


/* =====================================================
   SERVICE LIST
   ===================================================== */

.service-category {
  margin-bottom: 8px;
}

.service-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 600;
  font-size: 14px;
}

.service-category-header:hover {
  background: var(--bg-hover);
}

.service-row {
  display: grid;
  grid-template-columns: 60px 1fr 100px 100px 100px 120px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  transition: background var(--transition-fast);
}

.service-row:hover {
  background: var(--bg-hover);
}

.service-id {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
}

.service-name {
  font-weight: 500;
  color: var(--text-primary);
}

.service-rate {
  font-weight: 600;
  color: var(--accent);
}


/* =====================================================
   TICKET / CHAT
   ===================================================== */

.ticket-message {
  padding: 18px;
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  animation: fadeIn 0.3s ease;
}

.ticket-message.user-message {
  background: var(--accent-light);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  margin-left: 40px;
}

.ticket-message.admin-message {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  margin-right: 40px;
}

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


/* =====================================================
   FAQ ACCORDION
   ===================================================== */

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}

.faq-item:hover {
  box-shadow: var(--shadow-sm);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  background: transparent;
  transition: background var(--transition-fast);
}

.faq-question:hover {
  background: var(--bg-hover);
}

.faq-question .faq-icon {
  transition: transform var(--transition-base);
  color: var(--text-muted);
}

.faq-item.open .faq-question .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
  animation: fadeIn 0.3s ease;
}


/* =====================================================
   BLOG
   ===================================================== */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

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

.blog-card-body {
  padding: 20px;
}

.blog-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.blog-card-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.blog-card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}


/* =====================================================
   AFFILIATE
   ===================================================== */

.affiliate-link-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.affiliate-link-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}


/* =====================================================
   GRID SYSTEM (supplementary)
   ===================================================== */

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }


/* =====================================================
   UTILITIES
   ===================================================== */

.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }

.bg-accent-light { background: var(--accent-light) !important; }
.bg-success-light { background: var(--success-light) !important; }
.bg-danger-light { background: var(--danger-light) !important; }
.bg-warning-light { background: var(--warning-light) !important; }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.fs-sm { font-size: 12px; }
.fs-md { font-size: 14px; }
.fs-lg { font-size: 16px; }
.fs-xl { font-size: 20px; }

.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-0 { padding: 0 !important; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.cursor-pointer { cursor: pointer; }

.w-full { width: 100%; }

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}


/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

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

/* Animation classes */
.animate-fade-in { animation: fadeIn 0.4s ease; }
.animate-fade-in-up { animation: fadeInUp 0.4s ease; }
.animate-fade-in-down { animation: fadeInDown 0.3s ease; }
.animate-slide-in-left { animation: slideInLeft 0.4s ease; }
.animate-slide-in-right { animation: slideInRight 0.4s ease; }
.animate-scale-in { animation: scaleIn 0.3s ease; }

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border-light) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Hover effects */
.hover-lift {
  transition: all var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Page transition */
.page-enter {
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}


/* =====================================================
   RESPONSIVE
   ===================================================== */

/* Mobile overlay for sidebar */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1035;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  backdrop-filter: blur(4px);
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 20px;
}

@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .topbar {
    left: 0;
  }

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

  .mobile-menu-btn {
    display: flex;
  }

  .sidebar-toggle {
    display: none;
  }

  .content-wrapper {
    padding: 20px 16px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-row {
    grid-template-columns: 50px 1fr 80px 80px;
  }

  .service-row > :nth-child(5),
  .service-row > :nth-child(6) {
    display: none;
  }
}

@media (max-width: 767px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 28px 20px;
    border-radius: var(--radius-lg);
  }

  .guest-navbar {
    padding: 0 16px;
  }

  .topbar {
    padding: 0 16px;
  }

  .content-wrapper {
    padding: 16px 12px;
  }

  .card-body,
  .panel-body {
    padding: 16px;
  }

  .table {
    font-size: 12px;
  }

  .table thead th,
  .table tbody td {
    padding: 10px 12px;
  }

  .ticket-message.user-message {
    margin-left: 16px;
  }

  .ticket-message.admin-message {
    margin-right: 16px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .balance-badge span:not(.balance-amount) {
    display: none;
  }

  .topbar-right .btn span {
    display: none;
  }

  h1, .page-title {
    font-size: 20px;
  }

  .stat-value {
    font-size: 22px;
  }
}


/* =====================================================
   RTL SUPPORT
   ===================================================== */

[dir="rtl"] .sidebar,
.rtl .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--border);
}

[dir="rtl"] .topbar,
.rtl .topbar {
  left: 0;
  right: var(--sidebar-width);
}

[dir="rtl"] .main-content,
.rtl .main-content {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

[dir="rtl"] .nav-link.active::before,
.rtl .nav-link.active::before {
  left: auto;
  right: 0;
  border-radius: 3px 0 0 3px;
}

[dir="rtl"] select.form-control,
[dir="rtl"] .form-select,
.rtl select.form-control,
.rtl .form-select {
  background-position: left 12px center;
  padding-right: 14px;
  padding-left: 36px;
}

@media (max-width: 991px) {
  [dir="rtl"] .sidebar,
  .rtl .sidebar {
    transform: translateX(100%);
  }

  [dir="rtl"] .sidebar.mobile-open,
  .rtl .sidebar.mobile-open {
    transform: translateX(0);
  }

  [dir="rtl"] .topbar,
  .rtl .topbar {
    right: 0;
  }

  [dir="rtl"] .main-content,
  .rtl .main-content {
    margin-right: 0;
  }
}


/* =====================================================
   BOOTSTRAP OVERRIDES
   ===================================================== */

.container-fluid {
  padding-left: 0;
  padding-right: 0;
}

.well {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: none;
}

.close {
  opacity: 0.5;
  font-weight: 400;
  font-size: 20px;
  transition: opacity var(--transition-fast);
}

.close:hover {
  opacity: 1;
}

/* Override Bootstrap default navbar */
.navbar {
  margin-bottom: 0;
  border: none;
  box-shadow: none;
  min-height: auto;
}

.navbar-default {
  background: transparent;
  border: none;
}

/* Override Bootstrap panels */
.panel-default > .panel-heading {
  background-color: transparent;
  color: var(--text-primary);
}

/* Tooltip override */
.tooltip-inner {
  background: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
}

/* Progress bar */
.progress {
  height: 6px;
  background: var(--bg-primary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
   ORDER NAV BUTTONS & CATEGORY CHIPS
   ===================================================== */
.order-nav-btn:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}
.order-nav-btn.active {
  background: var(--accent) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.35);
}
.order-nav-btn.active:hover {
  background: var(--accent-hover) !important;
}

.category-chip:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-light) !important;
}
.category-chip.active {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  color: #fff !important;
}

/* =====================================================
   BOOTSTRAP 3 OVERRIDES — TARGETED FIX
   Only overrides what's needed, doesn't touch sidebar/nav
   ===================================================== */

/* --- Content area text readability --- */
.content-wrapper,
.card-body,
.card-body p,
.card-body div:not(.badge):not(.label),
.well,
.panel-body {
  color: #0f172a;
}

/* --- Form controls — visible borders & dark text --- */
.content-wrapper .form-control,
.content-wrapper select.form-control,
.content-wrapper input.form-control,
.content-wrapper textarea.form-control {
  color: #0f172a !important;
  background-color: #fff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  height: auto !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
}

.content-wrapper .form-control:focus,
.content-wrapper select.form-control:focus,
.content-wrapper input.form-control:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1) !important;
  outline: none !important;
}

.content-wrapper .form-control::placeholder {
  color: #94a3b8 !important;
}

.content-wrapper .form-control:disabled,
.content-wrapper .form-control[readonly] {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
}

/* --- Form labels (NOT .label badges) --- */
.content-wrapper label:not(.label):not(.badge),
.content-wrapper .control-label,
.content-wrapper .form-label {
  color: #0f172a !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  margin-bottom: 6px !important;
}

/* --- Select arrow (content area only) --- */
.content-wrapper select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 16px !important;
  padding-right: 36px !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* --- Tables (content area only) --- */
.content-wrapper .table > thead > tr > th {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0 !important;
  padding: 12px 16px;
}

.content-wrapper .table > tbody > tr > td {
  color: #0f172a;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  vertical-align: middle;
}

.content-wrapper .table > tbody > tr:hover {
  background: #f8fafc;
}

/* --- Alerts --- */
.alert { border: none !important; border-radius: 10px; padding: 14px 18px; font-size: 14px; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info { background: #eff6ff; color: #1e40af; }

/* --- Well (Bootstrap 3) --- */
.well {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  color: #0f172a;
  padding: 20px;
}

/* --- Input Group Fix --- */
.content-wrapper .input-group .form-control {
  border-radius: 8px 0 0 8px !important;
}
.content-wrapper .input-group-btn .btn {
  border-radius: 0 8px 8px 0 !important;
  border: 1.5px solid #cbd5e1 !important;
  border-left: none !important;
}
.content-wrapper .input-group-addon {
  border: 1.5px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #64748b;
}

/* =====================================================
   DARK MODE — BOOTSTRAP 3 OVERRIDE PATCHES
   ===================================================== */
[data-theme="dark"] .content-wrapper,
[data-theme="dark"] .card-body,
[data-theme="dark"] .card-body p,
[data-theme="dark"] .card-body div:not(.badge):not(.label),
[data-theme="dark"] .well,
[data-theme="dark"] .panel-body {
  color: var(--text-primary);
}

[data-theme="dark"] .content-wrapper .form-control,
[data-theme="dark"] .content-wrapper select.form-control,
[data-theme="dark"] .content-wrapper input.form-control,
[data-theme="dark"] .content-wrapper textarea.form-control {
  color: var(--text-primary) !important;
  background-color: var(--bg-input) !important;
  border-color: var(--border) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15) !important;
}

[data-theme="dark"] .content-wrapper .form-control:focus,
[data-theme="dark"] .content-wrapper select.form-control:focus,
[data-theme="dark"] .content-wrapper input.form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.15) !important;
}

[data-theme="dark"] .content-wrapper .form-control:disabled,
[data-theme="dark"] .content-wrapper .form-control[readonly] {
  background: var(--bg-hover) !important;
  color: var(--text-muted) !important;
}

[data-theme="dark"] .content-wrapper label:not(.label):not(.badge),
[data-theme="dark"] .content-wrapper .control-label,
[data-theme="dark"] .content-wrapper .form-label {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .content-wrapper select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E") !important;
}

[data-theme="dark"] .content-wrapper .table > thead > tr > th {
  color: var(--text-muted);
  background: var(--bg-hover);
  border-color: var(--border) !important;
}

[data-theme="dark"] .content-wrapper .table > tbody > tr > td {
  color: var(--text-primary);
  border-color: var(--border);
}

[data-theme="dark"] .content-wrapper .table > tbody > tr:hover {
  background: var(--bg-hover);
}

[data-theme="dark"] .alert-success { background: var(--success-light); color: var(--success); }
[data-theme="dark"] .alert-danger { background: var(--danger-light); color: var(--danger); }
[data-theme="dark"] .alert-warning { background: var(--warning-light); color: var(--warning); }
[data-theme="dark"] .alert-info { background: var(--info-light); color: var(--info); }

[data-theme="dark"] .well {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}

[data-theme="dark"] .content-wrapper .input-group .form-control {
  border-color: var(--border) !important;
}
[data-theme="dark"] .content-wrapper .input-group-btn .btn {
  border-color: var(--border) !important;
  background: var(--bg-hover);
  color: var(--text-primary);
}
[data-theme="dark"] .content-wrapper .input-group-addon {
  border-color: var(--border) !important;
  background: var(--bg-hover) !important;
  color: var(--text-muted);
}

/* Dark — scrollbar */
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--border);
}

/* Dark — text-muted helper */
[data-theme="dark"] .text-muted {
  color: var(--text-muted) !important;
}
