/* ==========================================================================
   APPMIO SMM PANEL - DESIGN SYSTEM & THEME TOKENS
   Spec: UI_UX_SPECIFICATION_SMM_APPMIO.md
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700;800;900&display=swap');

/* --- 1. DESIGN TOKENS & CSS VARIABLES --- */
:root {
  /* LIGHT MODE (Mặc định) */
  --background: #f0f8fa;
  --foreground: #102a31;
  --card: #ffffff;
  --card-foreground: #102a31;
  --popover: #ffffff;
  --popover-foreground: #102a31;
  
  /* Primary & Brand */
  --primary: #0891b2;                /* Cyan 600 */
  --primary-foreground: #ffffff;
  --brand-2: #14b8a6;                /* Teal 500 */
  --brand-3: #0e7490;                /* Cyan 700 */
  --primary-soft: rgba(8, 145, 178, 0.12);
  --primary-glow: rgba(8, 145, 178, 0.35);

  /* Neutral & Borders */
  --muted: rgba(16, 42, 49, 0.05);
  --muted-foreground: #5b6779;
  --subtle-foreground: #6b7894;
  --border: rgba(16, 42, 49, 0.11);
  --border-strong: rgba(16, 42, 49, 0.18);
  --input: rgba(16, 42, 49, 0.16);
  --ring: rgba(8, 145, 178, 0.55);

  /* Sidebar Tokens */
  --sidebar: #ffffff;
  --sidebar-foreground: #102a31;
  --sidebar-primary: #0891b2;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: rgba(8, 145, 178, 0.12);
  --sidebar-accent-foreground: #0891b2;
  --sidebar-border: rgba(16, 42, 49, 0.09);

  /* Semantic Status Colors */
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.12);
  --info: #0284c7;
  --info-soft: rgba(2, 132, 199, 0.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);

  /* Radius */
  --radius: 0.625rem; /* 10px */

  /* Overrides for Bootstrap / Velzon compatibility */
  --vz-primary: var(--primary);
  --vz-primary-rgb: 8, 145, 178;
  --vz-body-bg: var(--background);
  --vz-body-color: var(--foreground);
  --vz-card-bg: var(--card);
  --vz-border-color: var(--border);
}

/* DARK MODE */
:root.dark, :root .dark, [data-bs-theme="dark"] {
  --background: #071518;             /* Nền tối sâu thẳm tông lục đen */
  --foreground: #e6f7fa;
  --card: #0d2126;
  --card-foreground: #e6f7fa;
  --popover: #0d2126;
  --popover-foreground: #e6f7fa;

  --primary: #22d3ee;                /* Cyan 400 */
  --primary-foreground: #071518;
  --brand-2: #2dd4bf;
  --brand-3: #0891b2;
  --primary-soft: rgba(34, 211, 238, 0.18);
  --primary-glow: rgba(34, 211, 238, 0.4);

  --muted: rgba(230, 247, 250, 0.07);
  --muted-foreground: rgba(230, 247, 250, 0.65);
  --subtle-foreground: rgba(230, 247, 250, 0.5);
  --border: rgba(230, 247, 250, 0.12);
  --border-strong: rgba(230, 247, 250, 0.20);
  --input: rgba(230, 247, 250, 0.16);
  --ring: rgba(34, 211, 238, 0.7);

  --sidebar: #0a1b1f;
  --sidebar-foreground: #e6f7fa;
  --sidebar-primary: #22d3ee;
  --sidebar-accent: rgba(34, 211, 238, 0.18);
  --sidebar-accent-foreground: #22d3ee;
  --sidebar-border: rgba(230, 247, 250, 0.09);

  /* Status Colors Dark */
  --success-soft: rgba(16, 185, 129, 0.2);
  --info-soft: rgba(2, 132, 199, 0.2);
  --warning-soft: rgba(245, 158, 11, 0.2);
  --danger-soft: rgba(239, 68, 68, 0.2);

  /* Overrides for Bootstrap / Velzon compatibility */
  --vz-primary: var(--primary);
  --vz-primary-rgb: 34, 211, 238;
  --vz-body-bg: var(--background);
  --vz-body-color: var(--foreground);
  --vz-card-bg: var(--card);
  --vz-border-color: var(--border);
}

