/* ============================================
   License Manager - Modern Admin Panel Styles
   Smooth, Elegant, Professional Design
   ============================================ */

/* CSS Variables - Modern Color Palette */
:root {
  /* Base Colors */
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #273549;
  --bg-input: #0f172a;
  --bg-navbar: #0f172a;

  /* Text Colors */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #60a5fa;

  /* Border Colors */
  --border-color: #334155;
  --border-light: #1e293b;

  /* Accent Colors - Modern Blue Palette */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #1d4ed8;
  --primary-glow: rgba(59, 130, 246, 0.4);

  /* Status Colors */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.15);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--primary-glow);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Layout */
  --navbar-height: 60px;
  --sidebar-width: 260px;
  --toolbar-height: 56px;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
  --z-popup: 500;
}

/* Light mode variables */
[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --bg-navbar: #ffffff;

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-accent: #3b82f6;

  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Bootstrap Overrides - Dark Theme
   ============================================ */

/* Force dark background on Bootstrap elements */
html, body, .container, .container-fluid {
  background-color: var(--bg-body) !important;
  color: var(--text-primary) !important;
}

/* Card dark theme */
.card, .card-body, .card-header, .card-footer {
  background-color: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}

.card {
  background-color: var(--bg-card) !important;
}

/* Table dark theme */
.table {
  color: var(--text-primary);
  background-color: transparent !important;
}

.table-hover tbody tr:hover {
  background-color: var(--bg-card-hover) !important;
}

/* Form dark theme */
.form-control, .form-select {
  background-color: var(--bg-input) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

.form-control:focus, .form-select:focus {
  background-color: var(--bg-input) !important;
  border-color: var(--primary) !important;
  color: var(--text-primary) !important;
}

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

/* Input group dark theme */
.input-group .form-control {
  background-color: var(--bg-input) !important;
  border-color: var(--border-color) !important;
}

.input-group-text {
  background-color: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-muted) !important;
}

/* Navbar dark theme */
.navbar {
  background-color: var(--bg-navbar) !important;
  border-color: var(--border-color) !important;
}

/* Dropdown dark theme */
.dropdown-menu {
  background-color: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}

.dropdown-item {
  color: var(--text-primary) !important;
}

.dropdown-item:hover, .dropdown-item:focus {
  background-color: var(--bg-card-hover) !important;
  color: var(--text-primary) !important;
}

/* Modal dark theme */
.modal-content {
  background-color: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}

/* Nav dark theme */
.nav-tabs, .nav-pills {
  border-color: var(--border-color) !important;
}

.nav-tabs .nav-link, .nav-pills .nav-link {
  color: var(--text-secondary) !important;
}

.nav-tabs .nav-link:hover, .nav-pills .nav-link:hover {
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.nav-tabs .nav-link.active, .nav-pills .nav-link.active {
  background-color: var(--bg-card) !important;
  color: var(--primary) !important;
  border-color: var(--border-color) !important;
}

/* Button overrides */
.btn-outline-secondary {
  color: var(--text-muted) !important;
  border-color: var(--border-color) !important;
  background-color: transparent !important;
}

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

/* Background utilities */
.bg-dark {
  background-color: var(--bg-card) !important;
}

.bg-light, .bg-white, .bg-body {
  background-color: var(--bg-body) !important;
}

/* Text utilities */
.text-muted {
  color: var(--text-muted) !important;
}

/* Table list container */
.table-list {
  background-color: transparent !important;
}

/* Card hover effect - reduce for dark theme */
.card:hover {
  border-color: var(--border-color) !important;
  box-shadow: var(--shadow-md) !important;
  transform: none !important;
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Modern Dark Background with Depth */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(16, 185, 129, 0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(30, 41, 59, 0.5) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Tablet - reduce background effects */
@media (min-width: 576px) and (max-width: 991.98px) {
  body::before {
    background:
      radial-gradient(ellipse at 20% 0%, rgba(59, 130, 246, 0.02) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 100%, rgba(16, 185, 129, 0.01) 0%, transparent 50%);
  }
}

/* Mobile - minimal background for performance */
@media (max-width: 575.98px) {
  body::before {
    background: var(--bg-body);
  }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

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

a:hover {
  color: var(--primary-hover);
}

/* ============================================
   Navbar Styles
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg-navbar);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  transition: all var(--transition-base);
}

.navbar-dark {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.navbar-brand:hover {
  color: var(--primary);
}

.navbar-brand img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

/* ============================================
   Card Styles
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  overflow: hidden;
}

.card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--primary-glow);
  transform: translateY(-2px);
}

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

.card-body {
  padding: 1.25rem;
}

/* Card Title */
.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-title i {
  color: var(--primary);
}

/* Card Stats */
.card-stat {
  text-align: center;
  padding: 1rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   Button Styles
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

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

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
}

.btn:disabled::before,
.btn.disabled::before {
  display: none;
}

/* Button loading state */
.btn .spinner-border-sm {
  width: 0.875rem;
  height: 0.875rem;
  border-width: 2px;
  vertical-align: middle;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm), 0 0 15px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-light) 100%);
  box-shadow: var(--shadow-md), 0 0 25px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

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

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

.btn-outline-primary:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 15px var(--primary-glow);
}

.btn-outline-secondary {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-color);
}

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

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  color: white;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
  border-color: var(--success);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

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

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-md);
  min-width: 2rem;
  min-height: 2rem;
}

