@import url("forms.css");
@import url("tables.css");

/* ============================================
   Pay-U Design System - Consolidated
   ============================================ */

:root {
  /* Primary Colors */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;

  /* Sidebar Colors - Light Theme */
  --sidebar-bg: #ffffff;
  --sidebar-hover: #f1f5f9;
  --sidebar-active-bg: rgba(37, 99, 235, 0.08);
  --sidebar-text: #475569;
  --sidebar-text-active: #2563eb;
  --sidebar-text-hover: #0f172a;

  /* Neutral Colors */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Status Colors */
  --success: #22c55e;
  --success-light: #dcfce7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #3b82f6;
  --info-light: #dbeafe;

  /* Card Icon Colors */
  --icon-green: #22c55e;
  --icon-green-bg: #dcfce7;
  --icon-yellow: #f59e0b;
  --icon-yellow-bg: #fef3c7;
  --icon-red: #ef4444;
  --icon-red-bg: #fee2e2;
  --icon-blue: #3b82f6;
  --icon-blue-bg: #dbeafe;
  --icon-purple: #8b5cf6;
  --icon-purple-bg: #ede9fe;
  --icon-orange: #f97316;
  --icon-orange-bg: #ffedd5;

  /* Background & Borders */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Text Colors */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  /* Accent Colors */
  --accent-red: #ef4444;
  --accent-red-light: #fee2e2;
  --accent-green: #22c55e;
  --accent-green-light: #dcfce7;
  --accent-orange: #f97316;
  --accent-orange-light: #ffedd5;
  --accent-blue: #3b82f6;
  --accent-blue-light: #dbeafe;

  /* Design Tokens - Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);

  /* Design Tokens - Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Design Tokens - Transitions */
  --transition-fast: all 0.15s ease;
  --transition: all 0.2s ease;
  --transition-slow: all 0.3s ease;

  /* Design Tokens - Font Sizes */
  --font-size-xs: 10px;
  --font-size-sm: 12px;
  --font-size-md: 13px;
  --font-size-lg: 14px;
  --font-size-xl: 18px;

  /* Design Tokens - Spacing */
  --space-1: 3px;
  --space-2: 6px;
  --space-3: 10px;
  --space-4: 14px;
  --space-5: 18px;
  --space-6: 20px;
  --space-8: 28px;
  --space-10: 36px;

  /* Spacing Aliases */
  --space-sm: 6px;
  --space-md: 10px;
  --space-lg: 16px;
  --space-xl: 28px;

  /* Box Sizing */
  box-sizing: border-box;

  /* Layout */
  --header-height: 56px;
  --sidebar-width: 220px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================
   Reset & Base
   ============================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--gray-900);
  background: var(--bg-body);
}

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

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, select {
  font-family: inherit;
}

/* ============================================
   Layout
   ============================================ */

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

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.sidebar-wrapper.collapsed ~ .main-content {
  margin-left: 80px;
}

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

/* ============================================
   Sidebar
   ============================================ */

.sidebar-wrapper {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--border-color);
  transition: width 0.3s ease;
}

.sidebar-wrapper.collapsed {
  width: 80px;
}

.sidebar-wrapper.collapsed .sidebar-logo-text,
.sidebar-wrapper.collapsed .menu-text,
.sidebar-wrapper.collapsed .menu-arrow {
  display: none;
}

.sidebar-wrapper.collapsed .sidebar-menu-link {
  justify-content: center;
  padding: 12px;
  position: relative;
}

.sidebar-wrapper.collapsed .sidebar-submenu,
.sidebar-wrapper.collapsed .sidebar-menu-item.expanded > .sidebar-submenu {
  display: none !important;
}

.sidebar-wrapper.collapsed .sidebar-menu-item {
  position: relative;
}

.sidebar-wrapper.collapsed .sidebar-menu-item.has-submenu:hover > .sidebar-submenu {
  display: block !important;
  position: fixed;
  left: 80px;
  top: auto;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 8px 0;
  z-index: 200;
  padding-left: 0;
}

.sidebar-wrapper.collapsed .sidebar-menu-item.has-submenu:hover > .sidebar-submenu .sidebar-submenu-link {
  padding: 10px 16px;
  padding-left: 32px;
}

.sidebar-wrapper.collapsed .sidebar-collapse-btn {
  left: calc(80px - 20px);
}

.sidebar-wrapper.collapsed .sidebar-menu-link[data-tooltip] {
  position: relative;
}

.sidebar-wrapper.collapsed .sidebar-menu-link[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-800);
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  pointer-events: none;
  z-index: 300;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-wrapper.collapsed .sidebar-menu-link[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

.sidebar-collapse-btn {
  position: fixed;
  left: calc(var(--sidebar-width) - 15px);
  top: calc(var(--header-height) / 1.5);
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 101;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.sidebar-collapse-btn svg {
  width: 16px;
  height: 16px;
  color: var(--gray-700);
  transition: transform 0.3s;
}

.sidebar-collapse-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sidebar-collapse-btn:hover svg {
  color: var(--white);
}

.sidebar-wrapper.collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.sidebar-logo {
  padding: 16px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}

.sidebar-logo-text {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--gray-900);
}

.sidebar {
  width: 100%;
  height: 100%;
}

.sidebar-nav {
  padding: 6px 10px;
}

.sidebar-menu {
  padding: 0;
}

.sidebar-menu-item {
  margin-bottom: 4px;
}

.sidebar-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar-menu-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-hover);
}

.sidebar-menu-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
}

.sidebar-menu-link .menu-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-menu-link .menu-text {
  flex: 1;
}

.sidebar-menu-link .menu-arrow {
  transition: transform 0.2s;
  color: var(--gray-400);
}