/* --- 2. GLOBAL RESET & BASE STYLES --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  background-color: var(--background) !important;
  color: var(--foreground) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
  margin: 0;
  padding: 0;
}

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

/* Remove Old Duplicate Taskbars Globally */
.page-title-box {
  display: none !important;
}

/* Ensure content with data-aos is always visible */
[data-aos] {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

#layout-wrapper {
  background-color: var(--background);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.main-content {
  background-color: transparent !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

@media (min-width: 992px) {
  .main-content {
    margin-left: 250px !important;
    width: auto !important;
    max-width: calc(100vw - 250px) !important;
  }
  body[data-sidebar-size="sm"] .main-content,
  body.sidebar-collapsed .main-content {
    margin-left: 92px !important;
    max-width: calc(100vw - 92px) !important;
  }
}

.page-content {
  padding: calc(70px + 1rem) 1rem 5rem 1rem !important;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

@media (min-width: 992px) {
  .page-content {
    padding: calc(70px + 1.25rem) 1.5rem 2.5rem 1.5rem !important;
  }
}

/* Fluid responsive containers */
.container-fluid {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
  overflow-x: hidden;
}
@media (min-width: 768px) {
  .container-fluid {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
}

/* --- 3. UTILITY CLASSES --- */
.surface {
  border: 1px solid var(--border) !important;
  background: var(--card) !important;
  border-radius: calc(var(--radius) * 1.4) !important;
  box-shadow: 0 1px 3px rgba(16, 20, 43, 0.04), 0 12px 28px -18px rgba(16, 20, 43, 0.12) !important;
  color: var(--card-foreground) !important;
  transition: all 0.25s ease;
}

.card {
  border: 1px solid var(--border) !important;
  background-color: var(--card) !important;
  border-radius: calc(var(--radius) * 1.4) !important;
  box-shadow: 0 1px 3px rgba(16, 20, 43, 0.04), 0 12px 28px -18px rgba(16, 20, 43, 0.12) !important;
  color: var(--card-foreground) !important;
}

.card-header {
  border-bottom: 1px solid var(--border) !important;
  background-color: transparent !important;
}

.bg-brand-gradient {
  background-image: linear-gradient(120deg, var(--brand-3, #0e7490), var(--primary) 50%, var(--brand-2, #14b8a6)) !important;
}

.text-brand-gradient {
  background: linear-gradient(120deg, var(--brand-3, #0e7490), var(--primary) 50%, var(--brand-2, #14b8a6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.shadow-brand {
  box-shadow: 0 10px 25px -8px var(--primary-glow) !important;
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}
.animate-float {
  animation: 4s ease-in-out infinite float;
}

@keyframes rise {
  0% { opacity: 0; transform: translateY(16px); }
  15% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-16px); }
}
.animate-rise {
  animation: 6s ease-in-out infinite both rise;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(8, 145, 178, 0.3); }
  50% { box-shadow: 0 0 25px rgba(8, 145, 178, 0.6); }
}
.pulse-glow {
  animation: 2.5s infinite pulse-glow;
}

/* Brand Tokens for Social Networks */
.brand-facebook { color: #1877F2 !important; }
.brand-tiktok { color: #111111 !important; }
.brand-instagram { color: #E1306C !important; }
.brand-youtube { color: #FF0000 !important; }
.brand-telegram { color: #37AEE2 !important; }
.brand-twitter { color: #000000 !important; }
.brand-shopee { color: #F53D2D !important; }
.brand-google { color: #4285F4 !important; }

/* Buttons */
.btn-primary {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-foreground) !important;
  border-radius: var(--radius);
  font-weight: 600;
  box-shadow: 0 4px 14px -3px var(--primary-glow);
  transition: all 0.2s ease;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--brand-3) !important;
  border-color: var(--brand-3) !important;
  box-shadow: 0 6px 20px -3px var(--primary-glow);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-soft-primary {
  background-color: var(--primary-soft) !important;
  color: var(--primary) !important;
  border: 1px solid transparent;
  font-weight: 600;
}
.btn-soft-primary:hover {
  background-color: var(--primary) !important;
  color: var(--primary-foreground) !important;
}

/* --- 4. TOPBAR HEADER DESIGN --- */
#page-topbar {
  background: rgba(240, 248, 250, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: none !important;
  box-shadow: none !important;
  padding: 0.75rem 1rem 0 1rem;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1002;
  transition: all 0.25s ease;
  box-sizing: border-box !important;
}

[data-bs-theme="dark"] #page-topbar {
  background: rgba(7, 21, 24, 0.85) !important;
}

@media (min-width: 992px) {
  #page-topbar {
    left: 250px !important;
    right: 0 !important;
    width: auto !important;
    max-width: calc(100vw - 250px) !important;
    padding: 0.75rem 1.5rem 0 1.5rem !important;
  }
  body[data-sidebar-size="sm"] #page-topbar,
  body.sidebar-collapsed #page-topbar {
    left: 92px !important;
    max-width: calc(100vw - 92px) !important;
  }
}

.appmio-topbar-card {
  height: 64px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 0 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

/* Balance Pill Widget */
.appmio-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 4px 10px 4px 6px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  height: 32px;
  box-sizing: border-box;
}
.appmio-balance-pill:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 10px var(--primary-soft);
  transform: translateY(-1px);
}
.appmio-balance-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.appmio-balance-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}
.appmio-balance-text .balance-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted-foreground);
  font-weight: 600;
}
.appmio-balance-text .balance-amount {
  font-size: 12px;
  font-weight: 700;
  color: var(--foreground);
}

/* Theme switch & Topbar icon buttons */
.appmio-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--foreground);
  transition: all 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.appmio-icon-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}
.appmio-icon-btn i {
  font-size: 15px !important;
}

/* Combined Language & Currency pill button */
.appmio-lang-curr-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  height: 32px;
  box-sizing: border-box;
}
.appmio-lang-curr-btn:hover {
  border-color: var(--primary);
  background: var(--muted);
  transform: translateY(-1px);
}
.appmio-topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0088a9;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0, 136, 169, 0.25);
  flex-shrink: 0;
}

