/* ========================================
   QLK Pro - Modern UI v4.0
   Clean, Professional & Beautiful Design
   ======================================== */

/* CSS Variables */
:root {
  --qlk-primary: #6366f1;
  --qlk-primary-dark: #4f46e5;
  --qlk-primary-light: #818cf8;
  --qlk-secondary: #64748b;
  --qlk-success: #10b981;
  --qlk-warning: #f59e0b;
  --qlk-danger: #ef4444;
  --qlk-info: #3b82f6;
  --qlk-white: #ffffff;
  --qlk-gray-50: #f8fafc;
  --qlk-gray-100: #f1f5f9;
  --qlk-gray-200: #e2e8f0;
  --qlk-gray-300: #cbd5e1;
  --qlk-gray-400: #94a3b8;
  --qlk-gray-500: #64748b;
  --qlk-gray-600: #475569;
  --qlk-gray-700: #334155;
  --qlk-gray-800: #1e293b;
  --qlk-gray-900: #0f172a;
  --qlk-radius: 12px;
  --qlk-radius-lg: 16px;
  --qlk-radius-xl: 24px;
  --qlk-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --qlk-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --qlk-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --qlk-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Body Styling */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--qlk-gray-800);
  background: linear-gradient(180deg, var(--qlk-gray-50) 0%, var(--qlk-gray-100) 100%);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* General App Container - Modern Glass Design */
#qlk-pro-app {
  max-width: 500px;
  margin: 0 auto;
  padding: 0;
  border: none;
  border-radius: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--qlk-white);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  #qlk-pro-app {
    margin: 2rem auto;
    border-radius: var(--qlk-radius-xl);
    min-height: auto;
    box-shadow: var(--qlk-shadow-xl);
    overflow: hidden;
  }
}
/* ========================================
   Login View - Modern Minimal Design
   ======================================== */
.qlk-login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(135deg, var(--qlk-primary) 0%, #8b5cf6 100%);
  position: relative;
  overflow: hidden;
}

.qlk-login-view::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 150%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  pointer-events: none;
}

.qlk-login-view::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -20%;
  width: 60%;
  height: 100%;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  pointer-events: none;
}

.qlk-login-card {
  background: var(--qlk-white);
  border-radius: var(--qlk-radius-xl);
  padding: 48px 32px;
  box-shadow: var(--qlk-shadow-xl);
  max-width: 400px;
  width: 100%;
  position: relative;
  z-index: 1;
  animation: slideUp 0.5s ease-out;
}

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

.qlk-login-header {
  text-align: center;
  margin-bottom: 32px;
}

.qlk-login-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--qlk-primary) 0%, #8b5cf6 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.qlk-login-title {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--qlk-gray-900);
  line-height: 1.3;
}

.qlk-login-subtitle {
  margin: 0;
  font-size: 15px;
  color: var(--qlk-gray-500);
  line-height: 1.5;
}

.qlk-login-form {
  width: 100%;
}

.qlk-form-group {
  margin-bottom: 24px;
}

.qlk-form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--qlk-gray-700);
}

.qlk-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.qlk-pin-input {
  width: 100%;
  padding: 16px 16px 16px 52px;
  font-size: 18px;
  border: 2px solid var(--qlk-gray-200);
  border-radius: var(--qlk-radius);
  background: var(--qlk-gray-50);
  color: var(--qlk-gray-900);
  transition: var(--qlk-transition);
  font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
  letter-spacing: 0.3em;
  text-align: center;
  box-sizing: border-box;
}

.qlk-pin-input:focus {
  outline: none;
  border-color: var(--qlk-primary);
  background: var(--qlk-white);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.qlk-pin-input::placeholder {
  color: var(--qlk-gray-400);
  font-family: inherit;
  letter-spacing: normal;
}

.qlk-input-icon {
  position: absolute;
  left: 18px;
  font-size: 20px;
  color: var(--qlk-gray-400);
  pointer-events: none;
}

.qlk-form-help {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #6c757d;
  line-height: 1.4;
}

.qlk-login-btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--qlk-white);
  background: linear-gradient(135deg, var(--qlk-primary) 0%, #8b5cf6 100%);
  border: none;
  border-radius: var(--qlk-radius);
  cursor: pointer;
  transition: var(--qlk-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
  text-decoration: none !important;
}

.qlk-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  text-decoration: none !important;
  color: var(--qlk-white);
}

.qlk-login-btn:active {
  transform: translateY(0);
  text-decoration: none !important;
}

.qlk-login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  text-decoration: none !important;
}

.qlk-login-btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), 0 4px 14px rgba(99, 102, 241, 0.4);
  text-decoration: none !important;
}

.qlk-login-btn:visited {
  text-decoration: none !important;
  color: var(--qlk-white);
}

/* Ensure all login buttons and links have no underline */
a.qlk-login-btn,
button.qlk-login-btn,
.qlk-login-btn a,
.qlk-login-btn button {
  text-decoration: none !important;
}

a.qlk-login-btn:hover,
button.qlk-login-btn:hover,
.qlk-login-btn a:hover,
.qlk-login-btn button:hover {
  text-decoration: none !important;
}

/* Override any theme or WordPress core styles that might add underlines */
.qlk-pro-app .qlk-login-btn,
.qlk-pro-app .qlk-login-btn *,
.qlk-pro-app a.qlk-login-btn,
.qlk-pro-app button.qlk-login-btn {
  text-decoration: none !important;
  border-bottom: none !important;
}

.qlk-pro-app .qlk-login-btn:hover,
.qlk-pro-app .qlk-login-btn:hover *,
.qlk-pro-app a.qlk-login-btn:hover,
.qlk-pro-app button.qlk-login-btn:hover {
  text-decoration: none !important;
  border-bottom: none !important;
}

.qlk-btn-icon {
  font-size: 1.2rem;
}

.qlk-btn-text {
  font-weight: 600;
}

.qlk-btn-spinner {
  font-size: 1.2rem;
  animation: spin 1s linear infinite;
}

/* ========================================
   App Header - Modern Gradient Design
   ======================================== */
.qlk-header {
  background: linear-gradient(135deg, var(--qlk-primary) 0%, #8b5cf6 100%);
  color: var(--qlk-white);
  padding: 24px 20px;
  margin: 0;
  position: relative;
  overflow: hidden;
}

.qlk-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.qlk-header::after {
  content: "";
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  pointer-events: none;
}

.qlk-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  gap: 16px;
}

.qlk-title-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.qlk-title-icon {
  font-size: 24px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--qlk-radius);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.qlk-main-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.qlk-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.qlk-header p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.qlk-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  border-radius: var(--qlk-radius);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.qlk-user-details {
  display: flex;
  flex-direction: column;
}

.qlk-welcome-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.qlk-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--qlk-white);
}

.qlk-user-info a,
.qlk-logout-btn {
  cursor: pointer;
  color: var(--qlk-white);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--qlk-radius);
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  transition: var(--qlk-transition);
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.qlk-user-info a:hover {
  background: rgba(255, 107, 107, 0.2);
  border-color: #ff6b6b;
  transform: translateY(-1px);
}