.sidebar-menu-item.expanded .menu-arrow {
  transform: rotate(180deg);
}

.sidebar-submenu {
  list-style: none;
  padding-left: 42px;
  margin-top: 2px;
  margin-bottom: 4px;
  display: none;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding-top: 4px;
  padding-bottom: 4px;
}

.sidebar-menu-item.expanded .sidebar-submenu {
  display: block;
}

.sidebar-submenu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  transition: all 0.2s;
}

.sidebar-submenu-link::before {
  content: '';
  width: 8px;
  height: 8px;
  border: 2px solid var(--gray-400);
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-submenu-link:hover {
  color: var(--gray-900);
}

.sidebar-submenu-link.active {
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.sidebar-submenu-link.active::before {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

/* ============================================
   Top Header
   ============================================ */

.top-header {
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-center .page-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--gray-900);
}

.hamburger-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  transition: all 0.2s;
}

.hamburger-btn:hover {
  background: var(--gray-50);
}

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

.logo-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--primary-color);
}

.logo-icon svg {
  width: 28px;
  height: 28px;
}

/* Admin Info & Dropdown */
.admin-info {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.admin-info:hover {
  background: var(--gray-50);
}

.admin-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
}

.admin-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-900);
}

.admin-dropdown svg {
  width: 14px;
  height: 14px;
  color: var(--gray-400);
}

.admin-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 200px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
  z-index: 1000;
  overflow: hidden;
}

.admin-info.active .admin-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.admin-user-info {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.admin-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.admin-user-role {
  font-size: 11px;
  color: var(--gray-500);
}

.dropdown-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 12px;
  transition: all 0.2s;
}

.dropdown-menu-item:hover {
  background: var(--gray-50);
}

.dropdown-menu-item.logout {
  color: var(--danger);
}

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

/* Header Icon Button */
.header-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--gray-500);
  text-decoration: none;
}

.header-icon-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: var(--danger);
  color: var(--white);
  font-size: 9px;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Profile Dropdown */
.profile-dropdown {
  position: relative;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-btn:hover {
  background: var(--gray-100);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 180px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1000;
}

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

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--gray-700);
  transition: all 0.15s ease;
}

.profile-menu-item:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

.profile-menu-item.logout {
  color: var(--danger);
}

.profile-menu-item.logout:hover {
  background: var(--danger-light);
}

.profile-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* Language Switcher */
.language-switcher {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--gray-600);
}

.language-switcher svg {
  color: var(--gray-500);
}

.language-switcher select {
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  outline: none;
  padding-right: 4px;
}

.language-switcher select option {
  background: var(--white);
  color: var(--gray-700);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.2s;
}

.theme-toggle-btn:hover {
  background: var(--bg);
}

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

body.dark-mode .theme-toggle-btn .sun-icon {
  display: none;
}

body.dark-mode .theme-toggle-btn .moon-icon {
  display: block;
}

/* ============================================
   Page Header
   ============================================ */

.page-header,
.page-header-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: 10px;
}

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

.page-header-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-light);
  color: var(--primary-color);
}

.page-header-icon svg {
  width: 18px;
  height: 18px;
}

.page-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}

.page-header-right,
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
  cursor: pointer;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.15);
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.25);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--white);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-400);
  color: var(--text-primary);
}

.btn-outline.active {
  background: var(--primary-light);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
}

.btn-lg {
  height: 40px;
  padding: 0 20px;
  font-size: 13px;
}

.btn-icon {
  padding: 6px;
  width: 32px;
  height: 32px;
}

/* ============================================
   Currency Selector
   ============================================ */

.currency-selector {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-900);
  cursor: pointer;
  margin-bottom: var(--space-4);
}

.currency-selector select {
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-900);
  cursor: pointer;
  outline: none;
  padding-right: 4px;
}

/* Date Filters */
.time-filters-inline,
.date-filter-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: var(--space-4);
  padding-left: var(--space-4);
  border-left: 1px solid var(--border-color);
}

.date-range-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--gray-700);
  background: var(--white);
  cursor: pointer;
  outline: none;
}

.date-input:focus {
  border-color: var(--primary-color);
}

.date-separator {
  color: var(--gray-400);
  font-size: var(--font-size-sm);
}

/* ============================================
   Stats Grid & Cards
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-3);
  margin-bottom: 20px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.2);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-info {
  flex: 1;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* Mini Stat Cards (Dashboard) */
.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.stat-card-mini {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-2);
  text-align: center;
  border: 1px solid var(--border-color);
}

.stat-card-mini-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
}

.stat-card-mini-icon.green { background: var(--icon-green-bg); color: var(--icon-green); }
.stat-card-mini-icon.yellow { background: var(--icon-yellow-bg); color: var(--icon-yellow); }
.stat-card-mini-icon.red { background: var(--icon-red-bg); color: var(--icon-red); }
.stat-card-mini-icon.blue { background: var(--icon-blue-bg); color: var(--icon-blue); }
.stat-card-mini-icon.purple { background: var(--icon-purple-bg); color: var(--icon-purple); }
.stat-card-mini-icon.orange { background: var(--icon-orange-bg); color: var(--icon-orange); }
.stat-card-mini-icon.pink { background: #fce7f3; color: #ec4899; }
.stat-card-mini-icon.lightblue { background: #e0f2fe; color: #0ea5e9; }
.stat-card-mini-icon.peach { background: #ffedd5; color: #f97316; }

.stat-card-mini-label {
  font-size: 10px;
  color: var(--gray-500);
  margin-bottom: 2px;
  line-height: 1.3;
}

.stat-card-mini-value {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--gray-900);
}

.stat-card-mini-value.green { color: var(--icon-green); }
.stat-card-mini-value.yellow { color: var(--icon-yellow); }
.stat-card-mini-value.red { color: var(--icon-red); }
.stat-card-mini-value.pink { color: #ec4899; }
.stat-card-mini-value.blue { color: var(--icon-blue); }
.stat-card-mini-value.dash { color: var(--gray-400); }

/* ============================================
   Section Cards
   ============================================ */

.section-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
  overflow: hidden;
}

.section-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.2);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}

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