/* Language selector in Header Taskbar (Relocated from bottom-left) */
.appmio-lang-container {
  display: inline-flex;
  align-items: center;
  position: relative;
}

/* Style GTranslate float widget ONLY when inside topbar container */
#appmio-lang-container #gt_float_wrapper,
#appmio-lang-container .gt_float_switcher {
  position: static !important;
  bottom: auto !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  margin: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  transform: none !important;
  display: inline-flex !important;
  align-items: center !important;
  z-index: 100 !important;
}

#appmio-lang-container .gt_float_switcher .gt-selected {
  background: var(--muted) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  height: 38px !important;
  box-sizing: border-box !important;
}

#appmio-lang-container .gt_float_switcher .gt-selected .gt-current-lang {
  color: var(--foreground) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

#appmio-lang-container .gt_float_switcher .gt_options {
  top: calc(100% + 6px) !important;
  bottom: auto !important;
  left: auto !important;
  right: 0 !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid var(--border) !important;
  background: var(--card) !important;
  overflow: hidden !important;
}

/* Strictly hide any stray GTranslate widget outside the topbar container */
body > #gt_float_wrapper:not(#appmio-lang-container #gt_float_wrapper),
body > .gt_float_switcher:not(#appmio-lang-container .gt_float_switcher) {
  display: none !important;
}

/* --- 5. SIDEBAR LAYOUT (DESKTOP) --- */
.app-menu.navbar-menu {
  background: var(--sidebar) !important;
  border-right: 1px solid var(--sidebar-border) !important;
  box-shadow: none !important;
  width: 250px !important;
  padding: 0.75rem 0.5rem 0.75rem 0.75rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1003;
}

.appmio-sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 1rem;
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar);
  overflow: hidden;
}

.navbar-brand-box {
  background: transparent !important;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.appmio-logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-3), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 4px 10px var(--primary-glow);
  flex-shrink: 0;
}

.appmio-brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--sidebar-foreground);
  text-transform: uppercase;
}