.qlk-user-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}

.qlk-welcome-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.2;
}

.qlk-user-name {
  font-size: 1rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  line-height: 1.2;
}

.qlk-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none !important;
  padding: 0.6rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
}

.qlk-logout-btn:hover {
  text-decoration: none !important;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.qlk-logout-icon {
  font-size: 1.1rem;
}

.qlk-logout-text {
  font-weight: 500;
}
/* Enhanced Search Container */
.qlk-device-search-container {
  padding: 2rem;
  background: white;
}

/* QR Scan Input Group */
.qlk-search-input-group {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.qlk-search-input-group input {
  flex: 1;
  margin-top: 0;
}

.qlk-qr-scan-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  min-width: 80px;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.qlk-qr-scan-btn:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.qlk-qr-scan-btn:active {
  transform: translateY(0);
}

.qr-icon {
  font-size: 1.2rem;
}

.qr-text {
  font-size: 0.9rem;
  font-weight: 700;
}

/* QR Modal */
.qlk-qr-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.qlk-qr-modal-content {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideInUp 0.3s ease-out;
}

.qlk-qr-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.qlk-qr-modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.qlk-qr-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.qlk-qr-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.qlk-qr-modal-body {
  padding: 2rem;
}

.qlk-qr-scanner {
  position: relative;
  width: 100%;
  height: 300px;
  background: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #e9ecef;
}

.qlk-qr-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qlk-qr-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.qlk-qr-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
}

.qlk-qr-frame {
  width: 200px;
  height: 200px;
  border: 3px solid #667eea;
  border-radius: 12px;
  position: relative;
  background: transparent;
}

.qlk-qr-frame::before,
.qlk-qr-frame::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid #667eea;
}

.qlk-qr-frame::before {
  top: -3px;
  left: -3px;
  border-right: none;
  border-bottom: none;
}

.qlk-qr-frame::after {
  bottom: -3px;
  right: -3px;
  border-left: none;
  border-top: none;
}

.qlk-qr-instruction {
  color: white;
  font-size: 1rem;
  font-weight: 500;
  margin-top: 1rem;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.qlk-qr-result {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #28a745;
}

.qlk-qr-modal-footer {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.qlk-qr-modal-footer .qlk-btn {
  flex: 1;
  margin: 0;
}

.qlk-btn-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.qlk-btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
  box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

/* QR Modal Backdrop Click */
.qlk-qr-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
}

/* QR Scanner Loading State */
.qlk-qr-scanner.loading {
  background: linear-gradient(90deg, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* QR Success Animation */
.qlk-qr-result .qlk-success {
  animation: slideInDown 0.5s ease-out;
}

.qlk-qr-result .qlk-error {
  animation: slideInDown 0.5s ease-out;
}

.qlk-device-search-container label {
  font-weight: 600;
  font-size: 1.1rem;
  color: #2c3e50;
  margin-bottom: 1rem;
  display: block;
}

#qlk_device_search {
  width: 100%;
  padding: 1rem 1.5rem;
  margin-top: 0.5rem;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  box-sizing: border-box;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f8f9fa;
  position: relative;
}

#qlk_device_search:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

#qlk_device_search::placeholder {
  color: #6c757d;
  font-style: italic;
}

#qlk-search-results {
  list-style-type: none;
  padding: 0;
  margin: 0.5rem 0 0;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  max-height: 250px;
  overflow-y: auto;
  background: white;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

#qlk-search-results li {
  padding: 1rem 1.5rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f4;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#qlk-search-results li:last-child {
  border-bottom: none;
}

#qlk-search-results li:hover {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  transform: translateX(4px);
}

#qlk-search-results li.selected {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  transform: translateX(4px);
}
/* Enhanced Device Display */
.qlk-device-display {
  margin: 0;
  padding: 2rem;
  background: white;
  border-top: 1px solid #f1f3f4;
}

.qlk-stock-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: #667eea;
  text-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
  transition: all 0.3s ease;
}

.qlk-stock-number.updating {
  animation: pulse 1s ease-in-out infinite;
}

/* Enhanced Form Groups */
.qlk-form-group {
  margin-bottom: 2rem;
  position: relative;
}

.qlk-form-group label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  color: #2c3e50;
  position: relative;
}

.qlk-form-group input[type="number"],
.qlk-form-group input[type="password"],
.qlk-form-group textarea {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  box-sizing: border-box;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f8f9fa;
  position: relative;
}

.qlk-form-group input[type="number"]:focus,
.qlk-form-group input[type="password"]:focus,
.qlk-form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

.qlk-form-group input[type="password"] {
  font-family: "Courier New", monospace;
  letter-spacing: 0.2em;
  text-align: center;
  font-size: 1.2rem;
}

.qlk-form-group textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

/* Form Help Text */
.form-help {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #6c757d;
  font-style: italic;
}

/* Loading States */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

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

.animate-bounce {
  animation: bounce 1s ease-in-out;
}

/* Button Spinner */
.btn-spinner {
  margin-left: 0.5rem;
  animation: spin 1s linear infinite;
}

/* Enhanced Focus States */
.qlk-form-group input:focus + .form-help,
.qlk-form-group textarea:focus + .form-help {
  color: #667eea;
  font-weight: 500;
}

/* Error States */
.qlk-form-group input.error,
.qlk-form-group textarea.error {
  border-color: #dc3545;
  background: #fff5f5;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.qlk-form-group input.error:focus,
.qlk-form-group textarea.error:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.input-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  animation: slideInDown 0.3s ease-out;
}

/* Enhanced Search Results */
#qlk-search-results li:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Improved Button States */
.qlk-btn:disabled .btn-text {
  opacity: 0.7;
}

.qlk-btn:disabled .btn-spinner {
  display: inline-block !important;
}

/* Enhanced Animations for Mobile */
@media (max-width: 768px) {
  .qlk-device-info-header {
    animation: slideInUp 0.5s ease-out;
  }

  .qlk-list-item {
    animation: slideInUp 0.3s ease-out;
  }

  .qlk-btn {
    animation: slideInUp 0.4s ease-out;
  }
}
/* Enhanced Form Actions */
.qlk-form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Fix mobile zoom issue with Astra theme */
.qlk-form-group input[type="number"],
.qlk-form-group input[type="text"],
.qlk-form-group textarea {
  font-size: 16px !important; /* Prevent zoom on iOS */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 8px;
}

