/* ==========================================================================
   Mosaico Services - Admin Stylesheet
   Version: 3.0.0 - Copied from EasyPackets
   ========================================================================== */

/* CSS Variables */
:root {
  /* Colors */
  --bs-primary: #6366f1;
  --bs-secondary: #64748b;
  --bs-success: #10b981;
  --bs-info: #06b6d4;
  --bs-warning: #f59e0b;
  --bs-danger: #ef4444;
  --bs-light: #f8fafc;
  --bs-dark: #1e293b;
  
  /* Layout */
  --sidebar-width: 280px;
  --sidebar-mini-width: 70px;
  --header-height: 70px;
  --footer-height: 60px;
  
  /* Transitions */
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Border Radius */
  --border-radius: 0.75rem;
  --border-radius-sm: 0.5rem;
  --border-radius-lg: 1rem;
  
  /* Shadows */
  --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --box-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  
  /* Theme colors - Light mode */
  --bg-color: #ffffff;
  --text-color: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --header-bg: #ffffff;
}

/* Dark mode */
[data-bs-theme="dark"] {
  --bg-color: #0f172a;
  --text-color: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --card-bg: #1e293b;
  --sidebar-bg: #1e293b;
  --header-bg: #1e293b;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #f8fafc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-color);
}

/* Layout */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  background-color: #f8fafc;
}

/* Header Styles */
.admin-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1030;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--box-shadow-sm);
  height: var(--header-height);
  overflow: visible;
  width: 100%;
  transform: translateZ(0); /* Force hardware acceleration */
  -webkit-transform: translateZ(0); /* Safari support */
}

.admin-header .navbar {
  padding: 0.75rem 1rem;
  min-height: var(--header-height);
  max-height: var(--header-height);
  background-color: white;
  position: relative;
  overflow: visible;
}

.admin-header .container-fluid {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.admin-header .navbar-brand img {
  height: 36px;
  width: auto;
}

.admin-header .navbar-toggler {
  padding: 0.5rem;
  margin-right: 0.5rem;
  border: none;
  background: none;
}

.admin-header .navbar-toggler:focus {
  box-shadow: none;
  outline: none;
}

.admin-header .navbar-toggler i {
  font-size: 1.5rem;
  color: var(--text-color);
}

/* Tenant Badge */
.tenant-badge {
  color: var(--text-color);
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem !important;
  background-color: rgba(99, 102, 241, 0.1) !important;
  border-radius: 0.375rem;
  margin: 0 0.25rem !important;
}

.tenant-badge i {
  color: var(--bs-primary);
  font-size: 0.875rem;
  margin-right: 0.375rem !important;
}

@media (max-width: 991.98px) {
  .tenant-badge {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem !important;
    margin: 0 0.25rem !important;
  }
}

/* Search */
.search-container {
  max-width: 600px;
}

.search-input {
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: var(--transition-fast);
}

.search-input:focus {
  background-color: white;
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.1);
  outline: none;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Mobile Search Bar */
.mobile-search-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background-color: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 0;
  z-index: 1025;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.mobile-search-bar.show {
  transform: translateY(0);
}

.mobile-search-bar .search-input {
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

/* User Avatar */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #5b21b6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* Customer Avatar Sizes */
.avatar-lg {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-title {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 2rem;
  text-transform: uppercase;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.15);
  transition: var(--transition-fast);
}

.avatar-title:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 20px rgba(99, 102, 241, 0.2);
}

/* Header buttons */
.admin-header .btn-link {
  color: var(--text-color);
  text-decoration: none;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: var(--transition-fast);
}

.admin-header .btn-link:hover {
  color: var(--bs-primary);
  background-color: rgba(99, 102, 241, 0.1);
}

/* Navbar Nav */
.admin-header .navbar-nav {
  position: relative;
  z-index: 1;
}

.admin-header .navbar-nav .dropdown {
  position: static;
}

.admin-header .navbar-nav .dropdown-menu {
  position: absolute !important;
}

/* Sidebar Styles */
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background-color: white;
  border-right: 1px solid #e2e8f0;
  z-index: 1025;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: var(--header-height);
}

/* Sidebar Logo */
.sidebar-logo {
  padding: 1.5rem 1rem;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  background-color: white;
}