/* Dynamic Admin Logo switching (Light vs Dark) */
.appmio-logo-light {
  display: block;
  max-height: 36px;
  max-width: 150px;
  object-fit: contain;
}
.appmio-logo-dark {
  display: none;
  max-height: 36px;
  max-width: 150px;
  object-fit: contain;
}
[data-bs-theme="dark"] .appmio-logo-light {
  display: none !important;
}
[data-bs-theme="dark"] .appmio-logo-dark {
  display: block !important;
}

/* Sidebar Menu Items (Styled like smm.appmmo.com) */
.navbar-nav .menu-title {
  padding: 10px 12px 3px 12px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: #64748b !important;
  margin: 0 !important;
}

[data-bs-theme="dark"] .navbar-nav .menu-title {
  color: #94a3b8 !important;
}

.navbar-nav .nav-link {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  padding: 5.5px 12px !important;
  margin: 1.5px 8px !important;
  border-radius: 8px !important;
  color: #334155 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  transition: all 0.18s ease !important;
}

[data-bs-theme="dark"] .navbar-nav .nav-link {
  color: #cbd5e1 !important;
}

.navbar-nav .nav-link:hover {
  background: var(--muted) !important;
  color: var(--foreground) !important;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-item.active > .nav-link {
  background: #e6f4f8 !important;
  color: #0891b2 !important;
  font-weight: 600 !important;
}

[data-bs-theme="dark"] .navbar-nav .nav-link.active,
[data-bs-theme="dark"] .navbar-nav .nav-item.active > .nav-link {
  background: rgba(8, 145, 178, 0.18) !important;
  color: #22d3ee !important;
}

/* Left cyan indicator bar for active item */
.navbar-nav .nav-link.active::before,
.navbar-nav .nav-item.active > .nav-link::before {
  content: '' !important;
  position: absolute !important;
  left: 0 !important;
  top: 5px !important;
  bottom: 5px !important;
  width: 3.5px !important;
  border-radius: 0 4px 4px 0 !important;
  background: #0891b2 !important;
}

[data-bs-theme="dark"] .navbar-nav .nav-link.active::before,
[data-bs-theme="dark"] .navbar-nav .nav-item.active > .nav-link::before {
  background: #22d3ee !important;
}

.navbar-nav .nav-link i,
.navbar-nav .nav-link img {
  width: 17px !important;
  margin-right: 9px !important;
  font-size: 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

/* Bottom Sidebar User Pill & Logout (Matching smm.appmmo.com) */
.appmio-sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--sidebar);
}

.appmio-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f1f5f9;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

[data-bs-theme="dark"] .appmio-user-card {
  background: #1e293b;
}

.appmio-user-card:hover {
  background: #e2e8f0;
}

[data-bs-theme="dark"] .appmio-user-card:hover {
  background: #334155;
}

.appmio-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0284c7;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-bs-theme="dark"] .appmio-user-avatar {
  background: rgba(2, 132, 199, 0.25);
  color: #38bdf8;
}