.section-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--gray-900);
}

.section-subtitle {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}

.section-body {
  padding: var(--space-4);
}

.section-body.no-padding {
  padding: 0;
}

/* ============================================
   Action Bar
   ============================================ */

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: var(--space-4);
}

.action-bar-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.action-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   Search Box
   ============================================ */

.search-box {
  position: relative;
  flex: 1;
  max-width: 280px;
}

.search-box .search-icon,
.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--gray-400);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--gray-800);
  background: var(--white);
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box input::placeholder {
  color: var(--gray-400);
}

/* ============================================
   Filter Bar
   ============================================ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-3);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-input,
.filter-select {
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--gray-700);
  background: var(--white);
  cursor: pointer;
  min-width: 120px;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.filter-bar-left,
.filter-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.filter-time {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

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

.filter-btn-apply {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--primary-color);
  border: none;
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.filter-btn-apply:hover {
  background: var(--primary-hover);
}

/* ============================================
   Form Elements
   ============================================ */

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

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

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}

.form-label .required {
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: all 0.15s ease-in-out;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input:disabled,
.form-select:disabled {
  background: var(--gray-50);
  cursor: not-allowed;
}

.form-input::placeholder {
  color: var(--gray-400);
}

.form-textarea {
  height: auto;
  min-height: 80px;
  padding: 8px 12px;
  resize: vertical;
}

.form-input-group {
  display: flex;
  align-items: stretch;
}

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

.form-input-group button {
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--gray-50);
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-input-group button:hover {
  background: var(--gray-100);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-3);
}

/* ============================================
   Data Tables
   ============================================ */

.table-container {
  overflow-x: auto;
}

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

.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: all 0.2s ease;
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

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

/* User/Agent Cell */
.user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 500;
  color: var(--gray-800);
}

.user-email {
  font-size: 11px;
  color: var(--gray-500);
}

/* Amount Cell */
.amount {
  font-weight: 600;
  color: var(--gray-800);
}

/* Table Footer / Pagination */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-top: 1px solid var(--border-color);
  background: var(--gray-50);
}