/* Mobile-optimized button sizing */
@media (max-width: 575.98px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    min-height: 40px;
    min-width: 44px;
  }

  .btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.7rem;
    min-height: 36px;
    min-width: 36px;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    min-height: 48px;
  }

  .btn-icon {
    padding: 0.4rem;
    min-width: 36px;
    min-height: 36px;
  }

  .btn-icon i {
    font-size: 0.875rem;
  }
}

/* Touch-optimized buttons */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .btn:focus:not(:focus-visible) {
    outline: none;
  }
}

/* ============================================
   Form Styles
   ============================================ */
.form-control,
.form-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  padding: 0.625rem 0.875rem;
  transition: all var(--transition-fast);
  min-height: 42px;
}

.form-control:focus,
.form-select:focus {
  background: var(--bg-input);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
  color: var(--text-primary);
}

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

.form-control-sm,
.form-select-sm {
  min-height: 36px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.input-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
}

.input-group .form-control {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}

.input-group-text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .form-control:focus + .input-group-text {
  border-color: var(--primary);
  color: var(--primary);
}

/* Form responsive improvements */
@media (max-width: 575.98px) {
  .form-control,
  .form-select {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .form-control-sm,
  .form-select-sm {
    min-height: 40px;
  }

  .form-label {
    font-size: 0.7rem;
  }

  /* Ensure row columns stack properly on mobile */
  .row.g-2 > [class*="col-"] {
    padding-left: 0.375rem;
    padding-right: 0.375rem;
  }
}

/* ============================================
   Table Styles
   ============================================ */
.table {
  width: 100%;
  margin-bottom: 0;
  color: var(--text-primary);
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  padding: 0.625rem 0.875rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.table tbody tr {
  transition: all var(--transition-fast);
  border-bottom: 1px solid var(--border-color);
  background: transparent;
}

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

.table tbody td {
  padding: 0.625rem 0.875rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
}

/* Table List - Scrollable Container */
.table-list {
  overflow-y: auto;
  overflow-x: auto;
  max-height: 400px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.table-list::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.table-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

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

/* Table Responsive */
.table-responsive {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
}

.table-responsive::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

/* ============================================
   Badge Styles
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-active {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
}

.badge-disabled {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.badge-expired {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.badge-online {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
}

.badge-offline {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
}

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

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-success 2s ease-in-out infinite;
}

.status-dot.offline {
  background: var(--text-muted);
}

.status-dot.connecting {
  background: var(--warning);
  animation: pulse-connecting 1.5s ease-in-out infinite;
}

@keyframes pulse-success {
  0%, 100% { box-shadow: 0 0 4px var(--success); }
  50% { box-shadow: 0 0 12px var(--success); }
}

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

/* ============================================
   Alert & Toast Styles
   ============================================ */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-left: 3px solid var(--danger);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border-left: 3px solid var(--success);
}

.alert-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-left: 3px solid var(--warning);
}

.alert-info {
  background: var(--info-bg);
  color: var(--info);
  border-left: 3px solid var(--info);
}

/* Toast */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s ease-out;
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

.toast-warning {
  border-left: 3px solid var(--warning);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   Modal Styles
   ============================================ */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  animation: fade-in 0.2s ease-out;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: calc(var(--z-modal) + 1);
  max-width: 90vw;
  max-width: 500px;
  max-height: 85vh;
  overflow: hidden;
  animation: modal-in 0.3s ease-out;
}

@media (max-width: 575.98px) {
  .modal {
    max-width: 95vw;
    width: 95vw;
    max-height: 90vh;
    border-radius: var(--radius-md);
  }
}

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

.modal-header h3 {
  font-size: 1rem;
  margin: 0;
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: 60vh;
}

@media (max-width: 575.98px) {
  .modal-body {
    max-height: 70vh;
    padding: 1rem;
  }
}

.modal-footer {
  padding: 1rem 1.25rem;
  background: var(--bg-body);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translate(-50%, -48%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* ============================================
   Device Card Popup - Mobile Optimized
   ============================================ */
#licDeviceCard {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--z-popup);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: scaleIn 0.2s ease-out;
}

#licDeviceCard.show,
#licDeviceCard:not(.d-none) {
  display: flex;
}

@media (max-width: 575.98px) {
  #licDeviceCard {
    max-width: 95vw;
    width: 95vw;
    max-height: 85vh;
    border-radius: var(--radius-md);
  }
}