.appmio-user-info {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.appmio-user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appmio-user-rank {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

[data-bs-theme="dark"] .appmio-user-rank {
  color: #94a3b8;
}

.appmio-collapse-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 16px;
  padding: 2px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.appmio-collapse-btn:hover {
  color: var(--primary);
}

.appmio-sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #e11d48 !important;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.appmio-sidebar-logout:hover {
  background: rgba(225, 29, 72, 0.08);
}

.appmio-sidebar-logout i {
  font-size: 17px;
}

/* Collapsed Sidebar */
body[data-sidebar-size="sm"] .app-menu.navbar-menu,
body.sidebar-collapsed .app-menu.navbar-menu {
  width: 92px !important;
}
body[data-sidebar-size="sm"] .appmio-brand-title,
body[data-sidebar-size="sm"] .navbar-nav .nav-link span,
body[data-sidebar-size="sm"] .navbar-nav .menu-title,
body[data-sidebar-size="sm"] .appmio-user-info,
body[data-sidebar-size="sm"] .appmio-sidebar-logout span,
body.sidebar-collapsed .appmio-brand-title,
body.sidebar-collapsed .navbar-nav .nav-link span,
body.sidebar-collapsed .navbar-nav .menu-title,
body.sidebar-collapsed .appmio-user-info,
body.sidebar-collapsed .appmio-sidebar-logout span {
  display: none !important;
}
body[data-sidebar-size="sm"] .navbar-nav .nav-link,
body.sidebar-collapsed .navbar-nav .nav-link {
  justify-content: center !important;
  margin: 4px 6px !important;
  padding: 10px 0 !important;
}
body[data-sidebar-size="sm"] .navbar-nav .nav-link i,
body[data-sidebar-size="sm"] .navbar-nav .nav-link img,
body.sidebar-collapsed .navbar-nav .nav-link i,
body.sidebar-collapsed .navbar-nav .nav-link img {
  margin-right: 0 !important;
}

body[data-sidebar-size="sm"] .appmio-sidebar-footer,
body.sidebar-collapsed .appmio-sidebar-footer {
  padding: 8px 6px !important;
  align-items: center !important;
}
body[data-sidebar-size="sm"] .appmio-user-card,
body.sidebar-collapsed .appmio-user-card {
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 8px 4px !important;
  gap: 6px !important;
  width: 100% !important;
}
body[data-sidebar-size="sm"] .appmio-user-avatar,
body.sidebar-collapsed .appmio-user-avatar {
  margin: 0 auto !important;
}
body[data-sidebar-size="sm"] .appmio-collapse-btn,
body.sidebar-collapsed .appmio-collapse-btn {
  margin-left: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
/* Flip collapse arrow icon to >> when collapsed */
body[data-sidebar-size="sm"] .appmio-collapse-btn i::before,
body.sidebar-collapsed .appmio-collapse-btn i::before {
  content: "\ea6a" !important; /* remixicon arrow-right-double-line */
}
body[data-sidebar-size="sm"] .appmio-sidebar-logout,
body.sidebar-collapsed .appmio-sidebar-logout {
  justify-content: center !important;
  padding: 8px 0 !important;
  width: 100% !important;
}

/* --- 6. MOBILE FLOATING BOTTOM NAVIGATION BAR --- */
.appmio-mobile-bottom-nav {
  position: fixed;
  inset-inline: 12px;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  z-index: 1040;
  display: none;
  align-items: center;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 8px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.12), 0 20px 40px -15px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .appmio-mobile-bottom-nav {
  background: rgba(13, 33, 38, 0.94);
  border-color: rgba(230, 247, 250, 0.12);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.45);
}

@media (max-width: 991.98px) {
  .appmio-mobile-bottom-nav {
    display: flex !important;
  }
  body {
    padding-bottom: 78px;
  }
}

.appmio-mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  color: var(--muted-foreground);
  padding: 4px 2px;
  border-radius: 12px;
  transition: all 0.2s ease;
  position: relative;
  font-size: 11px;
  font-weight: 500;
}

.appmio-mobile-nav-item i {
  font-size: 20px;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.appmio-mobile-nav-item:hover,
.appmio-mobile-nav-item.active {
  color: var(--primary) !important;
  font-weight: 600;
}

.appmio-mobile-nav-item.active i {
  transform: scale(1.1);
}

/* Center Floating Action Button (FAB) */
.appmio-mobile-fab-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: -32px;
}

.appmio-mobile-fab {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-foreground) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--primary-glow);
  border: 5px solid var(--background);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none !important;
}

.appmio-mobile-fab:hover,
.appmio-mobile-fab:active {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px var(--primary-glow);
}

.appmio-mobile-fab i {
  font-size: 24px;
}

.appmio-mobile-fab-text {
  font-size: 10px;
  font-weight: 600;
  color: var(--foreground);
  margin-top: 3px;
}

/* Badge count */
.appmio-badge-dot {
  position: absolute;
  top: 4px;
  right: calc(50% - 14px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--card);
}

/* Mobile Slide-over Drawer Sheet */
.appmio-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.appmio-drawer-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.appmio-drawer-sheet {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 300px;
  max-width: 85vw;
  background: var(--sidebar);
  z-index: 1055;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.2);
}
.appmio-drawer-backdrop.show .appmio-drawer-sheet {
  transform: translateX(0);
}

/* --- 7. AUTH LAYOUT DESIGN (LOGIN, REGISTER, FORGOT-PASSWORD) --- */
.auth-scope {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef3fb;
  position: relative;
  overflow: hidden;
  padding: 2rem 1rem;
}