.sidebar-logo img {
  max-width: 100%;
  height: auto;
  max-height: 40px;
}

/* Hide sidebar logo on desktop (shows in header instead) */
@media (min-width: 992px) {
  .sidebar-logo {
    display: none !important;
  }
}

/* Sidebar Mobile Close Button */
.sidebar-mobile-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

.sidebar-mobile-close .btn {
  padding: 0.5rem;
  color: var(--text-color);
}

.sidebar-mobile-close .btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 0.5rem;
}

/* Sidebar Header for Mobile */
.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background-color: white;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.125rem;
}

.sidebar-brand img {
  height: 32px;
  width: auto;
}

.sidebar-header .btn-link {
  color: var(--text-color);
  text-decoration: none;
  padding: 0.25rem;
  border-radius: 0.375rem;
  transition: var(--transition-fast);
}

.sidebar-header .btn-link:hover {
  color: var(--bs-primary);
  background-color: rgba(99, 102, 241, 0.1);
}

.sidebar-nav {
  padding: 1.5rem 0;
}

/* Adjust sidebar nav padding when header is present */
@media (max-width: 991.98px) {
  .sidebar-content .sidebar-nav {
    padding-top: 0.5rem;
  }
  
  .sidebar-content {
    padding-top: 0;
  }
}

.nav-section {
  margin-bottom: 0.5rem;
}

.nav-section:not(:first-child) {
  margin-top: 2rem;
}

.nav-section-title {
  display: block;
  padding: 0.5rem 1.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.625rem 1.5rem;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  position: relative;
  border-radius: 0;
}

.nav-link i {
  width: 20px;
  margin-right: 0.875rem;
  font-size: 1.25rem;
  color: #94a3b8;
  transition: var(--transition-fast);
}

.nav-link:hover {
  background-color: rgba(99, 102, 241, 0.08);
  color: var(--bs-primary);
  text-decoration: none;
}

.nav-link:hover i {
  color: var(--bs-primary);
}

.nav-link.active {
  background-color: rgba(99, 102, 241, 0.12);
  color: var(--bs-primary);
  font-weight: 600;
}

.nav-link.active i {
  color: var(--bs-primary);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--bs-primary);
  border-radius: 0 2px 2px 0;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid #e2e8f0;
  margin-top: auto;
  background-color: #f8fafc;
}

/* Main Content */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--header-height);
  transition: margin-left 0.3s ease;
  background-color: #f8fafc;
}

/* Mobile main content adjustments */
@media (max-width: 991.98px) {
  .admin-main {
    padding-top: var(--header-height); /* 70px extra space below navbar */
  }
}

.admin-main .container-fluid {
  padding: 2rem;
  flex: 1;
}

/* Page Header */
.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
  font-size: 1.875rem;
}

.breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: #94a3b8;
  content: "›";
}

.breadcrumb-item.active {
  color: #64748b;
}

.breadcrumb-item a {
  color: var(--bs-primary);
  text-decoration: none;
}

/* Cards */
.card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #f1f5f9;
  margin-bottom: 1.5rem;
  transition: var(--transition-fast);
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid #f1f5f9;
  padding: 1.5rem 1.5rem 1rem;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  margin-bottom: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

/* Stats Cards */
.stats-card {
  border: none;
  transition: all 0.2s ease;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.stats-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.stats-card .card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  align-items: center;
}

.stats-icon {
  width: 56px;
  height: 56px;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stats-icon i {
  font-size: 1.5rem;
}

.stats-icon.bg-primary {
  background-color: rgba(99, 102, 241, 0.1) !important;
  color: #6366f1 !important;
}

.stats-icon.bg-success {
  background-color: rgba(16, 185, 129, 0.1) !important;
  color: #10b981 !important;
}

.stats-icon.bg-warning {
  background-color: rgba(245, 158, 11, 0.1) !important;
  color: #f59e0b !important;
}

.stats-icon.bg-info {
  background-color: rgba(6, 182, 212, 0.1) !important;
  color: #06b6d4 !important;
}

.stats-icon.bg-danger {
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
}

.stats-card h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 0.125rem;
}

.stats-label {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
  white-space: nowrap;
}