/* Ensure proper viewport behavior */
@media screen and (max-width: 768px) {
  .qlk-form-group input[type="number"],
  .qlk-form-group input[type="text"],
  .qlk-form-group textarea {
    font-size: 16px !important;
    min-height: 44px; /* iOS recommended touch target */
    padding: 12px 16px;
    /* Prevent zoom on focus */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }

  /* Additional fix for Astra theme compatibility */
  body {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  /* Ensure viewport doesn't zoom */
  html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
}

/* Enhanced Buttons */
.qlk-btn {
  display: block;
  width: 100%;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

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

.qlk-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.qlk-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.qlk-btn:disabled {
  background: linear-gradient(135deg, #6c757d, #495057);
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.qlk-btn-in {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.qlk-btn-in:hover:not(:disabled) {
  background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.qlk-btn-out {
  background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.qlk-btn-out:hover:not(:disabled) {
  background: linear-gradient(135deg, #c82333 0%, #c0392b 100%);
  box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}
/* Enhanced Feedback System */
.qlk-feedback {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  animation: slideInDown 0.3s ease-out;
}

.qlk-feedback::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

.qlk-error {
  color: #721c24;
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border: 2px solid #f5c6cb;
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.1);
}

.qlk-success {
  color: #155724;
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 2px solid #c3e6cb;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.1);
}

.qlk-info {
  color: #0c5460;
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  border: 2px solid #bee5eb;
  box-shadow: 0 4px 15px rgba(23, 162, 184, 0.1);
}

/* Enhanced Animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}

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

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

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes bounce {
  0%,
  20%,
  53%,
  80%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  40%,
  43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}
/* Enhanced Separator */
.qlk-separator {
  border: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e9ecef, transparent);
  margin: 2rem 0;
  position: relative;
}

.qlk-separator::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 1px;
}

/* Enhanced List Container */
.qlk-list-container {
  padding: 2rem;
  background: white;
  border-top: 1px solid #f1f3f4;
}

.qlk-list-container h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e9ecef;
  position: relative;
}

.qlk-list-container h3::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
}

#qlk-transaction-list ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

/* Enhanced List Items */
.qlk-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  border-left: 4px solid;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.qlk-list-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.qlk-list-item:hover::before {
  opacity: 1;
}

.qlk-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.qlk-list-item.in {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-left-color: #28a745;
}

.qlk-list-item.out {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border-left-color: #dc3545;
}

.qlk-list-item .item-info {
  flex: 1;
}

.qlk-list-item .item-info .item-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: #2c3e50;
  display: block;
  margin-bottom: 0.25rem;
}

.qlk-list-item .item-info .item-details {
  font-size: 0.95rem;
  color: #6c757d;
  font-weight: 500;
}

.qlk-list-item .item-info .item-note {
  font-size: 0.85rem;
  color: #495057;
  font-style: italic;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  border-left: 3px solid #007cba;
  display: block;
}

.qlk-remove-item {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  color: white;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
  font-weight: bold;
  position: relative;
  z-index: 10;
}

.qlk-remove-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  background: white;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 1px;
}

.qlk-remove-item::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  background: white;
  transform: translate(-50%, -50%) rotate(-45deg);
  border-radius: 1px;
}

.qlk-remove-item:hover {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.qlk-remove-item:active {
  transform: scale(0.95);
  box-shadow: 0 1px 4px rgba(220, 53, 69, 0.3);
}

p.qlk-empty-list {
  text-align: center;
  color: #6c757d;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 500;
  border: 2px dashed #dee2e6;
  margin: 0;
}

#qlk-batch-submit-btn {
  margin-top: 1.5rem;
  background: linear-gradient(135deg, #0073aa 0%, #0056b3 100%);
  box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
}

#qlk-batch-feedback {
  margin-top: 1.5rem;
}

/* Image Quality Improvements */
.qlk-device-thumbnail,
.qlk-device-image,
.device-thumb {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
  #qlk-pro-app {
    max-width: 100%;
    margin: 0.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  }

  .qlk-search-input-group {
    flex-direction: column;
    gap: 0.75rem;
  }

  .qlk-qr-scan-btn {
    width: 100%;
    justify-content: center;
    padding: 1.25rem 2rem;
  }

  .qlk-qr-modal {
    padding: 0.5rem;
  }

  .qlk-qr-modal-content {
    max-width: 100%;
    border-radius: 16px;
  }

  .qlk-qr-modal-header {
    padding: 1rem 1.5rem;
  }

  .qlk-qr-modal-header h3 {
    font-size: 1.25rem;
  }

  .qlk-qr-modal-body {
    padding: 1.5rem;
  }

  .qlk-qr-scanner {
    height: 250px;
  }

  .qlk-qr-frame {
    width: 150px;
    height: 150px;
  }

  .qlk-qr-modal-footer {
    flex-direction: column;
    padding: 1rem 1.5rem;
  }

  .qlk-qr-modal-footer .qlk-btn {
    width: 100%;
  }

  .qlk-login-view {
    padding: 2rem 1rem 1.5rem 1rem;
    min-height: 100vh;
  }

  .qlk-login-card {
    padding: 2rem 1.5rem;
    max-width: 100%;
  }

  .qlk-login-icon {
    font-size: 2.5rem;
  }

  .qlk-login-title {
    font-size: 1.5rem;
  }

  .qlk-login-subtitle {
    font-size: 0.95rem;
  }

  .qlk-pin-input {
    padding: 0.9rem 0.9rem 0.9rem 2.5rem;
    font-size: 1rem;
  }

  .qlk-input-icon {
    left: 0.8rem;
    font-size: 1.1rem;
  }

  .qlk-login-btn {
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
  }

  .qlk-header {
    padding: 1.5rem;
  }

  .qlk-header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .qlk-title-section {
    justify-content: center;
  }

  .qlk-title-icon {
    width: 40px;
    height: 40px;
    font-size: 1.6rem;
  }

  .qlk-main-title {
    font-size: 1.4rem;
  }

  .qlk-user-info {
    justify-content: center;
    padding: 0.75rem 1rem;
  }

  .qlk-user-details {
    align-items: center;
    text-align: center;
  }

  .qlk-device-search-container,
  .qlk-device-display,
  .qlk-list-container {
    padding: 1.5rem;
  }

  .qlk-device-info-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .qlk-device-thumbnail {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .qlk-device-info-text h3 {
    font-size: 1.25rem;
  }

  .qlk-form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .qlk-btn {
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
    /* Improve touch targets for mobile */
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .qlk-list-item {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .qlk-remove-item {
    align-self: flex-end;
  }

  .qlk-list-item .item-info .item-note {
    font-size: 0.85rem;
    color: #495057;
    font-style: italic;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    border-left: 3px solid #007cba;
  }

  .qlk-stock-number {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  #qlk-pro-app {
    margin: 0.25rem;
    border-radius: 12px;
  }

  .qlk-login-view,
  .qlk-header {
    padding: 1.5rem 0.75rem 1rem 0.75rem;
  }

  .qlk-login-card {
    padding: 1.5rem 1rem;
    border-radius: 16px;
  }

  .qlk-login-icon {
    font-size: 2rem;
  }

  .qlk-login-title {
    font-size: 1.3rem;
  }

  .qlk-login-subtitle {
    font-size: 0.9rem;
  }

  .qlk-pin-input {
    padding: 0.8rem 0.8rem 0.8rem 2.2rem;
    font-size: 0.95rem;
  }

  .qlk-input-icon {
    left: 0.7rem;
    font-size: 1rem;
  }

  .qlk-login-btn {
    padding: 0.8rem 1.25rem;
    font-size: 0.95rem;
  }

  .qlk-title-icon {
    width: 35px;
    height: 35px;
    font-size: 1.4rem;
  }

  .qlk-main-title {
    font-size: 1.3rem;
  }

  .qlk-user-info {
    padding: 0.6rem 0.8rem;
    gap: 0.8rem;
  }

  .qlk-welcome-text {
    font-size: 0.8rem;
  }

  .qlk-user-name {
    font-size: 0.95rem;
  }

  .qlk-logout-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }

  .qlk-device-search-container,
  .qlk-device-display,
  .qlk-list-container {
    padding: 1rem;
  }

  .qlk-login-view h2 {
    font-size: 1.5rem;
  }

  .qlk-header h2 {
    font-size: 1.25rem;
  }

  .qlk-device-info-text h3 {
    font-size: 1.1rem;
  }

  .qlk-btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }

  .qlk-stock-number {
    font-size: 1.75rem;
  }
}
/* Enhanced Device Info Header */
.qlk-device-info-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.qlk-device-info-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
}