[data-bs-theme="dark"] .auth-scope {
  background: #071518;
}

/* Diffuse Blobs */
.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
}
.auth-blob-1 {
  width: 400px;
  height: 400px;
  background: rgba(8, 145, 178, 0.25);
  top: -100px;
  left: -100px;
}
.auth-blob-2 {
  width: 350px;
  height: 350px;
  background: rgba(20, 184, 166, 0.25);
  bottom: -100px;
  right: -50px;
}
.auth-blob-3 {
  width: 300px;
  height: 300px;
  background: rgba(59, 130, 246, 0.2);
  top: 40%;
  left: 45%;
}

.auth-card-wrapper {
  width: 100%;
  max-width: 1100px;
  background: var(--card);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px -35px rgba(30, 80, 160, 0.35);
  overflow: hidden;
  position: relative;
  z-index: 10;
}

[data-bs-theme="dark"] .auth-card-wrapper {
  box-shadow: 0 30px 80px -35px rgba(0, 0, 0, 0.7);
}

.auth-left-preview {
  background: linear-gradient(135deg, #e9f1fe 0%, #f1f6ff 50%, #e6effd 100%);
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

[data-bs-theme="dark"] .auth-left-preview {
  background: linear-gradient(135deg, #091e23 0%, #0d262c 50%, #08171b 100%);
}

/* 3D Isometric Card Container */
.auth-3d-scene {
  perspective: 900px;
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
}

.auth-3d-card {
  transform: rotateY(-18deg) rotateX(8deg) rotateZ(-3deg);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  padding: 1.5rem;
  width: 320px;
  box-shadow: 0 25px 50px -12px rgba(16, 42, 49, 0.25);
  transition: transform 0.5s ease;
}

[data-bs-theme="dark"] .auth-3d-card {
  background: rgba(13, 33, 38, 0.85);
  border-color: rgba(230, 247, 250, 0.15);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.auth-3d-card:hover {
  transform: rotateY(-8deg) rotateX(4deg) rotateZ(-1deg) scale(1.02);
}

/* Floating Label Inputs */
.floating-input-group {
  position: relative;
  height: 54px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  display: flex;
  align-items: center;
  padding: 0 14px;
  transition: all 0.2s ease;
  margin-bottom: 1rem;
}

.floating-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.floating-input-group .input-icon {
  font-size: 19px;
  color: var(--muted-foreground);
  margin-right: 12px;
  transition: color 0.2s ease;
}

.floating-input-group:focus-within .input-icon {
  color: var(--primary);
}

.floating-input-group .field-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.floating-input-group .floating-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted-foreground);
  margin-bottom: 1px;
}

.floating-input-group input {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  outline: none;
  width: 100%;
}

.floating-input-group input:focus {
  outline: none;
  box-shadow: none;
}

.floating-input-group .toggle-password {
  background: none;
  border: none;
  color: var(--muted-foreground);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
}

.floating-input-group .toggle-password:hover {
  color: var(--primary);
}

.btn-auth-submit {
  height: 50px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-3), var(--primary) 60%, var(--brand-2)) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 10px 25px -8px var(--primary-glow) !important;
  transition: all 0.25s ease;
}
.btn-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px var(--primary-glow) !important;
}

/* --- 8. ORDER FORM COMPONENTS (DASHBOARD) --- */

/* Responsive Platform Button Grid (Matching Spec & Image 4 / 5) */
.appmio-platform-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Mobile: exactly 2 columns */
  gap: 8px;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) and (max-width: 1023.98px) {
  .appmio-platform-grid {
    grid-template-columns: repeat(3, 1fr); /* Tablet: 3 columns */
    gap: 10px;
  }
}

@media (min-width: 1024px) {
  .appmio-platform-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); /* Desktop: multi-item flex/grid */
    gap: 10px;
  }
}

.appmio-platform-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  min-height: 42px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.appmio-platform-btn:hover {
  border-color: var(--primary);
  background: var(--muted);
  transform: translateY(-1px);
}

.appmio-platform-btn.active {
  border: 2px solid #0891b2 !important;
  background: rgba(8, 145, 178, 0.08) !important;
  color: #0891b2 !important;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(8, 145, 178, 0.25);
}