#licDeviceCard .card-header {
  padding: 0.875rem 1rem;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

#licDeviceCard .card-header h3 {
  font-size: 0.95rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#licDeviceCard .card-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem;
  flex: 1;
}

@media (max-width: 575.98px) {
  #licDeviceCard .card-body {
    max-height: 70vh;
    padding: 0.75rem;
  }
}

.device-item {
  padding: 0.875rem;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  transition: all var(--transition-fast);
}

.device-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

.device-item:last-child {
  margin-bottom: 0;
}

/* Device popup item */
.lic-device-item {
  padding: 0.75rem;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  transition: all var(--transition-fast);
}

.lic-device-item:last-child {
  margin-bottom: 0;
}

.lic-device-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

@media (max-width: 575.98px) {
  .device-item,
  .lic-device-item {
    padding: 0.625rem;
  }
}

/* ============================================
   Loading & Skeleton Styles
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-card-hover) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

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

/* ============================================
   Code & Key Styles
   ============================================ */
code {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg-body);
  border-radius: var(--radius-sm);
  color: var(--primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: all;
}

code:hover {
  background: var(--primary);
  color: white;
}

kbd {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

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

.bg-card { background: var(--bg-card) !important; }
.bg-body { background: var(--bg-body) !important; }

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link - accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: none;
}

/* ============================================
   Animations
   ============================================ */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

.slide-in {
  animation: slideIn 0.3s ease-out;
}

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

.scale-in {
  animation: scaleIn 0.2s ease-out;
}

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

/* Row animations */
.table tbody tr.fade-in {
  animation: rowIn 0.3s ease-out;
}

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

.table tbody tr.deleting {
  animation: rowDelete 0.3s ease-out forwards;
}