.qlk-device-info-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.qlk-device-thumbnail {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  flex-shrink: 0;
  /* Ensure image loads properly on mobile */
  background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0iI2Y4ZjlmYSIvPjx0ZXh0IHg9IjUwIiB5PSI1MCIgZm9udC1mYW1pbHk9IkFyaWFsIiBmb250LXNpemU9IjEyIiBmaWxsPSIjNjY2IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkeT0iLjNlbSI+画像読み込み中...</dGV4dD48L3N2Zz4=");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.qlk-device-thumbnail:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.qlk-device-info-text {
  flex: 1;
}

.qlk-device-info-text h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1.3;
}

.qlk-device-info-text p {
  margin: 0;
  font-size: 1.1rem;
  color: #6c757d;
  font-weight: 500;
}

/* Modern Frontend Admin Dashboard Styles */
.qlk-frontend-container {
  max-width: 1400px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: #f8f9fa;
  min-height: 100vh;
  padding: 0;
}

/* Modern Dashboard Header */
.qlk-dashboard-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  color: white;
  padding: 3.5rem 0;
  margin-bottom: 2rem;
  border-radius: 0 0 28px 28px;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
  position: relative;
  overflow: hidden;
}

.qlk-dashboard-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 80%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 40%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.qlk-header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.qlk-header-left {
  flex: 1;
}

.qlk-dashboard-title {
  font-size: 2.75rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.qlk-title-icon {
  font-size: 2.25rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-3px);
  }
}

.qlk-dashboard-subtitle {
  font-size: 1.125rem;
  opacity: 0.85;
  margin: 0;
  font-weight: 400;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.01em;
}

.qlk-header-right {
  display: flex;
  align-items: center;
}

.qlk-quick-actions {
  display: flex;
  gap: 1rem;
}