.table-info {
  font-size: 11px;
  color: var(--gray-500);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  padding: 4px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

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

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Table Row Actions */
.actions-cell {
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.action-btn.view {
  color: var(--info);
  border-color: var(--info-light);
}

.action-btn.view:hover {
  background: var(--info-light);
}

.action-btn.edit {
  color: var(--warning);
  border-color: var(--warning-light);
}

.action-btn.edit:hover {
  background: var(--warning-light);
}

.action-btn.danger {
  color: var(--danger);
  border-color: var(--danger-light);
}

.action-btn.danger:hover {
  background: var(--danger-light);
}

.action-btn.success {
  color: var(--success);
  border-color: var(--success-light);
}

.action-btn.success:hover {
  background: var(--success-light);
}

/* ============================================
   Badges
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-success::before { background: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-danger::before { background: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-warning::before { background: #b45309; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-info::before { background: #1d4ed8; }
.badge-neutral { background: #f1f5f9; color: #475569; }
.badge-neutral::before { background: #475569; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-purple::before { background: #6d28d9; }

/* ============================================
   Status Badges
   ============================================ */

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.status-badge.active { background: #dcfce7; color: #15803d; }
.status-badge.inactive { background: #fee2e2; color: #b91c1c; }
.status-badge.pending { background: #fef3c7; color: #b45309; }
.status-badge.disabled { background: #f1f5f9; color: #475569; }
.status-badge.frozen { background: #ede9fe; color: #6d28d9; }
.status-badge.suspended { background: var(--gray-100); color: var(--gray-600); }
.status-badge.success { background: #dcfce7; color: #15803d; }
.status-badge.processed { background: #dcfce7; color: #15803d; }
.status-badge.failed { background: #fee2e2; color: #b91c1c; }
.status-badge.info { background: #dbeafe; color: #1d4ed8; }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Operation Badges */
.operation-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.operation-badge.green { background: var(--icon-green-bg); color: var(--icon-green); }
.operation-badge.orange { background: var(--icon-orange-bg); color: var(--icon-orange); }
.operation-badge.red { background: var(--icon-red-bg); color: var(--icon-red); }
.operation-badge.blue { background: var(--icon-blue-bg); color: var(--icon-blue); }

/* Log Type Badges */
.log-type-badge { display: inline-flex; align-items: center; justify-content: center; padding: 6px 12px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600; }
.log-type-badge.transaction { background: #dcfce7; color: #15803d; }
.log-type-badge.system { background: #fef3c7; color: #b45309; }
.log-type-badge.error { background: #fee2e2; color: #b91c1c; }
.log-type-badge.logout { background: #f1f5f9; color: #475569; }
.log-type-badge.login { background: #dbeafe; color: #1d4ed8; }
.log-type-badge.security { background: #ede9fe; color: #6d28d9; }

/* ============================================
   Modals
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease-in-out;
  padding: 16px;
}

.modal-overlay.active,
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.2s ease-in-out;
}

.modal-overlay.active .modal,
.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--gray-900);
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

.modal-body {
  padding: var(--space-4);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: var(--space-3) 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* ============================================
   Toggle Switch
   ============================================ */

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--white);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-700);
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  text-align: center;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}

.empty-state-title {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 12px;
  color: var(--gray-500);
  max-width: 320px;
}

/* ============================================
   Rules Grid
   ============================================ */

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  padding: 14px 18px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: var(--space-2);
  background: var(--gray-50);
  border-radius: var(--radius-md);
}

.rule-icon {
  width: 18px;
  height: 18px;
  color: var(--primary-color);
  flex-shrink: 0;
  margin-top: 2px;
}

.rule-content {
  flex: 1;
}

.rule-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
}

.rule-desc {
  font-size: 10px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* ============================================
   Toast
   ============================================ */

.toast {
  position: fixed;
  top: 16px;
  right: 16px;
  background: var(--gray-900);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  z-index: 10000;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
}

.toast.show {
  transform: translateX(0);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--info); }

/* ============================================
   Dashboard - KPI Section
   ============================================ */

.kpi-section {
  margin-bottom: 20px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
}

.kpi-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

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

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon.green { background: var(--icon-green-bg); color: var(--icon-green); }
.kpi-icon.yellow { background: var(--icon-yellow-bg); color: var(--icon-yellow); }
.kpi-icon.red { background: var(--icon-red-bg); color: var(--icon-red); }
.kpi-icon.blue { background: var(--icon-blue-bg); color: var(--icon-blue); }
.kpi-icon.purple { background: var(--icon-purple-bg); color: var(--icon-purple); }
.kpi-icon.orange { background: var(--icon-orange-bg); color: var(--icon-orange); }
.kpi-icon.lightblue { background: #e0f2fe; color: #0284c7; }
.kpi-icon.peach { background: #ffedd5; color: #ea580c; }
.kpi-icon.pink { background: #fce7f3; color: #db2777; }
.kpi-icon.teal { background: #ccfbf1; color: #0d9488; }

.kpi-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 500;
}

.kpi-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.kpi-value.green { color: var(--icon-green); }
.kpi-value.yellow { color: var(--icon-yellow); }
.kpi-value.red { color: var(--icon-red); }
.kpi-value.dash { color: var(--gray-400); }

/* ============================================
   Dashboard - Operations Section
   ============================================ */

.operations-section {
  margin-bottom: 20px;
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.operation-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.operation-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.operation-icon.blue { background: var(--icon-blue-bg); color: var(--icon-blue); }
.operation-icon.green { background: var(--icon-green-bg); color: var(--icon-green); }
.operation-icon.orange { background: var(--icon-orange-bg); color: var(--icon-orange); }
.operation-icon.purple { background: var(--icon-purple-bg); color: var(--icon-purple); }
.operation-icon.red { background: var(--icon-red-bg); color: var(--icon-red); }
.operation-icon.teal { background: #ccfbf1; color: #0d9488; }

.operation-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.operation-label {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 500;
}

.operation-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

/* ============================================
   Dashboard - Activity Section
   ============================================ */

.activity-section {
  margin-bottom: 20px;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.activity-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.activity-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 16px;
  border-bottom: 1px solid var(--border-color);
}

.activity-card-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
}

.view-all-link {
  font-size: 11px;
  color: var(--primary-color);
  font-weight: 500;
}

.view-all-link:hover {
  text-decoration: underline;
}

.activity-list {
  padding: 8px 0;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 16px;
  transition: background 0.2s;
}

.activity-item:hover {
  background: var(--gray-50);
}

.activity-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-item-icon.green { background: var(--icon-green-bg); color: var(--icon-green); }
.activity-item-icon.red { background: var(--icon-red-bg); color: var(--icon-red); }
.activity-item-icon.blue { background: var(--icon-blue-bg); color: var(--icon-blue); }
.activity-item-icon.orange { background: var(--icon-orange-bg); color: var(--icon-orange); }

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

.activity-item-title {
  font-size: 12px;
  color: var(--gray-700);
}

.activity-item-time {
  font-size: 11px;
  color: var(--gray-400);
}

.activity-item-amount {
  font-size: 12px;
  font-weight: 600;
}

.activity-item-amount.green { color: var(--icon-green); }
.activity-item-amount.red { color: var(--icon-red); }

/* ============================================
   Dashboard - Bottom Section
   ============================================ */

.bottom-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: 20px;
}

/* System Health */
.health-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

.health-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.health-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.health-icon.green { background: var(--icon-green-bg); color: var(--icon-green); }
.health-icon.orange { background: var(--icon-orange-bg); color: var(--icon-orange); }

.health-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.health-label {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 500;
}

.health-value {
  font-size: 12px;
  font-weight: 600;
}

.health-value.green { color: var(--icon-green); }
.health-value.orange { color: var(--icon-orange); }

.health-uptime {
  font-size: 10px;
  color: var(--gray-400);
  white-space: nowrap;
}

/* Quick Actions */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

.actions-grid .action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  width: auto !important;
  height: auto !important;
  min-height: 44px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--gray-700);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.actions-grid .action-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
}

.actions-grid .action-btn svg {
  flex-shrink: 0;
}

/* ============================================
   Summary Table
   ============================================ */

.summary-section {
  margin-bottom: var(--space-4);
}

.summary-table-wrapper {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
}

.summary-table th {
  padding: var(--space-2) var(--space-3);
  background: var(--gray-50);
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.summary-table td {
  padding: 10px var(--space-3);
  font-size: 12px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--border-light);
}

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

.summary-table .green { color: var(--icon-green); font-weight: 500; }
.summary-table .yellow { color: var(--icon-yellow); font-weight: 500; }
.summary-table .red { color: var(--icon-red); font-weight: 500; }
.summary-table .dash { color: var(--gray-400); }
.summary-table .bold { font-weight: 600; color: var(--gray-900); }

/* ============================================
   Currency Tables
   ============================================ */

.currency-table-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
  overflow: hidden;
}

.currency-table-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-2) var(--space-3);
  background: var(--gray-50);
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}

.currency-table-header span {
  flex: 1;
  text-align: center;
}

.currency-table-header span:first-child {
  text-align: left;
}

.currency-row {
  display: grid;
  grid-template-columns: 120px repeat(10, 1fr);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.currency-row:last-child {
  border-bottom: none;
}

.currency-cell {
  text-align: center;
  font-size: 11px;
  color: var(--gray-700);
}

.currency-cell:first-child { text-align: left; }
.currency-cell.green { color: var(--icon-green); }
.currency-cell.yellow { color: var(--icon-yellow); }
.currency-cell.red { color: var(--icon-red); }
.currency-cell.blue { color: var(--icon-blue); }
.currency-cell.bold { font-weight: 600; }
.currency-cell.dash { color: var(--gray-400); }

.currency-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--gray-900);
  cursor: pointer;
}

.currency-flag img,
.currency-flag .flag-icon {
  width: 24px;
  height: 16px;
  border-radius: 2px;
  object-fit: cover;
}

.footer-note {
  text-align: center;
  font-size: 11px;
  color: var(--gray-500);
  margin-top: var(--space-3);
}

/* ============================================
   Icon Upload
   ============================================ */

.icon-upload {
  border: 2px dashed var(--border-color);
}

/* ============================================
   Responsive - Large Screens
   ============================================ */

@media (max-width: 1400px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-cards-row {
    grid-template-columns: repeat(5, 1fr);
  }

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

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

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

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

  .currency-row {
    grid-template-columns: 120px repeat(10, 1fr);
    font-size: 12px;
  }
}

/* ============================================
   Responsive - Sidebar Breakpoint
   ============================================ */

@media (max-width: 1024px) {
  .sidebar-wrapper {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar-wrapper.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  }

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

  .hamburger-btn {
    display: flex;
  }

  .filter-bar {
    flex-direction: column;
    gap: var(--space-4);
    align-items: stretch;
  }

  .filter-bar-left,
  .filter-bar-right {
    justify-content: center;
  }

  .bottom-section {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Responsive - Tablet
   ============================================ */

@media (max-width: 768px) {
  .page-content {
    padding: var(--space-4);
  }

  .top-header {
    padding: 0 var(--space-4);
  }

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

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

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

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

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

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

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

  .form-grid,
  .form-grid-2,
  .form-grid-4 {
    grid-template-columns: 1fr;
  }

  .page-header,
  .page-header-section {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .page-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .filter-input,
  .filter-select {
    width: 100%;
    min-width: unset;
  }

  .filter-actions {
    margin-left: 0;
    width: 100%;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-bar-left,
  .action-bar-right {
    width: 100%;
  }

  .search-box {
    max-width: none;
  }

  .modal {
    margin: 10px;
    max-height: calc(100vh - 20px);
  }

  .summary-table-wrapper {
    overflow-x: auto;
  }

  .summary-table {
    min-width: 800px;
  }

  .data-table {
    min-width: 800px;
  }

  .currency-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .currency-cell:nth-child(n+5) {
    display: none;
  }
}

/* ============================================
   Responsive - Mobile
   ============================================ */

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

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

  .filter-time {
    flex-wrap: wrap;
    justify-content: center;
  }

  .date-range-picker {
    flex-direction: column;
    width: 100%;
  }

  .date-input {
    width: 100%;
  }
}

/* ============================================
   Dark Mode
   ============================================ */

body.dark-mode {
  --bg: #0f172a;
  --card: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --sidebar-bg: #1e293b;
  --sidebar-text: #94a3b8;
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --border-color: #334155;
  --border-light: #1e293b;
}

body.dark-mode .sidebar-wrapper {
  background: #1e293b;
  border-right-color: #334155;
}

body.dark-mode .sidebar-logo-text {
  color: #f1f5f9;
}

body.dark-mode .sidebar-menu-link {
  color: #94a3b8;
}

body.dark-mode .sidebar-menu-link:hover {
  background: #334155;
  color: #f1f5f9;
}

body.dark-mode .sidebar-menu-link.active {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
}

body.dark-mode .sidebar-submenu {
  background: #0f172a;
}

body.dark-mode .sidebar-submenu-link {
  color: #94a3b8;
}

body.dark-mode .sidebar-submenu-link:hover {
  color: #f1f5f9;
}

body.dark-mode .sidebar-submenu-link.active {
  color: #60a5fa;
}

body.dark-mode .sidebar-submenu-link::before {
  border-color: #64748b;
}

body.dark-mode .sidebar-submenu-link.active::before {
  background: #60a5fa;
  border-color: #60a5fa;
}

body.dark-mode .top-header {
  background: #1e293b;
  border-bottom-color: #334155;
}

body.dark-mode .page-title,
body.dark-mode .section-title {
  color: #f1f5f9;
}

body.dark-mode .hamburger-btn:hover {
  background: #334155;
}

body.dark-mode .language-switcher {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .language-switcher select {
  color: #f1f5f9;
}

body.dark-mode .header-icon-btn:hover {
  background: #334155;
}

body.dark-mode .admin-info:hover {
  background: #334155;
}

body.dark-mode .admin-dropdown-menu {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .dropdown-menu-item {
  color: #f1f5f9;
}

body.dark-mode .dropdown-menu-item:hover {
  background: #334155;
}

body.dark-mode .section-card,
body.dark-mode .stat-card,
body.dark-mode .kpi-card,
body.dark-mode .activity-card,
body.dark-mode .health-card,
body.dark-mode .operation-card {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .card {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .card-header {
  border-bottom-color: #334155;
}

body.dark-mode .form-input,
body.dark-mode .form-select,
body.dark-mode .form-textarea {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .filter-input,
body.dark-mode .filter-select {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .filter-bar {
  background: #1e293b;
}

body.dark-mode .data-table th {
  background: #0f172a;
  border-bottom-color: #334155;
  color: #94a3b8;
}

body.dark-mode .data-table td {
  border-bottom-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .data-table tbody tr:hover {
  background: #334155;
}

body.dark-mode .table-footer {
  border-top-color: #334155;
  color: #94a3b8;
  background: #1e293b;
}

body.dark-mode .pagination-btn {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .pagination-btn:hover {
  background: #334155;
}

body.dark-mode .preview-card {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .modal {
  background: #1e293b;
}

body.dark-mode .modal-footer {
  background: #1e293b;
}

body.dark-mode .toggle-slider {
  background: #475569;
}

body.dark-mode .btn-outline {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .btn-outline:hover:not(:disabled) {
  background: #334155;
}

body.dark-mode .icon-upload {
  border-color: #334155;
}

body.dark-mode .notification-badge {
  background: #ef4444;
}

body.dark-mode .empty-state-icon {
  background: #334155;
  color: #94a3b8;
}

body.dark-mode .action-btn {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

body.dark-mode .action-btn:hover {
  background: #334155;
  color: #f1f5f9;
}

body.dark-mode .summary-table th {
  background: #0f172a;
  border-bottom-color: #334155;
}

body.dark-mode .summary-table td {
  border-bottom-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .currency-table-header {
  background: #0f172a;
  border-bottom-color: #334155;
}

body.dark-mode .currency-row {
  border-bottom-color: #334155;
}

body.dark-mode .activity-item:hover {
  background: #334155;
}

body.dark-mode .search-box input {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .date-input {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .stat-card-mini {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .rule-item {
  background: #0f172a;
}

body.dark-mode .health-card {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .currency-selector {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .profile-menu {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .sidebar-collapse-btn {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .sidebar-collapse-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

body.dark-mode .sidebar-wrapper.collapsed .sidebar-menu-item.has-submenu:hover > .sidebar-submenu {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .sidebar-wrapper.collapsed .sidebar-menu-link[data-tooltip]::after {
  background: #334155;
}

/* ============================================
   Utility: Icon Backgrounds
   ============================================ */
.icon-bg-blue { background: rgba(52, 152, 219, 0.1); color: #3498db; }
.icon-bg-primary { background: rgba(108, 92, 231, 0.1); color: var(--primary); }
.icon-bg-primary-alt { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
.icon-bg-green { background: rgba(39, 174, 96, 0.1); color: #27ae60; }
.icon-bg-green-alt { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.icon-bg-success { background: var(--success-bg); color: var(--success); }
.icon-bg-red { background: rgba(231, 76, 60, 0.1); color: #e74c3c; }
.icon-bg-danger { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.icon-bg-purple { background: rgba(155, 89, 182, 0.1); color: #9b59b6; }
.icon-bg-purple-alt { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }
.icon-bg-teal { background: rgba(0, 206, 209, 0.1); color: #00ced1; }
.icon-bg-warning { background: rgba(243, 156, 18, 0.1); color: #f39c12; }
.icon-bg-warning-alt { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.icon-bg-yellow { background: rgba(253, 203, 110, 0.15); color: #d97706; }
.icon-bg-cyan { background: rgba(116, 185, 255, 0.1); color: #74B9FF; }
.icon-bg-mint { background: rgba(0, 184, 148, 0.1); color: #00B894; }
.icon-bg-sky { background: rgba(14, 165, 233, 0.1); color: #0ea5e9; }
.icon-bg-pink { background: rgba(236, 72, 153, 0.1); color: #db2777; }
.icon-bg-gray { background: rgba(107, 114, 128, 0.1); color: #4b5563; }
.icon-bg-dark { background: #1e1e2e; color: #cdd6f4; }

/* Solid icon backgrounds (for SDK/provider logos) */
.icon-solid-blue { background: #3b82f6; }
.icon-solid-blue-dark { background: #1d4ed8; }
.icon-solid-green { background: #22c55e; }
.icon-solid-green-dark { background: #16a34a; }
.icon-solid-amber { background: #f59e0b; }
.icon-solid-amber-dark { background: #d97706; }
.icon-solid-violet { background: #8b5cf6; }
.icon-solid-violet-dark { background: #7c3aed; }
.icon-solid-orange { background: #E17055; }
.icon-solid-yellow { background: #FDCB6E; color: #1F2937; }
.icon-solid-blue-sky { background: #74B9FF; }
.icon-solid-mint { background: #00B894; }
.icon-solid-navy { background: #3776AB; }
.icon-solid-purple { background: #6C5CE7; }
.icon-solid-green-light { background: #dcfce7; color: #16a34a; }
.icon-solid-blue-light { background: #dbeafe; color: #2563eb; }
.icon-solid-amber-light { background: #fef3c7; color: #d97706; }
.icon-solid-red-light { background: #fee2e2; color: #dc2626; }
.icon-solid-teal-light { background: #cffafe; color: #0891b2; }
.icon-solid-violet-light { background: #ede9fe; color: #7c3aed; }

/* Currency flag icons */
.icon-flag-uganda { background: #198a00; border-radius: 50%; width: 20px; height: 20px; display: inline-block; }
.icon-flag-kenya { background: #00a1de; border-radius: 50%; width: 20px; height: 20px; display: inline-block; }
.icon-flag-tanzania { background: #000; border-radius: 50%; width: 20px; height: 20px; display: inline-block; }

/* ============================================
   Utility: Text Colors
   ============================================ */
.text-success { color: var(--success); }
.text-success-alt { color: #16a34a; }
.text-danger { color: var(--danger); }
.text-danger-alt { color: #dc2626; }
.text-warning { color: var(--warning); }
.text-warning-alt { color: #d97706; }
.text-primary { color: var(--primary); }
.text-primary-alt { color: #2563eb; }
.text-blue { color: #3498db; }
.text-purple { color: #9b59b6; }
.text-purple-alt { color: #7c3aed; }
.text-muted { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-800 { color: var(--gray-800); }

/* ============================================
   Utility: Layout Helpers
   ============================================ */
.detail-field-value {
  padding: 10px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}
.detail-field-value.mono {
  font-family: monospace;
}
.detail-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.detail-grid-gap {
  gap: 16px;
}
.icon-info-text {
  font-size: 12px;
  color: var(--gray-500);
  margin-left: auto;
}
.icon-info-text-left {
  font-size: 13px;
  color: var(--gray-500);
}

/* ============================================
   DASHBOARD MASTER DESIGN SYSTEM
   Global reference for all pages
   ============================================ */

/* --- Section Layout --- */
.dash-section {
  margin-bottom: var(--space-6);
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.dash-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}

.dash-section-subtitle {
  font-size: var(--font-size-sm);
  color: var(--gray-500);
  margin-top: 2px;
}

/* --- Grid System --- */
.dash-grid {
  display: grid;
  gap: var(--space-4);
}

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

/* --- Card System (Global Reference) --- */
.dash-card {
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dash-card-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dash-card-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  line-height: 1;
}

.dash-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.dash-card-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--gray-500);
}

.dash-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 600;
  font-size: 11px;
}

.dash-card-trend.up { color: var(--success); }
.dash-card-trend.down { color: var(--danger); }
.dash-card-trend.neutral { color: var(--gray-400); }

/* --- Card Icon --- */
.dash-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-card-icon.blue { background: var(--icon-blue-bg); color: var(--icon-blue); }
.dash-card-icon.green { background: var(--icon-green-bg); color: var(--icon-green); }
.dash-card-icon.yellow { background: var(--icon-yellow-bg); color: var(--icon-yellow); }
.dash-card-icon.red { background: var(--icon-red-bg); color: var(--icon-red); }
.dash-card-icon.purple { background: var(--icon-purple-bg); color: var(--icon-purple); }
.dash-card-icon.orange { background: var(--icon-orange-bg); color: var(--icon-orange); }
.dash-card-icon.teal { background: #ccfbf1; color: #0d9488; }
.dash-card-icon.pink { background: #fce7f3; color: #db2777; }

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

.status-dot.green { background: var(--success); box-shadow: 0 0 0 3px var(--success-light); }
.status-dot.yellow { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-light); }
.status-dot.red { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-light); }
.status-dot.gray { background: var(--gray-400); box-shadow: 0 0 0 3px var(--gray-100); }

/* --- Button System (Global Reference) --- */
.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1.5;
}

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

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

.dash-btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--border-color);
}
.dash-btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }

.dash-btn-success {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
}
.dash-btn-success:hover { background: #16a34a; border-color: #16a34a; }

.dash-btn-warning {
  background: var(--warning);
  color: var(--white);
  border-color: var(--warning);
}
.dash-btn-warning:hover { background: #d97706; border-color: #d97706; }

.dash-btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}
.dash-btn-danger:hover { background: #dc2626; border-color: #dc2626; }

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

.dash-btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: transparent;
}
.dash-btn-ghost:hover { background: var(--gray-100); }

.dash-btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-md);
}

.dash-btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

.dash-btn-lg {
  padding: 10px 20px;
  font-size: 13px;
}

/* --- Quick Action Cards --- */
.action-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.action-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.action-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary-color);
  transition: var(--transition);
}

.action-card:hover .action-card-icon {
  background: var(--primary-color);
  color: var(--white);
}

.action-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}

.action-card-desc {
  font-size: 11px;
  color: var(--gray-500);
  line-height: 1.4;
}

/* --- Health Card --- */
.health-card-master {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.health-card-master:hover {
  box-shadow: var(--shadow-md);
}

.health-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.health-card-icon.healthy { background: var(--success-light); color: var(--success); }
.health-card-icon.warning { background: var(--warning-light); color: var(--warning); }
.health-card-icon.error { background: var(--danger-light); color: var(--danger); }

.health-card-info {
  flex: 1;
  min-width: 0;
}

.health-card-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 2px;
}

.health-card-status {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.health-card-status.healthy { color: var(--success); }
.health-card-status.warning { color: var(--warning); }
.health-card-status.error { color: var(--danger); }

.health-card-uptime {
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* --- Activity Feed --- */
.activity-feed-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.activity-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.activity-feed-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
}

.activity-feed-link {
  font-size: 11px;
  font-weight: 500;
  color: var(--primary-color);
  text-decoration: none;
}

.activity-feed-link:hover { text-decoration: underline; }

.activity-feed-list {
  max-height: 320px;
  overflow-y: auto;
}

.activity-feed-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}

.activity-feed-item:last-child { border-bottom: none; }
.activity-feed-item:hover { background: var(--gray-50); }

.activity-feed-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-feed-dot.green { background: var(--success); }
.activity-feed-dot.blue { background: var(--info); }
.activity-feed-dot.orange { background: var(--warning); }
.activity-feed-dot.red { background: var(--danger); }
.activity-feed-dot.purple { background: var(--icon-purple); }

.activity-feed-content {
  flex: 1;
  min-width: 0;
}

.activity-feed-text {
  font-size: 12px;
  color: var(--gray-700);
  line-height: 1.4;
}

.activity-feed-text strong {
  font-weight: 600;
  color: var(--gray-900);
}

.activity-feed-time {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}

.activity-feed-amount {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.activity-feed-amount.positive { color: var(--success); }
.activity-feed-amount.negative { color: var(--danger); }

/* --- Chart Card --- */
.chart-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.chart-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
}

.chart-card-body {
  padding: 14px;
}

.chart-card-body canvas {
  width: 100% !important;
  height: 200px !important;
}

/* --- Filter Bar Master --- */
.dash-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px 14px;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.dash-filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.dash-filter-btn {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
}

.dash-filter-btn:hover { background: var(--gray-50); border-color: var(--gray-300); }

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

.dash-filter-select {
  padding: 5px 28px 5px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--white);
  color: var(--gray-700);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
  transition: var(--transition);
}

.dash-filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.dash-filter-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--white);
  transition: var(--transition);
  min-width: 180px;
}

.dash-filter-search:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.dash-filter-search svg {
  color: var(--gray-400);
  flex-shrink: 0;
}

.dash-filter-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-700);
  width: 100%;
}

.dash-filter-search input::placeholder {
  color: var(--gray-400);
}

.dash-filter-date {
  padding: 5px 10px;
  font-size: 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  color: var(--gray-700);
  transition: var(--transition);
}

.dash-filter-date:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.dash-filter-separator {
  color: var(--gray-400);
  font-size: 11px;
}

/* --- Page Header Master --- */
.dash-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.dash-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.dash-page-subtitle {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

.dash-page-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* --- Empty State --- */
.dash-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}

.dash-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  opacity: 0.5;
}

.dash-empty-text {
  font-size: 14px;
  font-weight: 500;
}

/* --- Responsive: Tablet --- */
@media (max-width: 1439px) {
  .dash-grid-6 { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* --- Responsive: Mobile --- */
@media (max-width: 767px) {
  .dash-grid-6,
  .dash-grid-5,
  .dash-grid-4,
  .dash-grid-3,
  .dash-grid-2 {
    grid-template-columns: 1fr;
  }

  .dash-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .dash-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-filter-group {
    flex-wrap: wrap;
  }

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

  .dash-card-value {
    font-size: 24px;
  }

  .chart-card-body canvas {
    height: 180px !important;
  }
}

/* --- Dark Mode: Dashboard Master Classes --- */
body.dark-mode .dash-card {
  background: var(--gray-850, #1e293b);
  border-color: var(--gray-700, #334155);
}

body.dark-mode .dash-card-title {
  color: var(--gray-400, #94a3b8);
}

body.dark-mode .dash-card-value {
  color: var(--gray-100, #f1f5f9);
}

body.dark-mode .dash-card-trend {
  color: var(--gray-500, #64748b);
}

body.dark-mode .dash-section-title {
  color: var(--gray-100, #f1f5f9);
}

body.dark-mode .dash-section-subtitle {
  color: var(--gray-500, #64748b);
}

body.dark-mode .health-card-master {
  background: var(--gray-850, #1e293b);
  border-color: var(--gray-700, #334155);
}

body.dark-mode .health-card-label {
  color: var(--gray-400, #94a3b8);
}

body.dark-mode .health-card-status {
  color: var(--gray-200, #e2e8f0);
}

body.dark-mode .health-card-uptime {
  color: var(--gray-500, #64748b);
}

body.dark-mode .activity-feed-card {
  background: var(--gray-850, #1e293b);
  border-color: var(--gray-700, #334155);
}

body.dark-mode .activity-feed-header {
  border-color: var(--gray-700, #334155);
}

body.dark-mode .activity-feed-title {
  color: var(--gray-100, #f1f5f9);
}

body.dark-mode .activity-feed-item {
  border-color: var(--gray-700, #334155);
}

body.dark-mode .activity-feed-item:hover {
  background: var(--gray-800, #1e293b);
}

body.dark-mode .activity-feed-text {
  color: var(--gray-300, #cbd5e1);
}

body.dark-mode .activity-feed-text strong {
  color: var(--gray-100, #f1f5f9);
}

body.dark-mode .chart-card {
  background: var(--gray-850, #1e293b);
  border-color: var(--gray-700, #334155);
}

body.dark-mode .chart-card-header {
  border-color: var(--gray-700, #334155);
}

body.dark-mode .action-card {
  background: var(--gray-850, #1e293b);
  border-color: var(--gray-700, #334155);
}

body.dark-mode .action-card:hover {
  border-color: var(--primary-color);
}

body.dark-mode .action-card-label {
  color: var(--gray-300, #cbd5e1);
}

body.dark-mode .dash-filter-bar {
  background: var(--gray-850, #1e293b);
  border-color: var(--gray-700, #334155);
}

body.dark-mode .dash-filter-date {
  background: var(--gray-800, #1e293b);
  border-color: var(--gray-700, #334155);
  color: var(--gray-200, #e2e8f0);
}

body.dark-mode .dash-filter-separator {
  color: var(--gray-500, #64748b);
}

body.dark-mode .status-dot.green {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

body.dark-mode .status-dot.yellow {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

body.dark-mode .status-dot.red {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

body.dark-mode .dash-filter-search {
  background: var(--gray-800, #1e293b);
  border-color: var(--gray-700, #334155);
}

body.dark-mode .dash-filter-search input {
  color: var(--gray-200, #e2e8f0);
}

body.dark-mode .dash-filter-search input::placeholder {
  color: var(--gray-500, #64748b);
}