@keyframes rowDelete {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* ============================================
   Responsive Design
   ============================================ */

/* Mobile (< 576px) */
@media (max-width: 575.98px) {
  body {
    font-size: 13px;
  }

  .card-body {
    padding: 1rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.7rem;
  }

  .table thead th,
  .table tbody td {
    padding: 0.625rem 0.75rem;
    font-size: 0.75rem;
  }

  .form-control,
  .form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  /* Mobile stacked table */
  .stacked-table-wrapper {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .stacked-table-wrapper table thead {
    display: none;
  }

  .stacked-table-wrapper table,
  .stacked-table-wrapper tbody,
  .stacked-table-wrapper tr,
  .stacked-table-wrapper td {
    display: block;
    width: 100%;
  }

  .stacked-table-wrapper tbody tr {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
  }

  .stacked-table-wrapper td {
    border: none !important;
    padding: 0.25rem 0 !important;
  }

  .stacked-table-wrapper td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
  }
}

/* Tablet (576px - 991px) */
@media (min-width: 576px) and (max-width: 991.98px) {
  .container {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Desktop (>= 992px) */
@media (min-width: 992px) {
  .container {
    max-width: 1140px;
  }
}

/* ============================================
   Mobile Toolbar
   ============================================ */
.mobile-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--toolbar-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: none;
  align-items: center;
  justify-content: space-around;
  z-index: var(--z-sticky);
  padding: 0 0.5rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.mobile-toolbar .toolbar-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: var(--radius-md);
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.mobile-toolbar .toolbar-btn:active {
  background: var(--bg-card-hover);
  color: var(--primary);
  transform: scale(0.95);
}

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

.mobile-toolbar .toolbar-btn i {
  font-size: 1.25rem;
}

.mobile-toolbar .toolbar-btn .spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

@media (max-width: 575.98px) {
  .mobile-toolbar {
    display: flex;
    padding-bottom: env(safe-area-inset-bottom);
  }

  body {
    padding-bottom: calc(var(--toolbar-height) + env(safe-area-inset-bottom));
  }

  .mobile-toolbar .toolbar-btn {
    min-height: 52px;
  }
}

/* ============================================
   Connection Status
   ============================================ */
.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse-connection 1.5s ease-in-out infinite;
}

.connection-dot.connected {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.connection-dot.connecting {
  background: var(--warning);
}

.connection-dot.disconnected {
  background: var(--danger);
}

@keyframes pulse-connection {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

::-webkit-scrollbar-track {
  background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

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

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--bg-body);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .navbar,
  .mobile-toolbar,
  .btn,
  .card,
  #toast-container,
  #loadingOverlay {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .table {
    page-break-inside: auto;
  }

  .table tr {
    page-break-inside: avoid;
  }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Device Card Popup
   ============================================ */
#licDeviceCard {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--z-popup);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: scaleIn 0.2s ease-out;
}

#licDeviceCard.show {
  display: flex;
}

#licDeviceCard .card-header {
  padding: 1rem;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#licDeviceCard .card-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem;
}

.device-item {
  padding: 0.875rem;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  transition: all var(--transition-fast);
}

.device-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0 0;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 575.98px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

/* ============================================
   Stats Cards
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.625rem;
}

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

  .stat-card {
    padding: 0.5rem;
  }

  .stat-icon {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .stat-number {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.6rem;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .stats-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.stat-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(30, 41, 59, 0.8) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-align: center;
  transition: all var(--transition-fast);
}

.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.stat-icon {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 0.375rem;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   Filter Bar
   ============================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  background: transparent;
  border-radius: var(--radius-md);
}

.filter-bar .form-control,
.filter-bar .form-select {
  flex: 1 1 100px;
  min-width: 0;
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  min-height: 36px;
}

.filter-bar .btn {
  flex-shrink: 0;
  padding: 0.375rem 0.5rem;
  min-height: 36px;
  min-width: 36px;
}

@media (max-width: 575.98px) {
  .filter-bar {
    gap: 0.375rem;
  }

  .filter-bar .form-control,
  .filter-bar .form-select {
    flex: 1 1 45%;
    min-height: 40px;
    font-size: 0.8rem;
  }

  .filter-bar .btn {
    padding: 0.375rem;
    min-height: 40px;
    min-width: 40px;
  }

  .filter-bar .btn span {
    display: none;
  }
}

/* ============================================
   Table Action Buttons - Responsive
   ============================================ */
.btn-group.flex-wrap {
  gap: 0.25rem;
}

@media (max-width: 767.98px) {
  .btn-group.flex-wrap .btn {
    padding: 0.3rem 0.4rem;
    font-size: 0.7rem;
  }

  .btn-group.flex-wrap .btn span {
    display: none;
  }

  .btn-group.flex-wrap .btn i {
    margin: 0 !important;
  }
}