.qlk-action-button {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.qlk-action-button.qlk-primary {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.qlk-action-button.qlk-primary:hover {
  background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.qlk-action-button.qlk-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(15px);
}

.qlk-action-button.qlk-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

.qlk-btn-icon {
  font-size: 12px;
  display: inline-block !important;
  line-height: 1;
  opacity: 1 !important;
  visibility: visible !important;
  font-weight: 500;
}

/* Image Upload Component */
.qlk-image-upload-container {
  position: relative;
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background: #fafafa;
  transition: all 0.3s ease;
  cursor: pointer;
}

.qlk-image-upload-container:hover {
  border-color: #667eea;
  background: #f0f4ff;
}

.qlk-image-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.qlk-image-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qlk-upload-icon {
  font-size: 2rem;
  color: #667eea;
}

.qlk-upload-text {
  font-weight: 500;
  color: #333;
}

.qlk-upload-hint {
  color: #666;
  font-size: 0.875rem;
}

.qlk-image-preview {
  position: relative;
  display: inline-block;
  max-width: 200px;
  max-height: 200px;
}

.qlk-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qlk-remove-image {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ff4757;
  color: white;
  border: none;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.qlk-remove-image:hover {
  background: #ff3742;
  transform: scale(1.1);
}

.qlk-current-image {
  margin-top: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.qlk-current-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #666;
  margin-bottom: 8px;
}

.qlk-current-image img {
  max-width: 150px;
  max-height: 150px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Enhanced Modal Styles */
.qlk-modal-large {
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.qlk-modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem 2rem;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qlk-modal-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.qlk-modal-icon {
  font-size: 1.25rem;
}

.qlk-modal-body {
  padding: 2rem;
}

.qlk-modal-loader {
  text-align: center;
  padding: 3rem;
}

.qlk-spinner-large {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: spin 1s linear infinite;
}

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

/* Enhanced Form Styles */
.qlk-form-enhanced {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.qlk-form-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #e9ecef;
}

.qlk-section-title {
  margin: 0 0 1.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #dee2e6;
}

.qlk-section-icon {
  font-size: 1.125rem;
}

.qlk-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.qlk-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.qlk-field-label {
  font-weight: 600;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.qlk-field-icon {
  font-size: 1rem;
}

.qlk-required {
  color: #dc3545;
  font-weight: bold;
}

.qlk-input,
.qlk-textarea {
  padding: 0.75rem 1rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

.qlk-input:focus,
.qlk-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.qlk-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Enhanced Image Upload */
.qlk-image-upload-enhanced {
  border: 2px dashed #dee2e6;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  background: white;
  transition: all 0.3s ease;
}

.qlk-image-upload-enhanced:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.qlk-upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.qlk-upload-icon {
  font-size: 3rem;
  color: #667eea;
}

.qlk-upload-text {
  font-size: 1.125rem;
  font-weight: 500;
  color: #495057;
}

.qlk-upload-hint {
  color: #6c757d;
  font-size: 0.875rem;
}

.qlk-current-image-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #dee2e6;
}

.qlk-current-label {
  font-weight: 600;
  color: #495057;
}

/* Enhanced Checkbox List */
.qlk-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 1rem;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
}

.qlk-checkbox-list label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qlk-checkbox-list label:hover {
  background: #f8f9fa;
}

.qlk-checkbox-list input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #667eea;
}

.qlk-loading {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 1rem;
}

/* Enhanced Buttons */
.qlk-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.qlk-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.qlk-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.qlk-btn-secondary {
  background: #6c757d;
  color: white;
}

.qlk-btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.qlk-btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.qlk-btn-icon {
  font-size: 1rem;
}

.qlk-btn-text {
  flex: 1;
}

.qlk-spinner {
  animation: spin 1s linear infinite;
}

/* Form Actions */
.qlk-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #dee2e6;
}

/* Feedback */
.qlk-feedback {
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.qlk-feedback.notice-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.qlk-feedback.notice-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
  .qlk-modal-large {
    width: 95%;
    margin: 1rem;
  }

  .qlk-modal-header {
    padding: 1rem;
  }

  .qlk-modal-body {
    padding: 1rem;
  }

  .qlk-form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .qlk-form-actions {
    flex-direction: column;
  }

  .qlk-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Device View Modal Styles */
.qlk-device-view {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.qlk-view-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #e9ecef;
}

.qlk-device-image-container {
  text-align: center;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.qlk-device-main-image {
  max-width: 300px;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qlk-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.qlk-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.qlk-info-label {
  font-weight: 600;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.qlk-info-icon {
  font-size: 1rem;
}

.qlk-info-value {
  font-size: 1.1rem;
  color: #212529;
  font-weight: 500;
}

.qlk-stock-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #28a745;
}

.qlk-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.qlk-tag {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.qlk-notes-content {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  min-height: 80px;
  font-style: italic;
  color: #6c757d;
}

.qlk-notes-content:empty::before {
  content: "メモはありません";
  color: #adb5bd;
}

.qlk-transactions-list {
  max-height: 300px;
  overflow-y: auto;
  background: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.qlk-transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.2s ease;
}

.qlk-transaction-item:hover {
  background: #f8f9fa;
}

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

.qlk-transaction-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.qlk-transaction-type {
  font-weight: 600;
  font-size: 0.875rem;
}

.qlk-transaction-type.type-in {
  color: #28a745;
}

.qlk-transaction-type.type-out {
  color: #dc3545;
}

.qlk-transaction-type.type-adjust {
  color: #ffc107;
}

.qlk-transaction-details {
  font-size: 0.8rem;
  color: #6c757d;
}

.qlk-transaction-quantity {
  font-weight: 700;
  font-size: 1.1rem;
}

.qlk-transaction-quantity.positive {
  color: #28a745;
}

.qlk-transaction-quantity.negative {
  color: #dc3545;
}

.qlk-transaction-date {
  font-size: 0.8rem;
  color: #6c757d;
  text-align: right;
}

/* Responsive for View Modal */
@media (max-width: 768px) {
  .qlk-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .qlk-device-main-image {
    max-width: 200px;
    max-height: 200px;
  }

  .qlk-transaction-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .qlk-transaction-date {
    text-align: left;
  }

  /* Mobile Device Name Styling */
  .qlk-device-name {
    font-size: 1rem;
    font-weight: 600;
  }

  .qlk-device-link {
    padding: 0.5rem 0;
  }

  .qlk-sku-code {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
  }
}

/* Device Name Link Styling */
.qlk-device-link {
  background: none;
  border: none;
  color: #1a1a1a !important;
  text-decoration: none;
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
  padding: 0;
  margin: 0;
  text-align: left;
  width: 100%;
  transition: color 0.2s ease;
}

.qlk-device-link:hover {
  color: #667eea !important;
  text-decoration: underline;
}

.qlk-device-link:focus {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

/* Force device name visibility */
.qlk-device-name,
.qlk-device-name *,
.qlk-device-link,
.qlk-device-link * {
  color: #1a1a1a !important;
  text-shadow: none !important;
  background: transparent !important;
}

.qlk-device-name:hover,
.qlk-device-link:hover {
  color: #667eea !important;
}

/* Enhanced Statistics Cards */
.qlk-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin: 0 auto 3rem;
  padding: 0 2rem;
  max-width: 1400px;
}

.qlk-stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.qlk-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
}

.qlk-stat-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
}

.qlk-stat-card.qlk-stat-primary::before {
  background: linear-gradient(90deg, #667eea, #764ba2);
}

.qlk-stat-card.qlk-stat-success::before {
  background: linear-gradient(90deg, #28a745, #20c997);
}

.qlk-stat-card.qlk-stat-warning::before {
  background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.qlk-stat-card.qlk-stat-info::before {
  background: linear-gradient(90deg, #17a2b8, #6f42c1);
}

.qlk-stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.qlk-stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.qlk-stat-content {
  flex: 1;
}

.qlk-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 0.25rem;
}

.qlk-stat-label {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.qlk-stat-trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.qlk-trend-icon {
  font-size: 0.9rem;
}

.qlk-trend-text {
  color: #6c757d;
  font-weight: 500;
}

/* Enhanced Data Table Section */
.qlk-data-section {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 24px;
  margin: 0 2rem 3rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  backdrop-filter: blur(10px);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.qlk-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2.5rem;
  border-bottom: 1px solid rgba(233, 236, 239, 0.5);
  background: linear-gradient(
    135deg,
    rgba(248, 249, 250, 0.8),
    rgba(233, 236, 239, 0.6)
  );
  backdrop-filter: blur(10px);
}

.qlk-section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.qlk-section-icon {
  font-size: 1.25rem;
}

.qlk-section-actions {
  display: flex;
  gap: 0.75rem;
}

.qlk-filter-btn,
.qlk-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: white;
  color: #6c757d;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qlk-filter-btn:hover,
.qlk-export-btn:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  color: #495057;
}

/* Advanced Search and Filters */
.qlk-search-filters {
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

@media (max-width: 768px) {
  .qlk-search-filters {
    display: none;
  }
}

.qlk-filter-row {
  display: flex;
  gap: 1.5rem;
  align-items: end;
  max-width: 100%;
  flex-wrap: wrap;
}

.qlk-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.qlk-filter-group:first-child {
  flex: 2;
  min-width: 300px;
}

.qlk-filter-group:not(:first-child) {
  flex: 1;
  min-width: 150px;
}

.qlk-filter-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qlk-filter-icon {
  font-size: 0.875rem;
}

.qlk-search-input,
.qlk-filter-select {
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  display: flex;
  align-items: center;
}

.qlk-search-input:focus,
.qlk-filter-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Modern Data Table */
.qlk-table-container {
  overflow-x: auto;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(229, 231, 235, 0.5);
  backdrop-filter: blur(10px);
}

/* Hide mobile cards on desktop */
.qlk-mobile-cards {
  display: none;
}

/* Hide mobile filter popup button on desktop */
.qlk-filter-popup-btn {
  display: none;
}

.qlk-modern-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  table-layout: auto;
  display: table;
}

.qlk-modern-table th:first-child,
.qlk-modern-table td:first-child {
  width: 100px;
  min-width: 100px;
}

.qlk-modern-table th:nth-child(2),
.qlk-modern-table td:nth-child(2) {
  width: 40%;
  min-width: 200px;
}

.qlk-modern-table th:nth-child(3),
.qlk-modern-table td:nth-child(3) {
  width: 150px;
  min-width: 150px;
}

.qlk-modern-table th:nth-child(4),
.qlk-modern-table td:nth-child(4) {
  width: 150px;
  min-width: 150px;
}

.qlk-modern-table th:nth-child(5),
.qlk-modern-table td:nth-child(5) {
  width: 120px;
  min-width: 120px;
}

.qlk-modern-table thead {
  display: table-header-group;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  color: white;
  position: relative;
}

.qlk-modern-table tbody {
  display: table-row-group;
}

.qlk-modern-table thead tr {
  display: table-row;
}

.qlk-modern-table tbody tr {
  display: table-row;
}

.qlk-modern-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: table-cell;
  vertical-align: middle;
}

.qlk-th-icon {
  font-size: 1rem;
}

.qlk-modern-table tbody tr {
  border-bottom: 1px solid rgba(233, 236, 239, 0.5);
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.5) !important;
}

.qlk-modern-table tbody tr * {
  background: transparent !important;
}

.qlk-modern-table tbody tr:hover {
  background: linear-gradient(
    135deg,
    rgba(248, 249, 250, 0.8),
    rgba(255, 255, 255, 0.9)
  );
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.qlk-table-row.qlk-row-success {
  border-left: 4px solid #28a745;
}

.qlk-table-row.qlk-row-warning {
  border-left: 4px solid #ffc107;
}

.qlk-table-row.qlk-row-danger {
  border-left: 4px solid #dc3545;
}

.qlk-modern-table td {
  padding: 1rem;
  vertical-align: middle;
}

/* Table Columns */
.qlk-modern-table .qlk-col-image {
  width: 100px;
  min-width: 100px;
  text-align: center;
  padding: 0.5rem;
}

.qlk-image-container {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border: 2px solid #dee2e6;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.qlk-device-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  object-position: center;
}

.qlk-modern-table .qlk-col-name {
  width: 40%;
  min-width: 200px;
  padding: 1rem;
}

.qlk-modern-table .qlk-col-stock {
  width: 150px;
  min-width: 150px;
  text-align: center;
  padding: 1rem;
}

.qlk-modern-table .qlk-col-status {
  width: 150px;
  min-width: 150px;
  text-align: center;
  padding: 1rem;
}

.qlk-modern-table .qlk-col-actions {
  width: 120px;
  min-width: 120px;
  text-align: center;
  padding: 1rem;
}

.qlk-device-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0;
  background: transparent !important;
}

.qlk-device-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a !important;
}

.qlk-device-name a {
  text-decoration: none !important;
}

.qlk-device-name a:hover {
  text-decoration: none !important;
}

.qlk-device-link {
  color: #1a1a1a !important;
  text-decoration: none !important;
  transition: all 0.3s ease;
  display: block;
  padding: 0.25rem 0;
  border-radius: 4px;
  position: relative;
  background: transparent !important;
}

.qlk-device-link:hover {
  color: #667eea !important;
  text-decoration: none !important;
  transform: translateX(2px);
}

.qlk-device-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s ease;
}

.qlk-device-link:hover::after {
  width: 100%;
}

.qlk-device-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.qlk-sku-code {
  font-size: 0.85rem;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8f9fa;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  font-weight: 500;
}

.qlk-meta-icon {
  font-size: 0.75rem;
}

.qlk-modern-table .qlk-col-stock {
  width: 120px;
  text-align: center;
}

.qlk-stock-info {
  text-align: center;
}

.qlk-stock-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 0.25rem;
}

.qlk-stock-details {
  font-size: 0.75rem;
  color: #6c757d;
}

.qlk-min-stock {
  background: #e9ecef;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.qlk-modern-table .qlk-col-status {
  width: 120px;
  text-align: center;
}

.qlk-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
}

.qlk-status-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.qlk-status-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.qlk-status-danger {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.qlk-status-icon {
  font-size: 0.875rem;
}

.qlk-modern-table .qlk-col-actions {
  width: 100px;
  text-align: center;
}

.qlk-action-buttons {
  display: flex !important;
  gap: 0.5rem;
  justify-content: center;
  opacity: 1 !important;
  visibility: visible !important;
}

.qlk-action-btn {
  min-width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
  opacity: 1 !important;
  visibility: visible !important;
  padding: 0 8px;
}

.qlk-edit-btn {
  background: #17a2b8;
  color: white;
}

.qlk-edit-btn:hover {
  background: #138496;
  transform: translateY(-1px);
}

.qlk-view-btn {
  background: #6c757d;
  color: white;
}

.qlk-view-btn:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

/* Empty State */
.qlk-empty-row {
  background: #f8f9fa;
}

.qlk-empty-cell {
  text-align: center;
  padding: 3rem 2rem;
}

.qlk-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.qlk-empty-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.qlk-empty-state h3 {
  margin: 0;
  color: #6c757d;
  font-size: 1.25rem;
}

.qlk-empty-state p {
  margin: 0;
  color: #adb5bd;
  font-size: 0.9rem;
}

/* Desktop optimizations */
@media (min-width: 769px) {
  .qlk-filter-row {
    flex-direction: row;
    gap: 2rem;
    align-items: end;
  }

  .qlk-filter-group:first-child {
    flex: 2;
    min-width: 350px;
  }

  .qlk-filter-group:not(:first-child) {
    flex: 1;
    min-width: 180px;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .qlk-header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .qlk-dashboard-title {
    font-size: 2rem;
  }

  .qlk-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 0 1rem;
  }

  .qlk-stat-card {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .qlk-stat-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto;
  }

  .qlk-stat-icon .qlk-icon {
    font-size: 20px;
  }

  .qlk-stat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  }

  .qlk-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
  }

  .qlk-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.8;
    line-height: 1.2;
    text-align: center;
  }

  .qlk-stat-trend {
    display: none;
  }

  .qlk-data-section {
    margin: 0 1rem 2rem;
  }

  .qlk-filter-row {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 1rem;
  }

  .qlk-filter-group {
    flex: none;
    min-width: auto;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
  }

  .qlk-filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .qlk-filter-icon {
    font-size: 1rem;
  }

  .qlk-search-input,
  .qlk-filter-select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
    height: auto;
    min-height: 48px;
  }

  .qlk-search-input:focus,
  .qlk-filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
  }

  .qlk-search-input::placeholder {
    color: #6c757d;
    font-size: 0.9rem;
  }

  .qlk-section-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
  }

  .qlk-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    text-align: center;
  }

  .qlk-section-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
  }

  .qlk-export-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .qlk-export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

  .qlk-modern-table {
    font-size: 0.8rem;
  }

  .qlk-modern-table th,
  .qlk-modern-table td {
    padding: 0.75rem 0.5rem;
  }

  /* Hide table on mobile and show card layout */
  .qlk-table-container {
    display: none;
  }

  /* Mobile card layout */
  .qlk-mobile-cards {
    display: block;
  }

  .qlk-mobile-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-left: 4px solid #28a745;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
  }

  .qlk-mobile-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: rgba(102, 126, 234, 0.3);
  }

  .qlk-mobile-card.qlk-row-warning {
    border-left-color: #ffc107;
  }

  .qlk-mobile-card.qlk-row-danger {
    border-left-color: #dc3545;
  }

  /* Transaction Mobile Cards */
  .qlk-transaction-card {
    border-left-color: #28a745;
  }

  .qlk-transaction-card .qlk-transaction-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
  }

  .qlk-mobile-card-content {
    padding-top: 1rem;
  }

  .qlk-mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f4;
  }

  .qlk-mobile-card-row:last-child {
    border-bottom: none;
  }

  .qlk-mobile-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    flex-shrink: 0;
    min-width: 100px;
  }

  .qlk-mobile-value {
    color: #6c757d;
    font-size: 0.9rem;
    text-align: right;
    flex: 1;
  }

  .qlk-loading-card {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
  }

  .qlk-empty-card {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
  }

  /* Filter Toggle Button */
  .qlk-filter-toggle-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
  }

  .qlk-filter-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  }

  .qlk-filter-toggle-btn:active {
    transform: translateY(0);
  }

  .qlk-filter-toggle-icon {
    font-size: 18px;
    margin-right: 8px;
  }

  .qlk-filter-toggle-text {
    flex: 1;
    text-align: left;
  }

  .qlk-filter-toggle-arrow {
    font-size: 14px;
    transition: transform 0.3s ease;
  }

  .qlk-filter-toggle-btn.expanded .qlk-filter-toggle-arrow {
    transform: rotate(180deg);
  }

  /* Search Container (Outside) */
  .qlk-search-container {
    margin-bottom: 20px;
  }

  .qlk-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    padding: 8px 16px;
    gap: 12px;
  }

  .qlk-search-input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
  }

  .qlk-search-label {
    display: none;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-right: 12px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .qlk-search-icon {
    display: none;
  }

  /* Mobile: Show icon separately */
  @media (max-width: 768px) {
    .qlk-search-label {
      display: none !important;
    }

    .qlk-search-input-wrapper::before {
      content: "🔍";
      font-size: 20px;
      color: #6c757d;
      margin-right: 12px;
      flex-shrink: 0;
    }
  }

  .qlk-main-search-input {
    flex: 1;
    border: none;
    font-size: 16px;
    background: transparent;
    color: #495057;
    outline: none;
    padding: 8px 0;
  }

  .qlk-main-search-input::placeholder {
    color: #adb5bd;
    font-size: 16px;
  }

  .qlk-main-search-input:focus {
    outline: none;
  }

  /* Filters Container */
  .qlk-filters-container {
    margin-bottom: 20px;
  }

  /* Collapsible Filter Panel - Mobile Only */
  @media (max-width: 768px) {
    .qlk-search-filters.qlk-filters-collapsed {
      max-height: 0;
      padding: 0 20px;
      margin-bottom: 0;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s ease;
      overflow: hidden;
    }

    .qlk-search-filters.qlk-filters-expanded {
      max-height: 500px;
      padding: 20px;
      margin-bottom: 20px;
      opacity: 1;
      visibility: visible;
      transition: all 0.3s ease;
    }
  }

  /* Desktop: Hide toggle button and always show filters */
  @media (min-width: 769px) {
    .qlk-filter-toggle-btn {
      display: none !important;
      visibility: hidden !important;
      opacity: 0 !important;
      height: 0 !important;
      margin: 0 !important;
      padding: 0 !important;
      overflow: hidden !important;
    }

    .qlk-filters-container {
      margin-bottom: 0;
    }

    /* Force hide toggle button on desktop */
    button#qlk-transaction-filter-toggle {
      display: none !important;
      visibility: hidden !important;
      opacity: 0 !important;
      height: 0 !important;
      margin: 0 !important;
      padding: 0 !important;
      overflow: hidden !important;
      position: absolute !important;
      left: -9999px !important;
    }

    .qlk-search-filters {
      max-height: none !important;
      opacity: 1 !important;
      visibility: visible !important;
      padding: 0 !important;
      margin-bottom: 20px !important;
      background: transparent !important;
      box-shadow: none !important;
      border: none !important;
    }

    .qlk-search-filters.qlk-filters-collapsed {
      max-height: none !important;
      opacity: 1 !important;
      visibility: visible !important;
      padding: 0 !important;
      margin-bottom: 20px !important;
      background: transparent !important;
      box-shadow: none !important;
      border: none !important;
    }

    .qlk-filter-row {
      display: flex;
      gap: 20px;
      align-items: end;
      flex-wrap: wrap;
      background: #f8f9fa;
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .qlk-filter-group {
      flex: 1;
      min-width: 150px;
    }

    .qlk-filter-group:first-child {
      flex: 2;
      min-width: 200px;
    }

    .qlk-filter-label {
      font-size: 0.875rem;
      font-weight: 500;
      color: #495057;
      margin-bottom: 0.5rem;
      display: block;
    }

    .qlk-filter-select {
      width: 100%;
      padding: 8px 12px;
      border: 1px solid #ced4da;
      border-radius: 4px;
      font-size: 0.875rem;
      background: white;
    }

    .qlk-filter-select:focus {
      outline: none;
      border-color: #667eea;
      box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
    }

    /* Desktop search styling */
    .qlk-search-label {
      display: block !important;
    }

    .qlk-search-input-wrapper {
      max-width: 600px;
      margin: 0 auto 20px auto;
      padding: 8px 16px;
      gap: 0;
      align-items: center;
    }

    .qlk-main-search-input {
      font-size: 14px;
      padding: 6px 0;
      flex: 1;
    }

    .qlk-search-input-wrapper::before {
      display: none !important;
    }
  }

  .qlk-mobile-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f3f4;
  }

  .qlk-mobile-card-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border: 2px solid #dee2e6;
  }

  .qlk-mobile-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  .qlk-mobile-card-info {
    flex: 1;
  }

  .qlk-mobile-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: #1a1a1a !important;
    line-height: 1.3;
  }

  .qlk-mobile-card-title .qlk-device-link {
    color: #1a1a1a !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
    display: block;
    width: 100%;
  }

  .qlk-mobile-card-title .qlk-device-link:hover {
    color: #667eea !important;
  }

  .qlk-mobile-card-sku {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
  }

  .qlk-mobile-card-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
  }

  .qlk-mobile-detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
  }

  .qlk-mobile-detail-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: #6c757d;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    white-space: nowrap;
  }

  .qlk-mobile-icon {
    font-size: 0.8rem;
  }

  .qlk-mobile-text {
    font-size: 0.7rem;
  }

  .qlk-mobile-detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
  }

  .qlk-mobile-stock-number {
    font-size: 1rem;
    font-weight: 700;
    color: #28a745;
    margin: 0;
  }

  .qlk-mobile-stock-number.qlk-status-warning {
    color: #ffc107;
  }

  .qlk-mobile-stock-number.qlk-status-danger {
    color: #dc3545;
  }

  /* Status Icons */
  .qlk-mobile-status-icon {
    font-size: 0.8rem;
    margin-right: 0.25rem;
  }

  .qlk-mobile-status-icon.qlk-status-success {
    color: #28a745;
  }

  .qlk-mobile-status-icon.qlk-status-warning {
    color: #ffc107;
  }

  .qlk-mobile-status-icon.qlk-status-danger {
    color: #dc3545;
  }

  .qlk-mobile-card-actions {
    display: none;
  }

  .qlk-mobile-action-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .qlk-mobile-edit-btn {
    background: #17a2b8;
    color: white;
  }

  .qlk-mobile-edit-btn:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
  }

  .qlk-mobile-view-btn {
    background: #6c757d;
    color: white;
  }

  .qlk-mobile-view-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
  }

  /* Mobile Filter Popup */
  .qlk-filter-popup-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .qlk-filter-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

  .qlk-mobile-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }

  .qlk-mobile-filter-popup {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
  }

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

  .qlk-mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
  }

  .qlk-mobile-filter-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
  }

  .qlk-mobile-filter-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
  }

  .qlk-mobile-filter-close:hover {
    background: #f8f9fa;
    color: #495057;
  }

  .qlk-mobile-filter-content {
    padding: 1.5rem;
  }

  .qlk-mobile-filter-group {
    margin-bottom: 1.5rem;
  }

  .qlk-mobile-filter-group:last-child {
    margin-bottom: 0;
  }

  .qlk-mobile-filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
  }

  .qlk-mobile-search-input,
  .qlk-mobile-filter-select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
  }

  .qlk-mobile-search-input:focus,
  .qlk-mobile-filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  }

  .qlk-mobile-search-input::placeholder {
    color: #6c757d;
    font-size: 0.9rem;
  }

  .qlk-mobile-filter-actions {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #e9ecef;
  }

  .qlk-mobile-filter-clear,
  .qlk-mobile-filter-apply {
    flex: 1;
    padding: 0.875rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .qlk-mobile-filter-clear {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
  }

  .qlk-mobile-filter-clear:hover {
    background: #e9ecef;
    color: #495057;
  }

  .qlk-mobile-filter-apply {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
  }

  .qlk-mobile-filter-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
  }
}
.qlk-widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 2em;
}
.qlk-widget {
  padding: 25px;
  background-color: #f8f9fa;
  border-radius: 8px;
  text-align: center;
  border-left: 5px solid #0073aa;
}
.qlk-widget-alert {
  border-left-color: #d63638;
}
.qlk-widget-ok {
  border-left-color: #46b450;
}
.qlk-widget-value {
  font-size: 3em;
  font-weight: bold;
  line-height: 1;
}
.qlk-widget-label {
  margin-top: 10px;
  font-size: 1em;
  color: #555;
}
.qlk-quick-actions {
  margin-bottom: 2em;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.qlk-action-button {
  display: inline-block;
  padding: 10px 20px;
  background-color: #0073aa;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
}
.qlk-action-button:hover {
  background-color: #005a87;
}
.qlk-report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
}
.qlk-report-table th,
.qlk-report-table td {
  padding: 12px;
  border: 1px solid #ddd;
  text-align: left;
  vertical-align: middle;
}
.qlk-report-table th {
  background-color: #f1f1f1;
}
.qlk-report-table tr:nth-child(even) {
  background-color: #f8f9fa;
}
.qlk-report-table tr.low-stock {
  background-color: #f8d7da !important;
  color: #721c24;
}
.qlk-report-table tr.low-stock .stock-quantity {
  font-weight: bold;
}
.qlk-dashboard-search {
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.qlk-dashboard-search label {
  font-weight: bold;
}
.qlk-dashboard-search input[type="search"] {
  padding: 8px;
  min-width: 300px;
}
.qlk-dashboard-search .spinner {
  visibility: visible;
}
.qlk-report-table .col-image {
  width: 80px;
}
.qlk-report-table .col-image img {
  width: 60px;
  height: 60px;
  object-fit: contain; /* THAY ĐỔI TỪ cover SANG contain */
  border-radius: 4px;
  display: block;
  background-color: #f9f9f9;
}
.qlk-report-table .qlk-placeholder-thumb {
  border: 1px dashed #ddd;
}
.qlk-report-table .col-actions {
  width: 100px;
}

/* View Modal Styles */
.qlk-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 99999 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease-out;
}