.stats-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  align-self: center;
}

.stats-badge i {
  font-size: 0.625rem;
  margin: 0;
}

/* Badge subtle backgrounds */
.bg-primary-subtle {
  background-color: rgba(99, 102, 241, 0.1) !important;
}

.bg-success-subtle {
  background-color: rgba(16, 185, 129, 0.1) !important;
}

.bg-warning-subtle {
  background-color: rgba(245, 158, 11, 0.1) !important;
}

.bg-info-subtle {
  background-color: rgba(6, 182, 212, 0.1) !important;
}

.bg-danger-subtle {
  background-color: rgba(239, 68, 68, 0.1) !important;
}

.stats-card small {
  font-size: 0.875rem;
  font-weight: 500;
}

.stats-card small i {
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

/* Stats Card Components - Mosaico Services specific */
.stats-value {
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
  margin: 0.5rem 0;
}

.stats-change {
  font-size: 0.875rem;
  color: #64748b;
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
}

.stats-change i {
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

.stats-change.positive {
  color: #10b981;
}

.stats-change.positive i {
  color: #10b981;
}

.stats-change.negative {
  color: #ef4444;
}

.stats-change.negative i {
  color: #ef4444;
}

/* Icon variants for stats cards */
.icon-primary {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.icon-success {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.icon-warning {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.icon-danger {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.icon-info {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Activity Feed Styles - Mosaico Services specific */
.activity-feed {
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.activity-icon {
  flex-shrink: 0;
  width: 24px;
  margin-right: 1rem;
}

.activity-icon i {
  font-size: 0.5rem;
}

.activity-content {
  flex: 1;
}

.activity-content p {
  font-size: 0.9rem;
  color: #1e293b;
  margin-bottom: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  border-radius: 0.5rem;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

a.btn i {
  margin-right: 0.5rem;
}

.btn i {
  font-size: 1rem;
}

.btn i:first-child:not(:only-child) {
  margin-right: 0.5rem;
}

.btn i:last-child:not(:only-child) {
  margin-left: 0.5rem;
}

.btn-primary {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: white;
}

.btn-primary:hover {
  background-color: #5b21b6;
  border-color: #5b21b6;
  color: white;
}

.btn-outline-primary {
  color: var(--bs-primary);
  border-color: var(--bs-primary);
  background-color: transparent;
}

.btn-outline-primary:hover {
  color: white;
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.btn-outline-secondary {
  color: #64748b;
  border-color: #e2e8f0;
  background-color: white;
}

.btn-outline-secondary:hover {
  color: #475569;
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
}

.btn-group-sm > .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
}

/* Button Groups */
.btn-group {
  border-radius: 0.5rem;
  overflow: hidden;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
}

.btn-group .btn:last-child {
  border-top-right-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

.btn-group .btn.active {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: white;
}

/* Activity Feed */
.activity-feed {
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 1rem;
  font-size: 1rem;
}

.activity-content {
  flex: 1;
}

.activity-content p {
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: #0f172a;
}

.activity-content small {
  color: #64748b;
  font-size: 0.875rem;
}

.activity-amount {
  margin-left: 1rem;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: white;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1024;
}

/* Footer */
.admin-footer {
  background-color: white;
  border-top: 1px solid #e2e8f0;
  padding: 1.5rem 0;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.admin-footer p {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: #64748b;
}

.admin-footer a {
  color: #64748b;
  text-decoration: none;
  transition: var(--transition-fast);
}

.admin-footer a:hover {
  color: var(--bs-primary);
}

/* Responsive Design */
@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
    z-index: 1040;
  }
  
  .admin-sidebar.show {
    transform: translateX(0);
  }
  
  .admin-main {
    margin-left: 0;
  }
  
  .sidebar-overlay.show {
    display: block;
  }
  
  .admin-main .container-fluid {
    padding: 1.5rem 1rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  /* Mobile header fixes */
  .admin-header {
    position: fixed !important;
    top: 0 !important;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }
  
  .admin-header .navbar {
    width: 100%;
  }
  
  /* Ensure mobile content starts below header with extra spacing */
  .admin-main {
    padding-top: calc(var(--header-height)); /* 70px extra space below navbar */
  }
}

@media (max-width: 767.98px) {
  .admin-main .container-fluid {
    padding: 0.75rem;
  }
  
  /* Full width cards on mobile */
  .mobile-transaction-details {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }
  
  .mobile-transaction-details .col-lg-8,
  .mobile-transaction-details .col-lg-4 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .stats-card .card-body {
    padding: 1.25rem;
  }

  .stats-card h3 {
    font-size: 1.5rem;
  }

  .stats-card .stats-label {
    font-size: 0.7rem;
  }

  .stats-icon {
    width: 48px;
    height: 48px;
  }

  .stats-icon i {
    font-size: 1.25rem;
  }

  .stats-badge {
    font-size: 0.625rem;
    padding: 0.2rem 0.4rem;
    margin-left: 0.75rem !important;
  }
  
  /* Mobile-specific transaction page improvements */
  .page-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }
  
  .breadcrumb {
    font-size: 0.8rem;
  }
  
  /* Mobile filter/stats toggle buttons */
  .card-header {
    padding: 0.75rem 1rem;
  }
  
  .card-header h6 {
    font-size: 0.9rem;
    font-weight: 600;
  }
  
  /* Improve button spacing on mobile */
  .btn-group .btn {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }
  
  /* Mobile transaction card improvements */
  .mobile-transaction-card {
    border-left: 4px solid #e2e8f0;
    background: white;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
  }
  
  .mobile-transaction-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
  }
  
  .mobile-transaction-card.payment {
    border-left-color: var(--bs-success);
  }
  
  .mobile-transaction-card.charge {
    border-left-color: var(--bs-warning);
  }
  
  .mobile-transaction-amount {
    font-size: 1.1rem;
    font-weight: 600;
  }
  
  .mobile-transaction-date {
    font-size: 0.8rem;
    color: #6c757d;
  }
  
  .mobile-transaction-customer {
    font-size: 0.85rem;
    color: #495057;
  }
  
  .mobile-transaction-description {
    font-size: 0.9rem;
    font-weight: 500;
    color: #212529;
    line-height: 1.3;
  }
  
  .mobile-btn-view {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
  }
  
  /* Compact mobile header */
  .mobile-page-header {
    padding: 0.75rem 0;
  }
  
  .mobile-page-header .page-title {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
  }
  
  .mobile-page-header .breadcrumb {
    font-size: 0.75rem;
    margin-bottom: 0;
  }
  
  /* Mobile action buttons */
  .mobile-action-buttons {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
  }
  
  .mobile-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: none;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
  }
  
  .mobile-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  }
  
  /* Mobile pagination improvements */
  .pagination {
    justify-content: center;
  }
  
  .pagination .page-link {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
  }
  
  /* Mobile filter improvements */
  .card-header {
    padding: 0.75rem 1rem;
  }
  
  .form-control-sm, .form-select-sm {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
  }
  
  /* Mobile transaction list spacing */
  .mobile-transaction-card:last-child {
    margin-bottom: 5rem; /* Space for floating buttons */
  }
  
  /* Mobile content wrapper adjustments */
  .mobile-page-header {
    padding-top: 0;
    margin: -0.75rem -0.75rem 1rem;
    padding: 0.75rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
  }
  
  /* Mobile quick summary card */
  .mobile-quick-summary {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
    margin: 0 -0.75rem 1rem;
  }
  
  .mobile-quick-summary .card-body {
    background: #f8fafc;
    padding: 1rem;
  }
  
  /* Ensure floating buttons don't overlap with content */
  .mobile-action-buttons {
    bottom: 20px;
    right: 20px;
    z-index: 1000;
  }
  
  /* Add safe area for mobile browsers */
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  /* iOS Safari specific adjustments */
  @supports (-webkit-touch-callout: none) {

    .admin-main {
      margin-top: var(--header-height)!important;
    }

    .admin-header, .admin-header .container {
      padding-top: var(--header-height)!important;
    }

    /* body {
      padding-top: calc(var(--header-height))!important;
    } */
    
    .mobile-action-buttons {
      bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .modal-body-mobile {
      margin-bottom: env(safe-area-inset-bottom);
    }

    .sidebar-header {
      padding-top: var(--header-height);
    }
  } 
  
  /* Bottom spacing for mobile */
  .admin-main .container-fluid {
    padding-bottom: 70px; /* Space at bottom */
  }
  
  /* Android Chrome specific adjustments */
  @media screen and (max-height: 700px) {
    .admin-main {
      padding-top: calc(var(--header-height) + 50px); /* Reduced for shorter screens */
    }
  }
  
  /* Very small screens (older phones) */
  @media screen and (max-height: 600px) {


    .admin-main {
      padding-top: calc(var(--header-height) + 40px); /* Further reduced */
    }
    
    .mobile-action-buttons {
      bottom: 15px;
      right: 15px;
    }
  }
  
  /* Additional mobile fixes */
  .admin-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1030 !important;
  }
  
  html, body {
    overflow-x: hidden;
    position: relative;
  }
}

/* Extra small devices */
@media (max-width: 575.98px) {
  .admin-main .container-fluid {
    padding: 0.75rem 0.5rem;
  }
  
  .stats-card .card-body {
    padding: 1rem;
  }

  .stats-card h3 {
    font-size: 1.375rem;
  }

  .stats-card .stats-label {
    font-size: 0.65rem;
  }

  .stats-icon {
    width: 44px;
    height: 44px;
  }

  .stats-icon i {
    font-size: 1.125rem;
  }

  .stats-card .ms-3 {
    margin-left: 0.625rem !important;
  }

  .stats-badge {
    font-size: 0.6rem;
    padding: 0.15rem 0.35rem;
    margin-left: 0.5rem !important;
  }

  .stats-badge i {
    font-size: 0.5rem;
  }
  
  .btn-group .btn {
    font-size: 0.8rem;
    padding: 0.375rem 0.5rem;
  }
  
  /* Compact mobile stats cards */
  .stats-card .card-body {
    padding: 0.875rem !important;
  }

  .stats-card h3 {
    font-size: 1.25rem !important;
  }

  .stats-card .stats-label {
    font-size: 0.625rem !important;
  }

  .stats-icon {
    width: 40px !important;
    height: 40px !important;
  }

  .stats-icon i {
    font-size: 1rem !important;
  }

  .stats-card .ms-3 {
    margin-left: 0.5rem !important;
  }

  .stats-badge {
    font-size: 0.5625rem !important;
    padding: 0.125rem 0.3rem !important;
    margin-left: 0.5rem !important;
  }

  .stats-badge i {
    display: none;
  }
  
  /* Mobile badge improvements */
  .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
  
  /* Transaction Management Mobile Styles */
  .mobile-page-header {
    padding: 0 0.5rem;
    margin-bottom: 1rem;
  }
  
  .mobile-page-header .page-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }
  
  .mobile-action-bar {
    padding: 0 0.5rem;
  }
  
  .mobile-filter-card {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }
  
  /* Transaction statistics cards on mobile */
  .transaction-stats-card {
    margin-bottom: 0.75rem !important;
  }
  
  .transaction-stats-card .card-body {
    padding: 1rem !important;
  }
  
  .transaction-stats-card h4 {
    font-size: 1.25rem !important;
    margin-bottom: 0.25rem !important;
  }
  
  .transaction-stats-card .text-muted {
    font-size: 0.75rem !important;
  }
}

/* Utilities */
.text-muted {
  color: #64748b !important;
}

.text-success {
  color: #10b981 !important;
}

.text-danger {
  color: #ef4444 !important;
}

.text-warning {
  color: #f59e0b !important;
}

.text-info {
  color: #06b6d4 !important;
}

.text-primary {
  color: #6366f1 !important;
}

.fw-semibold {
  font-weight: 600;
}

.fw-bold {
  font-weight: 700;
}

.small {
  font-size: 0.875rem;
}

.bg-opacity-10 {
  --bs-bg-opacity: 0.1;
}

/* Custom Badge Colors */
.badge.bg-primary {
  background-color: var(--bs-primary) !important;
}

.badge.bg-success {
  background-color: var(--bs-success) !important;
}

.badge.bg-warning {
  background-color: var(--bs-warning) !important;
  color: #000 !important;
}

.badge.bg-danger {
  background-color: var(--bs-danger) !important;
}

.badge.bg-info {
  background-color: var(--bs-info) !important;
}

/* Dropdown Menus */
.dropdown-menu {
  position: absolute !important;
  top: 100% !important;
  left: auto !important;
  right: 0 !important;
  z-index: 1050 !important;
  min-width: 200px;
  margin: 0.25rem 0 0 0 !important;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  background-color: white;
  background-clip: padding-box;
}

.dropdown-menu.show {
  display: block !important;
}

.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

/* Notification Dropdown */
.notification-dropdown {
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  right: 0 !important;
  left: auto !important;
}

.notification-dropdown .dropdown-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

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

.notification-dropdown .dropdown-item:hover {
  background-color: #f8fafc;
}

/* User Dropdown */
.admin-header .dropdown {
  position: relative;
}

.admin-header .dropdown-menu {
  position: absolute !important;
  top: 100% !important;
  transform: none !important;
  right: 0 !important;
  left: auto !important;
}

/* Dropdown Items */
.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  clear: both;
  font-weight: 400;
  color: #212529;
  text-align: inherit;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  transition: var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: #1e2125;
  background-color: #f8fafc;
}

.dropdown-divider {
  height: 0;
  margin: 0.5rem 0;
  overflow: hidden;
  border-top: 1px solid #e2e8f0;
}

.dropdown-header {
  display: block;
  padding: 0.5rem 1rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  color: #6c757d;
  white-space: nowrap;
  font-weight: 600;
}

/* Animation Utilities */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from { 
    opacity: 0;
    transform: translate3d(0, 100%, 0);
  }
  to { 
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-in-out;
}

.animate-slideInUp {
  animation: slideInUp 0.3s ease-out;
}

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

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

::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Mobile Transaction Details Specific Styles */
@media (max-width: 991.98px) {
  .mobile-transaction-details .card {
    margin-bottom: 0.75rem;
    border-radius: 0.75rem;
  }
  
  .mobile-transaction-details .card-header {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem 0.75rem 0 0;
  }
  
  .mobile-transaction-details .card-header h5 {
    font-size: 1rem;
    margin-bottom: 0;
  }
  
  .mobile-transaction-details .card-body {
    padding: 1rem;
  }
  
  .mobile-transaction-details .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #64748b;
  }
  
  .mobile-transaction-details .text-muted {
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  .mobile-transaction-details .h4 {
    font-size: 1.25rem;
  }
  
  .mobile-transaction-details .mb-3 {
    margin-bottom: 0.75rem !important;
  }
  
  /* Mobile info sections */
  .mobile-info-section {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
  }
  
  .mobile-info-section:last-child {
    border-bottom: none;
  }
  
  /* Mobile customer section */
  .mobile-customer-info {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1rem;
    margin: 1rem 0;
  }
  
  .mobile-customer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bs-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
  }
  
  /* Mobile actions */
  .mobile-action-buttons .dropdown-menu {
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-radius: 0.75rem;
  }
  
  .mobile-fab.dropdown-toggle::after {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .mobile-transaction-details .card-header h5 {
    font-size: 0.9rem;
  }
  
  .mobile-transaction-details .form-label {
    font-size: 0.75rem;
  }
  
  .mobile-transaction-details .text-muted {
    font-size: 0.85rem;
  }
  
  .mobile-customer-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
  
  .mobile-transaction-details .h4 {
    font-size: 1.1rem;
  }
  
  .mobile-transaction-details .card-body {
    padding: 0.75rem;
  }
  
  /* Extra spacing adjustments for very small screens */
  .mobile-transaction-details {
    /* Content spacing handled by main container */
  }
  
  /* Compact mobile sections */
  .mobile-transaction-details .border-bottom {
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Mobile stats badges */
  .mobile-transaction-details .badge.bg-success,
  .mobile-transaction-details .badge.bg-warning {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
  }
  
  /* Adjust mobile spacing */
  @media (max-width: 428px) { /* iPhone Pro Max and similar */
    .mobile-page-header {
      margin: -0.75rem -0.75rem 0.75rem;
      padding: 0.75rem;
    }
    
    .mobile-page-header h1 {
      font-size: 1.1rem;
    }
    
    /* Mobile User Management Styles */
    .mobile-filter-card .card-body {
      padding: 0.5rem;
    }
    
    .mobile-user-card {
      padding: 0.75rem !important;
    }
    
    .mobile-quick-summary {
      margin: -0.75rem -0.75rem 0.75rem;
      padding: 1rem 0.75rem;
    }
    
    .mobile-transaction-details .card {
      margin-bottom: 0.5rem;
    }
    
    .mobile-transaction-details .card-header {
      padding: 0.625rem 0.75rem;
    }
    
    .mobile-transaction-details .card-body {
      padding: 0.625rem 0.75rem;
    }
    
    .mobile-transaction-details .mb-3 {
      margin-bottom: 0.75rem !important;
      padding-bottom: 0.5rem;
    }
    
    .mobile-transaction-details .form-label {
      font-size: 0.7rem;
    }
    
    .mobile-transaction-details .text-muted {
      font-size: 0.8rem;
    }
  }
}

/* Mobile User Management Page Styles */
@media (max-width: 991.98px) {
  .mobile-filter-card {
    margin: 0 -0.75rem 1rem;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
  }
  
  .mobile-filter-card .card-body {
    padding: 0.75rem;
  }
  
  .mobile-users-list {
    margin: 0 -0.75rem;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
  }
  
  .mobile-user-card {
    background: white;
    transition: background-color 0.2s ease;
  }
  
  .mobile-user-card:active {
    background-color: #f1f5f9;
  }
  
  .mobile-user-card:last-child {
    border-bottom: none !important;
    margin-bottom: 5rem; /* Space for FAB */
  }
  
  .mobile-user-card .dropdown-toggle {
    padding: 0.25rem 0.5rem;
    border: 1px solid #e2e8f0;
  }
  
  .mobile-user-card .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
  
  .mobile-user-card .dropdown-menu {
    min-width: 180px;
  }
}

@media (max-width: 575.98px) {
  .mobile-filter-card {
    margin: 0 -0.5rem 0.75rem;
  }
  
  .mobile-users-list {
    margin: 0 -0.5rem;
  }
  
  .mobile-user-card {
    padding: 0.625rem !important;
  }
  
  .mobile-user-card .bg-primary.bg-opacity-10 {
    padding: 0.375rem !important;
  }
  
  .mobile-user-card .fw-semibold {
    font-size: 0.875rem;
  }
  
  .mobile-user-card .small {
    font-size: 0.75rem;
  }
}

/* Mobile Form Pages (Create/Edit) Styles */
@media (max-width: 991.98px) {
  .mobile-form-container {
    margin: 0 -0.75rem;
  }
  
  .mobile-form-card {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
    /* margin-bottom: 5rem; /* Space for mobile navigation */
  }
  
  .mobile-form-card .card-header {
    border-radius: 0;
    padding: 1rem;
  }
  
  .mobile-form-card .card-header h5 {
    font-size: 1rem;
  }
  
  .mobile-form-card .card-body {
    padding: 1rem;
  }
  
  .mobile-form-card h6 {
    font-size: 0.875rem;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
  }
  
  .mobile-form-card .form-label {
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
  }
  
  .mobile-form-card .form-control,
  .mobile-form-card .form-select {
    font-size: 1rem; /* Keep inputs readable */
  }
  
  .mobile-form-card .input-group-text {
    font-size: 0.875rem;
  }
  
  /* Compact spacing for mobile */
  .mobile-form-card .row.g-3 > * {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  
  .mobile-form-card .mt-4 {
    margin-top: 1.5rem !important;
  }
  
  .mobile-form-card .mt-5 {
    margin-top: 2rem !important;
  }
}

@media (max-width: 575.98px) {
  .mobile-form-container {
    margin: 0 -0.5rem;
  }
  
  .mobile-form-card .card-header {
    padding: 0.75rem;
  }
  
  .mobile-form-card .card-body {
    padding: 0.75rem;
  }
  
  .mobile-form-card h6 {
    font-size: 0.8rem;
  }
  
  .mobile-form-card .form-label {
    font-size: 0.8rem;
  }
  
  .mobile-form-card .btn {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }
  
  /* Extra compact row spacing */
  .mobile-form-card .row.g-3 > * {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
  }
}