[data-bs-theme="dark"] .appmio-platform-btn.active {
  border-color: #22d3ee !important;
  background: rgba(34, 211, 238, 0.12) !important;
  color: #22d3ee !important;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.3);
}

.appmio-platform-btn img,
.appmio-platform-btn i {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.appmio-platform-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Order Mode Toggle (Một / Nhiều) */
.appmio-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  margin: 12px 0 14px 0;
  padding: 4px 2px;
}

.appmio-mode-toggle .form-check-input {
  cursor: pointer;
  margin-top: 0.15rem;
}

.appmio-mode-toggle .form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.appmio-mode-toggle .form-check-label {
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

/* Horizontal Platform Selector (Legacy Pill fallback) */
.platform-selector-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 12px 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.platform-selector-scroll::-webkit-scrollbar {
  height: 5px;
}
.platform-selector-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 9999px;
}

.platform-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.platform-pill img,
.platform-pill i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.platform-pill:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-soft);
}

.platform-pill.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-soft);
}

/* Price Summary Box */
.appmio-price-card {
  border-radius: 14px;
  border: 1.5px dashed var(--primary);
  background: linear-gradient(135deg, var(--card), var(--muted));
  padding: 1.25rem;
}

.appmio-price-total {
  font-size: 26px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.5px;
}

/* Service Details Box */
.service-stat-item {
  background: var(--muted);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  border: 1px solid var(--border);
}
.service-stat-item .stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
}
.service-stat-item .stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground);
  margin-top: 2px;
}

/* Status Badges */
.badge-status {
  padding: 5px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.badge-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-status.status-completed {
  background: var(--success-soft);
  color: var(--success);
}
.badge-status.status-completed::before {
  background: var(--success);
}

.badge-status.status-processing,
.badge-status.status-inprogress {
  background: var(--info-soft);
  color: var(--info);
}
.badge-status.status-processing::before,
.badge-status.status-inprogress::before {
  background: var(--info);
}

.badge-status.status-pending {
  background: var(--warning-soft);
  color: var(--warning);
}
.badge-status.status-pending::before {
  background: var(--warning);
}

.badge-status.status-canceled {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge-status.status-canceled::before {
  background: var(--danger);
}

/* Responsive Table / Mobile Cards */
@media (max-width: 768px) {
  .appmio-responsive-table thead {
    display: none;
  }
  .appmio-responsive-table tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    padding: 12px;
  }
  .appmio-responsive-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    padding: 6px 0;
  }
  .appmio-responsive-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 12px;
    color: var(--muted-foreground);
    text-transform: uppercase;
  }
}

/* Strict Mobile Overflow & Layout Rules */
html, body {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

#layout-wrapper, #page-topbar, .main-content, .page-content, .container-fluid {
  max-width: 100% !important;
  overflow-x: clip !important;
}

/* Responsive Topbar Title */
.appmio-topbar-title {
  max-width: 160px;
}
@media (max-width: 767.98px) {
  .appmio-topbar-title {
    max-width: 95px !important;
    font-size: 12px !important;
  }
}
@media (max-width: 380px) {
  .appmio-topbar-title {
    max-width: 75px !important;
    font-size: 11px !important;
  }
}

@media (max-width: 767.98px) {
  #page-topbar {
    padding: 0.5rem 0.5rem 0 0.5rem !important;
  }
  .appmio-topbar-card {
    height: 52px !important;
    padding: 0 8px !important;
    gap: 4px !important;
    border-radius: 12px !important;
  }
  .appmio-icon-btn {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
  }
  .appmio-icon-btn i {
    font-size: 13px !important;
  }
  .appmio-topbar-avatar {
    width: 28px !important;
    height: 28px !important;
    font-size: 11px !important;
  }
  .appmio-balance-pill {
    height: 28px !important;
    padding: 0 6px 0 3px !important;
    gap: 3px !important;
  }
  .appmio-balance-pill .balance-amount {
    font-size: 11px !important;
  }
  .appmio-balance-icon {
    width: 20px !important;
    height: 20px !important;
    font-size: 11px !important;
  }
  
  .card {
    max-width: 100% !important;
    word-break: break-word !important;
  }
  
  .table-responsive {
    max-width: 100% !important;
  }
}