.qlk-modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 700px;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  animation: slideInUp 0.4s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}
.qlk-modal-close {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  z-index: 10 !important;
}

.qlk-modal-close:hover {
  background: rgba(255, 255, 255, 1) !important;
  color: #000 !important;
  border-color: #999 !important;
  transform: scale(1.1) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
}

/* Modal close button - simplified, using inline styles in HTML */

/* Modal Header and Body */
.qlk-modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  margin: 0;
  position: relative;
  overflow: hidden;
}

.qlk-modal-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f093fb, #f5576c, #4facfe);
}

.qlk-modal-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.qlk-modal-body {
  padding: 2.5rem;
  background: #ffffff;
}

/* Device View Modal Styles */
.qlk-device-view {
  max-width: 100%;
}

.qlk-view-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.qlk-section-title {
  margin: 0 0 1.5rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e9ecef;
}

.qlk-section-icon {
  font-size: 1.5rem;
}

.qlk-device-image-container {
  text-align: center;
  margin-bottom: 1rem;
}

.qlk-device-main-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border: 2px solid #e9ecef;
}

.qlk-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.qlk-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.qlk-info-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qlk-info-icon {
  font-size: 1rem;
}

.qlk-info-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: #2c3e50;
  padding: 0.75rem;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.qlk-stock-value {
  color: #28a745;
  font-weight: 700;
}