@media (max-width: 575.98px) {
  /* Table scrollable container */
  .table-list {
    max-height: 300px;
  }

  /* Make table cells more touch-friendly */
  .table tbody td {
    padding: 0.5rem 0.625rem;
    min-height: 44px;
  }

  /* Stack action buttons vertically on very small screens */
  .table .text-end {
    text-align: start !important;
  }

  .table .text-end .btn-group {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

/* ============================================
   Table Improvements
   ============================================ */
@media (max-width: 767.98px) {
  /* Hide less important columns on tablet */
  .d-md-none-if-tablet {
    display: none !important;
  }

  .table th[class*="d-md"],
  .table td[class*="d-md"] {
    display: none !important;
  }

  .table th.d-md-table-cell,
  .table td.d-md-table-cell {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  .d-lg-none-if-tablet {
    display: none !important;
  }
}

/* ============================================
   Table Empty/Loading/Error States - Dark Theme
   ============================================ */
.table-empty-state,
.table-loading-state,
.table-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  background: transparent;
  min-height: 120px;
}

.table-empty-state i,
.table-loading-state i,
.table-error-state i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.4;
  color: var(--text-muted);
}

.table-empty-state p,
.table-loading-state p,
.table-error-state p {
  margin: 0;
  font-size: 0.85rem;
}

.table-empty-state .empty-title,
.table-loading-state .empty-title,
.table-error-state .empty-title {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

.table-empty-state .empty-desc,
.table-loading-state .empty-desc,
.table-error-state .empty-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.table-error-state {
  color: var(--danger);
}

.table-error-state i,
.table-error-state .empty-title {
  color: var(--danger);
  opacity: 0.7;
}

.table-error-state .empty-desc {
  color: var(--danger);
  opacity: 0.6;
}

/* Table tbody empty row */
.table tbody tr.table-empty-row {
  background: transparent !important;
  border: none;
}

.table tbody tr.table-empty-row:hover {
  background: transparent !important;
}

.table tbody tr.table-empty-row td {
  padding: 1rem;
  border: none;
}

/* Skeleton loading row */
.skeleton-row td {
  padding: 0.5rem !important;
}

/* Loading spinner for tables */
.table-loading-state .loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.table-loading-state .spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Action button in empty state */
.empty-action {
  margin-top: 0.5rem;
}

.empty-action .btn {
  font-size: 0.75rem;
  padding: 0.4rem 0.875rem;
}

/* Error state with retry */
.table-error-state .retry-btn {
  margin-top: 0.5rem;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  background: transparent;
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
  color: var(--text-muted);
}

.empty-state h4 {
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
  font-size: 0.95rem;
}

.empty-state p {
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

/* ============================================
   Login Specific Styles
   ============================================ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--bg-body) 0%, #1e293b 50%, var(--bg-body) 100%);
  position: relative;
  overflow: hidden;
}

.login-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 70%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  animation: bg-shift 20s ease-in-out infinite;
}

@keyframes bg-shift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-5%, -5%); }
}

.login-card {
  max-width: 420px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(59, 130, 246, 0.15);
  position: relative;
  z-index: 1;
  animation: scaleIn 0.4s ease-out;
}

.login-card .card-body {
  padding: 2rem;
}

.login-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 20px var(--primary-glow));
}

.login-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.login-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

/* OTP Timer */
.otp-timer {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.otp-timer.expired {
  color: var(--danger);
  animation: pulse 1s ease-in-out infinite;
}

/* ============================================
   Dashboard Layout
   ============================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
  }

  .dashboard-grid .main-column {
    grid-column: 1;
  }

  .dashboard-grid .sidebar-column {
    grid-column: 2;
    grid-row: 1 / 3;
  }
}

@media (min-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr 360px;
  }
}

/* Mobile sidebar optimization */
@media (max-width: 991.98px) {
  .sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .sidebar-column .card {
    width: 100%;
  }
}

/* Page header mobile */
@media (max-width: 575.98px) {
  .page-title {
    font-size: 1.25rem;
  }

  .page-subtitle {
    font-size: 0.8rem;
  }

  .page-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }
}

/* ============================================
   Tooltips
   ============================================ */
[data-bs-toggle="tooltip"] {
  position: relative;
}

.tooltip {
  position: absolute;
  z-index: var(--z-toast);
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  animation: tooltip-in 0.15s ease-out;
}

@keyframes tooltip-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Focus States
   ============================================ */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* ============================================
   Selection
   ============================================ */
::selection {
  background: var(--primary);
  color: white;
}

/* ============================================
   Background Patterns
   ============================================ */
.bg-pattern {
  background-image:
    radial-gradient(circle at 1px 1px, var(--border-color) 1px, transparent 0);
  background-size: 24px 24px;
}

/* ============================================
   Glow Effects
   ============================================ */
.glow-primary {
  box-shadow: 0 0 20px var(--primary-glow);
}

.glow-success {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.glow-danger {
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* ============================================
   Transitions
   ============================================ */
.transition-all {
  transition: all var(--transition-base);
}

/* ============================================
   Hover Effects
   ============================================ */
.hover-lift {
  transition: all var(--transition-fast);
}

.hover-lift:hover {
  transform: translateY(-2px);
}

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

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

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

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

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}