.qlk-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.qlk-tag {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.qlk-notes-content {
  background: #ffffff;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  min-height: 100px;
  font-style: italic;
  color: #6c757d;
}

.qlk-transactions-list {
  max-height: 300px;
  overflow-y: auto;
}

.qlk-transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-bottom: 0.75rem;
}

.qlk-transaction-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.qlk-transaction-type {
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qlk-transaction-type.type-in {
  background: #d4edda;
  color: #155724;
}

.qlk-transaction-type.type-out {
  background: #f8d7da;
  color: #721c24;
}

.qlk-transaction-type.type-adjustment {
  background: #fff3cd;
  color: #856404;
}

.qlk-transaction-details {
  font-size: 0.8rem;
  color: #6c757d;
}

.qlk-transaction-quantity {
  font-weight: 700;
  font-size: 1.125rem;
}

.qlk-transaction-quantity.positive {
  color: #28a745;
}

.qlk-transaction-quantity.negative {
  color: #dc3545;
}

.qlk-transaction-date {
  font-size: 0.8rem;
  color: #6c757d;
  text-align: right;
}

/* Responsive Modal Design */
@media (max-width: 768px) {
  .qlk-modal-content {
    width: 95%;
    margin: 1rem;
    border-radius: 16px;
    max-height: 95vh;
  }

  .qlk-modal-header {
    padding: 1.5rem;
  }

  .qlk-modal-title {
    font-size: 1.25rem;
  }

  .qlk-modal-body {
    padding: 1.5rem;
  }

  .qlk-modal-close {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .qlk-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .qlk-view-section {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }

  .qlk-section-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  .qlk-device-main-image {
    max-height: 200px;
  }

  .qlk-transaction-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .qlk-transaction-date {
    text-align: left;
  }
}

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

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

.qlk-modal-content .form-field {
  margin-bottom: 15px;
}
.qlk-modal-content label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}
.qlk-modal-content input[type="number"],
.qlk-modal-content input[type="text"],
.qlk-modal-content select,
.qlk-modal-content textarea {
  width: 100%;
  padding: 8px;
}
.qlk-modal-content .form-field em {
  font-size: 12px;
  color: #666;
}
.qlk-modal-content .spinner {
  float: none;
  vertical-align: middle;
  margin-left: 10px;
}
#qlk-modal-feedback,
#qlk-edit-modal-feedback,
#qlk-add-modal-feedback {
  margin-bottom: 15px;
  padding: 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.tax-field {
  margin-top: 15px;
}
.tax-list {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #ddd;
  padding: 10px;
  background-color: #fff;
}
.tax-list label {
  display: block;
  margin-bottom: 5px;
  font-weight: normal;
}
