/* --- LEXTRACK WEB DESIGN SYSTEM PRO --- */
:root {
  --font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --bg-color: #080c14;
  --bg-card: rgba(15, 23, 42, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --accent-color: #06b6d4;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --purple-color: #a855f7;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-glow: 0 0 35px rgba(99, 102, 241, 0.25);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(15, 23, 42, 0.7);
  --backdrop-blur: blur(20px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.45) #0c111d;
}

/* Custom Dark Scrollbars Matching System Theme */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background-color: #0c111d;
}

::-webkit-scrollbar-track {
  background: #0c111d;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.45);
  border-radius: 4px;
  border: 2px solid #0c111d;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.85);
}

::-webkit-scrollbar-corner {
  background: #0c111d;
}

::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

body {
  background: var(--bg-color);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.18) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.18) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(168, 85, 247, 0.08) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(99, 102, 241, 0.2);
}

.hidden {
  display: none !important;
}

.screen-container {
  width: 100%;
  min-height: 100vh;
}

/* LOGIN SCREEN (PIXEL-PERFECT SPLIT 2-COLUMN CARD) */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
  padding: 32px;
  background: radial-gradient(circle at 50% 40%, #1e1b4b 0%, #0b0f19 75%);
}

.split-login-card {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 960px;
  min-height: 540px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 60px rgba(99, 102, 241, 0.25);
  backdrop-filter: blur(25px);
}

.glow-effect {
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 60px rgba(99, 102, 241, 0.25);
}

/* LEFT BANNER COLUMN */
.login-left-banner {
  flex: 1.1;
  min-width: 420px;
  position: relative;
  background: linear-gradient(145deg, #1e1b4b 0%, #311b92 50%, #0f172a 100%);
  overflow: hidden;
}

.geometric-pattern-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 15% 25%, rgba(99, 102, 241, 0.3) 0%, transparent 55%),
    radial-gradient(circle at 85% 75%, rgba(168, 85, 247, 0.25) 0%, transparent 50%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.03) 75%);
  background-size: cover, cover, 60px 60px;
  pointer-events: none;
}

.banner-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 44px;
  box-sizing: border-box;
}

.brand-logo-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.45);
}

.hero-icon-box .brand-icon {
  width: 26px;
  height: 26px;
  color: #ffffff;
}

.brand-text-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-title {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.version-tag {
  font-size: 12px;
  color: #38bdf8;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 10px;
  border-radius: 14px;
}

/* ROBOT ASSISTANT & SPEECH BUBBLE */
.robot-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 50px !important;
  margin-bottom: 20px !important;
  padding: 10px 0;
  animation: floatRobot 4s ease-in-out infinite;
}

@keyframes floatRobot {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

.robot-avatar-img {
  max-width: 215px;
  max-height: 215px;
  object-fit: contain;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 35px rgba(99, 102, 241, 0.4));
  transition: transform 0.3s ease;
}

.robot-avatar-img:hover {
  transform: scale(1.05) rotate(2deg);
}

.speech-bubble {
  position: absolute;
  top: -14px;
  left: 24px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 20px;
  border-bottom-left-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  z-index: 5;
  animation: pulseBubble 2s infinite alternate;
}

@keyframes pulseBubble {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.08);
  }
}

.hero-bottom-text {
  margin-top: auto;
}

.hero-headline {
  font-size: 36px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 14px;
  color: rgba(226, 232, 240, 0.85);
  line-height: 1.65;
  max-width: 340px;
}

/* RIGHT FORM COLUMN */
.login-right-form {
  flex: 1;
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(11, 15, 25, 0.96);
  box-sizing: border-box;
}

.form-header {
  margin-bottom: 32px;
}

.form-title {
  font-size: 30px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.form-subtitle {
  font-size: 13.5px;
  color: #94a3b8;
  line-height: 1.5;
}

.admin-contact-link {
  color: #818cf8;
  text-decoration: none;
  font-weight: 500;
}

.admin-contact-link:hover {
  text-decoration: underline;
  color: #a5b4fc;
}

.input-field-group {
  margin-bottom: 20px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-icon .field-icon {
  position: absolute;
  left: 20px;
  width: 20px;
  height: 20px;
  color: #64748b;
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 2;
}

.input-with-icon input {
  width: 100%;
  height: 52px;
  padding: 0 20px 0 54px !important;
  border-radius: 28px !important;
  background: #eef2ff !important;
  color: #0f172a !important;
  border: 2px solid transparent !important;
  font-size: 14.5px;
  font-weight: 500;
  transition: all 0.25s ease;
  box-sizing: border-box !important;
}

.input-with-icon input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.input-with-icon input:focus {
  background: #ffffff !important;
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25) !important;
}

.input-with-icon:focus-within .field-icon {
  color: #6366f1;
}

.form-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  margin-bottom: 28px;
  font-size: 13px;
}

.remember-me-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}

.forgot-pass-link {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-pass-link:hover {
  color: #ffffff;
}

.custom-checkbox {
  accent-color: #6366f1;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  cursor: pointer;
}

/* BUTTON PILL GRADIENT */
.btn-login-pill {
  width: 100%;
  height: 52px;
  padding: 0 24px;
  border-radius: 28px !important;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  font-size: 15.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-login-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(99, 102, 241, 0.6);
}

@media (max-width: 820px) {
  .split-login-card {
    flex-direction: column;
    max-width: 460px;
  }
  .login-left-banner {
    min-height: 220px;
    min-width: unset;
  }
  .banner-content {
    padding: 32px 24px;
  }
  .login-right-form {
    padding: 36px 28px;
  }
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-group input, .select-input, .date-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(8, 12, 20, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus, .select-input:focus, .date-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  user-select: none;
}

.btn:active {
  transform: scale(0.95) translateY(1px) !important;
  filter: brightness(0.92);
}

.btn-loading {
  pointer-events: none !important;
  opacity: 0.75 !important;
  cursor: wait !important;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-color), #0284c7);
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-icon {
  padding: 8px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
}

.btn-icon:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.btn-profile {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.btn-profile:hover {
  background: rgba(255, 255, 255, 0.08);
}

.error-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: var(--danger-color);
  font-size: 14px;
  margin-bottom: 20px;
}

/* --- APP LAYOUT (SIDEBAR + MAIN WRAPPER) --- */
#main-screen.app-layout {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  width: 100vw;
  background: var(--bg-color);
  overflow-x: hidden;
}

/* SIDEBAR STYLING */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: rgba(12, 17, 29, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  padding: 20px 16px;
  backdrop-filter: blur(20px);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#main-screen.app-layout .sidebar.collapsed {
  width: 68px !important;
  min-width: 68px !important;
  max-width: 68px !important;
  padding: 16px 8px !important;
  align-items: center !important;
}

#main-screen.app-layout .sidebar.collapsed .brand-text,
#main-screen.app-layout .sidebar.collapsed .menu-section-label,
#main-screen.app-layout .sidebar.collapsed .nav-tab-label,
#main-screen.app-layout .sidebar.collapsed .sidebar-main-nav-btn span,
#main-screen.app-layout .sidebar.collapsed #db-mode-name,
#main-screen.app-layout .sidebar.collapsed #i18n-btn-toggle,
#main-screen.app-layout .sidebar.collapsed #i18n-btn-logout,
#main-screen.app-layout .sidebar.collapsed .nav-select-arrow,
#main-screen.app-layout .sidebar.collapsed .nav-select-label,
#main-screen.app-layout .sidebar.collapsed .sidebar-control-item span,
#main-screen.app-layout .sidebar.collapsed #user-display-name {
  display: none !important;
}

#main-screen.app-layout .sidebar.collapsed .custom-dropdown-menu span,
#main-screen.app-layout .sidebar.collapsed .custom-dropdown-menu .menu-item-name,
#main-screen.app-layout .sidebar.collapsed .custom-dropdown-menu .menu-item-desc,
#main-screen.app-layout .sidebar.collapsed .custom-dropdown-menu .dropdown-menu-title {
  display: block !important;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center !important;
  padding: 6px 0 16px 0 !important;
  width: 100% !important;
}

.sidebar.collapsed .sidebar-nav-dropdown-wrapper {
  width: 100% !important;
  padding: 0 !important;
  display: flex !important;
  justify-content: center !important;
  position: relative !important;
}

.sidebar.collapsed .nav-select-container {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  padding: 0 !important;
  justify-content: center !important;
  margin: 0 auto !important;
  border-radius: 12px !important;
  position: relative !important;
}

.sidebar.collapsed .nav-select-icon {
  margin: 0 auto !important;
  width: 20px !important;
  height: 20px !important;
}

.sidebar.collapsed .nav-select-label,
.sidebar.collapsed .nav-select-arrow {
  display: none !important;
}

.sidebar.collapsed .sidebar-bottom-controls {
  width: 100% !important;
  align-items: center !important;
  gap: 6px !important;
}

.sidebar.collapsed .sidebar-control-item {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  padding: 0 !important;
  justify-content: center !important;
  margin: 0 auto !important;
  border-radius: 12px !important;
  position: relative !important;
}

.sidebar.collapsed .sidebar-control-item svg,
.sidebar.collapsed .sidebar-control-item i {
  margin: 0 auto !important;
  width: 20px !important;
  height: 20px !important;
}

.sidebar.collapsed .sidebar-user-btn .avatar {
  margin: 0 auto !important;
  width: 26px !important;
  height: 26px !important;
}

.sidebar.collapsed .sidebar-lang-box select {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer !important;
}

.sidebar.collapsed .sidebar-footer {
  width: 100% !important;
  padding-top: 10px !important;
  display: flex !important;
  justify-content: center !important;
}

.sidebar.collapsed .badge-status {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  padding: 0 !important;
  justify-content: center !important;
  margin: 0 auto !important;
  border-radius: 12px !important;
}

.sidebar.collapsed .badge-status svg,
.sidebar.collapsed .badge-status i {
  margin: 0 auto !important;
  width: 20px !important;
  height: 20px !important;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 24px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-logo-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.brand-logo-wrapper svg, .brand-logo-wrapper i {
  width: 22px;
  height: 22px;
  color: #ffffff;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.version-tag {
  font-size: 11px;
  color: var(--accent-color);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
  flex: 1;
}

.menu-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  padding: 12px 12px 6px 12px;
}

/* SIDEBAR MAIN NAV BUTTON (GRUPPIERUNGEN) */
.sidebar-main-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-main-nav-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
}

.sidebar-main-nav-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(139, 92, 246, 0.3));
  border-color: rgba(99, 102, 241, 0.85);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.sidebar-main-nav-btn svg, .sidebar-main-nav-btn i {
  color: #a5b4fc;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-main-nav-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  padding: 0 !important;
  justify-content: center !important;
  margin: 0 auto !important;
  border-radius: 12px !important;
}

.sidebar.collapsed .sidebar-main-nav-btn span {
  display: none !important;
}

/* PREMIUM CUSTOM DROPDOWN NAVIGATION */
.sidebar-nav-dropdown-wrapper {
  padding: 0;
  margin-bottom: 8px;
  position: relative;
}

.custom-dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 12px;
  gap: 10px;
  box-shadow: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #e2e8f0;
  box-sizing: border-box;
  text-align: left;
}

.custom-dropdown-trigger:hover,
.custom-dropdown-trigger.active,
.custom-dropdown.open .custom-dropdown-trigger {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.25);
  color: #ffffff;
}

.nav-select-label {
  flex: 1;
  text-align: left;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f1f5f9;
}

.nav-select-icon {
  width: 18px;
  height: 18px;
  color: #a5b4fc;
  flex-shrink: 0;
}

.nav-select-arrow {
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-dropdown.open .nav-select-arrow {
  transform: rotate(180deg);
  color: #a5b4fc;
}

/* Floating Glassmorphic Menu Popover */
.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 240px;
  background: rgba(15, 23, 42, 0.96) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(99, 102, 241, 0.35) !important;
  border-radius: 16px !important;
  padding: 8px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 24px rgba(99, 102, 241, 0.2) !important;
  z-index: 99999 !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: dropdownPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-dropdown-menu.hidden {
  display: none !important;
}

@keyframes dropdownPop {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-menu-header {
  padding: 6px 10px 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.dropdown-menu-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #818cf8;
  text-transform: uppercase;
}

.dropdown-menu-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.dropdown-menu-item:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
  transform: translateX(3px);
}

.dropdown-menu-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.25));
  border-color: rgba(99, 102, 241, 0.85);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.menu-item-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.menu-item-icon-box svg,
.menu-item-icon-box i {
  width: 17px;
  height: 17px;
}

.dropdown-menu-item:hover .menu-item-icon-box {
  transform: scale(1.1);
}

.menu-item-icon-box.icon-indigo {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.menu-item-icon-box.icon-emerald {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.menu-item-icon-box.icon-amber {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.menu-item-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.menu-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
}

.menu-item-desc {
  font-size: 11px;
  color: #94a3b8;
}

/* Collapsed sidebar positioning for popover */
.sidebar.collapsed .custom-dropdown-menu {
  top: 0 !important;
  left: calc(100% + 12px) !important;
  width: 240px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 30px rgba(99, 102, 241, 0.35) !important;
  animation: dropdownPopRight 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownPopRight {
  from {
    opacity: 0;
    transform: translateX(-10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* SIDEBAR BOTTOM CONTROLS (LANGUAGE, PROFILE, LOGOUT) */
.sidebar-bottom-controls {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-control-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-control-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
}

.sidebar-settings-btn {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
}

.sidebar-settings-btn:hover,
.sidebar-settings-btn.active {
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(99, 102, 241, 0.8);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.35);
}

.sidebar-control-item svg, .sidebar-control-item i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-user-btn .avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.sidebar-lang-box {
  position: relative;
}

.sidebar-lang-box select {
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  width: 100%;
}

.sidebar-lang-box select option {
  background: #0f172a;
  color: #fff;
}

.sidebar-logout-btn {
  color: #f87171 !important;
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #ffffff !important;
}

.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.badge-status {
  width: 100%;
  justify-content: center;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.6);
  font-size: 11.5px;
}

/* MAIN WRAPPER (RIGHT OF SIDEBAR) */
.main-wrapper {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100vw - 260px);
  box-sizing: border-box;
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar.collapsed ~ .main-wrapper,
.main-wrapper.collapsed {
  margin-left: 68px !important;
  width: calc(100vw - 68px) !important;
}

/* TOP HEADER (REMOVED FOR MAXIMUM VERTICAL SPACE) */
.top-header {
  display: none !important;
}

.page-title {
  display: none !important;
}

.header-right {
  display: none !important;
}

.lang-selector-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
}

.lang-selector-box select {
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  font-size: 13px;
}

.lang-selector-box select option {
  background: #0f172a !important;
  color: #ffffff !important;
  padding: 6px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 20px;
  color: #ffffff;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-profile:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(99, 102, 241, 0.5);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.btn-logout-header {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.btn-logout-header:hover {
  color: var(--danger-color);
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-accent {
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-color);
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.badge-outline {
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: var(--success-color); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--warning-color); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: var(--danger-color); }

/* MAIN CONTENT */
.main-content {
  padding: 24px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* DASHBOARD KPIS */
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.icon-blue { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.icon-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.icon-cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }

.kpi-data { display: flex; flex-direction: column; }
.kpi-label { font-size: 13px; color: var(--text-muted); }
.kpi-value { font-size: 24px; font-weight: 700; color: #ffffff; margin-top: 2px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

/* SOPHISTICATED MULTI-WIDGET DASHBOARD STYLES (MATCHING IMAGE 1) */
.dash-quick-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.dash-strip-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.dash-strip-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sophisticated-dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-row {
  display: grid;
  gap: 20px;
}

.dash-row-1 {
  grid-template-columns: 360px 1fr;
}

.dash-row-2 {
  grid-template-columns: 1fr 300px 320px;
}

.dash-row-3 {
  grid-template-columns: 1fr 340px;
}

.dash-widget {
  background: linear-gradient(145deg, rgba(26, 35, 60, 0.85), rgba(13, 20, 36, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dash-widget:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(99, 102, 241, 0.2);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.widget-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.widget-subtitle {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  display: block;
  margin-top: 2px;
}

.widget-tag-pill {
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* WIDGET 1: CATEGORY DONUT */
.donut-chart-wrapper {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 10px auto;
}

.donut-center-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-number {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  display: block;
  line-height: 1;
}

.donut-sublabel {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.widget-mini-bar-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mini-bar-title {
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  text-align: center;
  margin-bottom: 8px;
}

.mini-bars-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  height: 55px;
}

.mini-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  height: 100%;
  justify-content: flex-end;
}

.mini-bar-pill {
  width: 14px;
  border-radius: 8px;
  transition: height 0.3s ease;
}

.pill-1 { background: linear-gradient(180deg, #ec4899, #be185d); }
.pill-2 { background: linear-gradient(180deg, #f97316, #c2410c); }
.pill-3 { background: linear-gradient(180deg, #38bdf8, #0284c7); }
.pill-4 { background: linear-gradient(180deg, #c084fc, #7e22ce); }
.pill-5 { background: linear-gradient(180deg, #34d399, #059669); }

/* WIDGET 2: PRODUCTION FUNDING */
.funding-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 10px;
  height: 210px;
}

.slanted-bars-container {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  height: 170px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.slanted-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.slanted-bar-fill {
  width: 26px;
  border-radius: 14px;
  transform: skewX(-14deg);
  background: linear-gradient(180deg, #38bdf8, #0284c7);
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.45);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.slanted-bar-col:hover .slanted-bar-fill {
  transform: skewX(-14deg) scaleY(1.06);
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  box-shadow: 0 0 25px rgba(96, 165, 250, 0.8);
}

.bar-val {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 6px;
  letter-spacing: 0.5px;
}

.funding-legend-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-next { background: #ffffff; box-shadow: 0 0 8px #ffffff; }
.dot-object { background: #38bdf8; box-shadow: 0 0 8px #38bdf8; }
.dot-profit { background: #c084fc; box-shadow: 0 0 8px #c084fc; }
.dot-active { background: #34d399; box-shadow: 0 0 8px #34d399; }

/* WIDGET 3: PIPELINE */
.pipeline-bars-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.pipeline-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pipeline-name {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.pipeline-track {
  height: 22px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 12px;
  overflow: hidden;
  padding: 2px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pipeline-fill {
  height: 100%;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  transition: width 0.6s ease;
}

/* WIDGET 4: ARCH STATS */
.arch-meters-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.arch-meter {
  position: relative;
  width: 140px;
  height: 70px;
}

.arch-svg {
  width: 100%;
  height: 100%;
}

.arch-svg.flip-y {
  transform: rotate(180deg);
}

.arch-text {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  line-height: 1.1;
}

.top-arch .arch-text { bottom: 4px; }
.bottom-arch .arch-text { top: 4px; }

.arch-text strong {
  font-size: 18px;
  font-weight: 800;
  display: block;
}

.arch-text small {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
}

.arch-footer-caption {
  text-align: center;
  font-size: 11px;
  color: #64748b;
  margin-top: 8px;
}

/* WIDGET 5: ACTIVE SPEED GAUGE */
.speed-gauge-wrapper {
  position: relative;
  width: 180px;
  height: 100px;
  margin: 4px auto 0 auto;
  text-align: center;
}

.gauge-svg {
  width: 100%;
  height: 100%;
}

.gauge-speed-center {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.speed-val {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  display: block;
  line-height: 1;
}

.speed-label {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 2px;
  display: block;
}

.gauge-acc-pills {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.acc-pill {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.pill-acc1 { background: rgba(168, 85, 247, 0.25); border: 1px solid rgba(168, 85, 247, 0.5); color: #c084fc; }
.pill-acc2 { background: rgba(244, 63, 94, 0.25); border: 1px solid rgba(244, 63, 94, 0.5); color: #fb7185; }
.pill-acc3 { background: rgba(56, 189, 248, 0.25); border: 1px solid rgba(56, 189, 248, 0.5); color: #38bdf8; }

/* WIDGET 6: TOTAL REVENUE LOOP */
.stadium-track-wrapper {
  position: relative;
  height: 100px;
  background: rgba(15, 23, 42, 0.7);
  border: 3px solid rgba(168, 85, 247, 0.4);
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: 10px;
  box-shadow: inset 0 0 25px rgba(168, 85, 247, 0.2);
}

.stadium-nodes {
  display: flex;
  justify-content: space-around;
  width: 100%;
  padding: 0 20px;
}

.revenue-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 68px;
  height: 68px;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.revenue-node strong {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.revenue-node span {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}

/* WIDGET 7: TRANSACTION RINGS */
.rings-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
}

.rings-canvas-container {
  position: relative;
  width: 110px;
  height: 110px;
}

.rings-center-digits {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.rings-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.r-legend {
  display: flex;
  align-items: center;
  gap: 8px;
}

.r-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.r-1 { background: #c084fc; box-shadow: 0 0 6px #c084fc; }
.r-2 { background: #38bdf8; box-shadow: 0 0 6px #38bdf8; }
.r-3 { background: #f43f5e; box-shadow: 0 0 6px #f43f5e; }

.chart-card, .quick-actions-card { padding: 24px; }
.card-header { margin-bottom: 16px; }
.card-header h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.chart-container { height: 280px; position: relative; }

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.btn-lg { padding: 14px 20px; font-size: 15px; }

/* TABLE & FILTER TOOLBAR (MATCHING DESKTOP ERP IMAGE 2) */
.filters-card {
  padding: 10px 16px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: rgba(12, 17, 29, 0.7);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-controls-row, .filter-row, .search-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box;
  flex-wrap: nowrap !important;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.filter-group.fg-view {
  flex: 2 1 0%;
  min-width: 160px;
}

.filter-group.fg-date {
  flex: 1 1 0%;
  min-width: 110px;
}

.filter-group label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(8, 12, 20, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  flex: 1 1 0% !important;
  min-width: 80px !important;
  box-sizing: border-box;
}

.search-box input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 12.5px;
  width: 100%;
}

.search-box input:focus { outline: none; }

.filter-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0 !important;
}

.cluster-sticky-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 12, 22, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding-top: 4px;
  margin-bottom: 6px;
}

.table-container {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 195px);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  position: relative;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 11.5px;
  line-height: 1.2;
}

.data-table th {
  background: #080c14;
  padding: 4px 6px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.cluster-table thead {
  position: sticky;
  top: 0;
  z-index: 35;
  background: #080c14;
}

.cluster-table thead tr {
  background: #080c14;
}

.cluster-table thead tr:first-child th {
  position: sticky;
  top: 0;
  background: #080c14;
  z-index: 36;
  padding: 5px 6px 3px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  height: 24px;
  line-height: 16px;
  box-sizing: border-box;
  border-bottom: none;
}

.cluster-table thead tr.search-row-tr th {
  position: sticky;
  top: 23px;
  background: #080c14;
  z-index: 35;
  border-top: none;
  border-bottom: 2px solid rgba(99, 102, 241, 0.45);
  padding: 2px 4px 6px 4px;
  box-sizing: border-box;
}

.header-search-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 11px;
  height: 24px;
  outline: none;
  transition: all 0.2s ease;
}

.header-search-input:focus {
  border-color: #6366f1;
  background: rgba(15, 23, 42, 1);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.header-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.data-table td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--border-color);
  font-size: 11.5px;
  line-height: 1.25;
  vertical-align: middle;
}

.cluster-table tbody tr:first-child td {
  padding-top: 8px;
}

.data-table td.nowrap,
.data-table th.nowrap {
  white-space: nowrap;
}

.cluster-vouchers-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: #60a5fa;
  line-height: 1.25;
  white-space: normal;
  max-width: 450px;
}

.data-table td small {
  font-size: 10.5px;
  line-height: 1.1;
  color: var(--text-muted);
}

.data-table td strong {
  font-size: 11.5px;
  line-height: 1.15;
}

.data-table td .badge {
  padding: 2px 6px !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
  border-radius: 5px !important;
}

.data-table tbody tr {
  transition: background 0.1s;
  height: 28px;
}
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.05); }

/* SELECTED ROW HIGHLIGHT */
.data-table tbody tr.table-active-row,
.data-table tbody tr.table-active-row:hover {
  background: rgba(99, 102, 241, 0.25) !important;
  border-left: 3px solid var(--primary-color) !important;
  box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.3) !important;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-indicator { font-weight: 600; }

/* REPORTS & SETTINGS */
.reports-container, .settings-card { padding: 24px; margin-bottom: 20px; }
.report-filter-bar { display: flex; gap: 16px; align-items: flex-end; margin: 20px 0; }
.card-header-flex { display: flex; align-items: center; justify-content: space-between; }

.toggle-switch {
  width: 44px;
  height: 24px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* FLOATING CARD WINDOW OVERLAY */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(4, 7, 13, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 99999 !important;
  padding: 20px !important;
  box-sizing: border-box !important;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  background: #0c111d;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9), 0 0 30px rgba(99, 102, 241, 0.25);
  border-radius: 16px;
  width: 90%;
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 100000;
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-sm { max-width: 440px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.voucher-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 14px;
}

.cluster-action-buttons {
  display: flex;
  gap: 8px;
}

.modal-xl {
  max-width: 1040px;
  width: 95%;
  max-height: 90vh;
}

.card-modal-nav-tabs {
  display: flex;
  gap: 8px;
}

.card-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.card-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.card-tab-btn.active {
  color: #ffffff;
  background: var(--primary-color);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.card-tab-content { display: none; }
.card-tab-content.active { display: block; }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* INTERACTIVE EDITABLE AUFTRAGSPROTOKOLL DOCUMENT SHEET */
.protocol-interactive-sheet input,
.protocol-interactive-sheet textarea {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  color: #000000;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  padding: 3px 6px;
  resize: vertical;
  outline: none;
  transition: all 0.2s ease;
}

.protocol-interactive-sheet input:hover,
.protocol-interactive-sheet textarea:hover,
.protocol-interactive-sheet input:focus,
.protocol-interactive-sheet textarea:focus {
  background: rgba(254, 243, 199, 0.75) !important;
  border: 1px dashed #d97706 !important;
  border-radius: 4px;
}

/* MODAL BACKDROP & FLOATING WINDOW DIALOGS */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-card {
  position: relative;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
}

.proto-edit-active input,
.proto-edit-active textarea {
  background: rgba(254, 243, 199, 0.5) !important;
  border: 1px solid #f59e0b !important;
  border-radius: 4px;
}

/* --- LIGHT MODE THEME SYSTEM --- */
[data-theme="light"] {
  --bg-color: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.9);
  --border-color: rgba(0, 0, 0, 0.1);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --glass-border: 1px solid rgba(0, 0, 0, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --shadow-glow: 0 0 35px rgba(99, 102, 241, 0.12);
}

[data-theme="light"] body {
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(168, 85, 247, 0.05) 0px, transparent 50%);
}

[data-theme="light"] .glass-panel,
[data-theme="light"] .card,
[data-theme="light"] .modal-card {
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] table.data-table th {
  background: #e2e8f0;
  color: #1e293b;
}

[data-theme="light"] table.data-table td {
  border-bottom: 1px solid #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .form-control,
[data-theme="light"] select,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="password"] {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.95);
  border-right: 1px solid #cbd5e1;
}

[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid #cbd5e1;
}

/* HORIZONTAL SUB-NAVBAR FOR SETTINGS */
.settings-subnav-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  overflow-x: auto;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .settings-subnav-bar {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #cbd5e1;
}

.settings-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-subnav-btn i {
  width: 18px;
  height: 18px;
}

.settings-subnav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.settings-subnav-btn.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* SETTINGS PANELS TOGGLE */
.settings-panel-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.settings-panel-content.active {
  display: block;
}

.settings-section-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  padding: 28px;
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.settings-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.settings-section-title i {
  color: #6366f1;
  width: 24px;
  height: 24px;
}

/* THEME PICKER CARDS */
.theme-picker-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.theme-card-option {
  background: rgba(15, 23, 42, 0.5);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

[data-theme="light"] .theme-card-option {
  background: rgba(248, 250, 252, 0.9);
}

.theme-card-option:hover {
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-2px);
}

.theme-card-option.active {
  border-color: #6366f1;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.08);
}

.theme-card-preview {
  height: 120px;
  border-radius: 8px;
  display: flex;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.theme-dark-preview {
  background: #0f172a;
}

.theme-dark-preview .mini-sidebar {
  width: 30%;
  background: #1e293b;
  border-right: 1px solid #334155;
}

.theme-dark-preview .mini-content {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-dark-preview .mini-card {
  height: 24px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.theme-light-preview {
  background: #f8fafc;
}

.theme-light-preview .mini-sidebar {
  width: 30%;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
}

.theme-light-preview .mini-content {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-light-preview .mini-card {
  height: 24px;
  background: #e2e8f0;
  border-radius: 4px;
}

.theme-card-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.theme-card-label i {
  color: #6366f1;
  margin-top: 2px;
}

.theme-card-label strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main);
}

.theme-card-label small {
  color: var(--text-muted);
}

/* LANGUAGE CARDS GRID */
.lang-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.lang-choice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  background: rgba(15, 23, 42, 0.5);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
}

[data-theme="light"] .lang-choice-card {
  background: rgba(248, 250, 252, 0.9);
}

.lang-choice-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

.lang-choice-card.active {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.flag-icon {
  font-size: 2rem;
  margin-right: 12px;
}

.lang-info {
  flex: 1;
}

.lang-info strong {
  display: block;
  font-size: 1rem;
  color: var(--text-main);
}

.lang-info small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.choice-check {
  color: #6366f1;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lang-choice-card.active .choice-check {
  opacity: 1;
}

/* PREFERENCE GROUPS & SWITCH CARDS */
.pref-group-box {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

[data-theme="light"] .pref-group-box {
  background: rgba(241, 245, 249, 0.7);
}

.pref-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pref-group-title i {
  color: #6366f1;
}

.pref-switches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.pref-switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

[data-theme="light"] .pref-switch-card {
  background: #ffffff;
}

.pref-switch-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.pref-card-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pref-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pref-card-info strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.pref-card-info p {
  margin: 0;
  line-height: 1.2;
}

.pref-card-info small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* IOS SWITCH SLIDER */
.custom-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.custom-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(148, 163, 184, 0.3);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 26px;
  border: 1px solid var(--border-color);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.custom-switch input:checked + .switch-slider {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.custom-switch input:checked + .switch-slider:before {
  transform: translateX(22px);
}

/* DEFAULTS SELECT GRID */
.defaults-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* DATABASE & USER CARDS */
.db-provider-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

[data-theme="light"] .db-provider-card {
  background: #ffffff;
}

.db-card-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.db-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

/* SIDEBAR COLLAPSED & ICON-ONLY NAVIGATION STYLING */
.sidebar {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}

.main-wrapper {
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
}

.sidebar .nav-tab {
  cursor: pointer;
}

.sidebar .nav-tab i,
.sidebar .nav-tab svg {
  pointer-events: none; /* Ensures click hits the parent button directly */
}

.sidebar.collapsed + .main-wrapper,
.main-wrapper.collapsed {
  margin-left: 68px !important;
  width: calc(100vw - 68px) !important;
}

/* Fallback icon styling for CDN network resilience & server safety */
i[data-lucide], svg.lucide {
  display: inline-block;
  vertical-align: middle;
  width: 1.25em;
  height: 1.25em;
  min-width: 16px;
  min-height: 16px;
}
i[data-lucide]:empty::before {
  content: "•";
  display: inline-block;
  font-size: 14px;
  opacity: 0.7;
}

/* ==========================================================================
   DIN A4 AUFTRAGSPROTOKOLL SHEET (EXACT 1-PAGE A4 FIT AT 100% SCALE)
   ========================================================================== */
.protocol-a4-sheet {
  width: 100%;
  max-width: 186mm;
  min-height: auto;
  background: #ffffff !important;
  color: #000000 !important;
  font-family: Arial, "Helvetica Neue", Helvetica, "Segoe UI", sans-serif !important;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.7);
  margin: 0 auto;
  padding: 3mm 4mm;
  box-sizing: border-box;
  display: block;
  border: 1px solid #000000;
  page-break-inside: avoid !important;
  page-break-after: avoid !important;
}

.protocol-a4-sheet table {
  width: 100% !important;
  border-collapse: collapse;
  color: #000000 !important;
  font-family: Arial, "Helvetica Neue", Helvetica, "Segoe UI", sans-serif !important;
  table-layout: fixed;
  page-break-inside: avoid !important;
}

.protocol-a4-sheet tr {
  page-break-inside: avoid !important;
}

.protocol-a4-sheet td,
.protocol-a4-sheet th {
  border: 1px solid #000000 !important;
  color: #000000 !important;
  box-sizing: border-box;
  overflow: hidden;
}

.protocol-a4-sheet .proto-sheet-input,
.protocol-a4-sheet .proto-cell-editor,
.protocol-a4-sheet .proto-cell-date {
  width: 100%;
  height: 100%;
  border: none !important;
  background: transparent !important;
  color: #000000 !important;
  font-family: Arial, "Helvetica Neue", Helvetica, "Segoe UI", sans-serif !important;
  font-size: 12px !important;
  font-weight: bold !important;
  line-height: 1.25;
  padding: 2px 4px;
  box-sizing: border-box;
  outline: none;
  resize: none;
  display: block;
}

.protocol-a4-sheet .proto-sheet-input:focus,
.protocol-a4-sheet .proto-cell-editor:focus,
.protocol-a4-sheet .proto-cell-date:focus {
  background: rgba(224, 242, 254, 0.4) !important;
  outline: none;
}

/* Edit Mode Box Styling (Only when Bearbeitungsmodus toggle is explicitly ON) */
.proto-edit-active .proto-sheet-input,
.proto-edit-active .proto-cell-editor,
.proto-edit-active .proto-cell-date {
  background: #fffdf0 !important;
  border: 1.5px solid #f59e0b !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  font-weight: bold !important;
  color: #000000 !important;
  padding: 2px 4px !important;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 4mm 6mm;
  }
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    width: 100% !important;
    height: auto !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body * {
    visibility: hidden;
  }
  .protocol-a4-sheet,
  .protocol-a4-sheet * {
    visibility: visible;
  }
  .protocol-a4-sheet {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 184mm !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 auto !important;
    padding: 2mm 3mm !important;
    box-shadow: none !important;
    border: 1px solid #000000 !important;
    display: block !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
  }
  .protocol-a4-sheet table {
    page-break-inside: avoid !important;
    table-layout: fixed !important;
  }
  .protocol-a4-sheet tr {
    page-break-inside: avoid !important;
  }
  .protocol-a4-sheet td,
  .protocol-a4-sheet th {
    border: 1px solid #000000 !important;
    color: #000000 !important;
    overflow: hidden !important;
    background: transparent !important;
  }
  .protocol-a4-sheet .proto-sheet-input,
  .protocol-a4-sheet .proto-cell-editor,
  .protocol-a4-sheet .proto-cell-date {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   CUSTOM TAGS & COMMENTS MODAL STYLING
   ========================================================================== */
.tag-quick-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tag-quick-chip:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

.tag-quick-chip.letter-chip {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

.tag-quick-chip.letter-chip:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
  color: #ffffff;
}

.scope-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scope-chip:hover {
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
}

.scope-chip.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(168, 85, 247, 0.35));
  border-color: #818cf8;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.comment-snippet-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 2px 7px;
  font-size: 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.comment-snippet-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

/* ========================================================================= */
/* SIDEBAR OVERDUE ALERT BADGE */
/* ========================================================================= */
.sidebar-alert-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  animation: pulseBadge 2s infinite ease-in-out;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.85; }
}

/* ========================================================================= */
/* LIVE BARCODE & QR SCANNER STYLES */
/* ========================================================================= */
.scanner-viewport-container #qr-reader video {
  width: 100% !important;
  height: auto !important;
  border-radius: 8px;
  object-fit: cover;
}

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #06b6d4;
  box-shadow: 0 0 12px #06b6d4, 0 0 24px #22d3ee;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.scanner-laser.active {
  opacity: 1;
  animation: scanLaser 2s infinite linear alternate;
}

@keyframes scanLaser {
  0% { top: 5%; }
  100% { top: 95%; }
}

/* ========================================================================= */
/* CLUSTERS URGENT ALERT BANNER & CONTROLS */
/* ========================================================================= */
.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border: 1px solid rgba(239, 68, 68, 0.5);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0);
}

.btn-icon-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fca5a5;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.btn-icon-close:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ffffff;
  transform: scale(1.08);
}

.btn-icon-close svg,
.btn-icon-close i {
  width: 16px;
  height: 16px;
}

.cluster-alert-banner {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16) 0%, rgba(153, 27, 27, 0.25) 100%) !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  animation: slideDownAlert 0.3s ease;
}

.cluster-alert-banner.hidden {
  display: none !important;
}

.alert-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.alert-banner-left .alert-icon,
.alert-banner-left svg,
.alert-banner-left i {
  color: #f87171;
  width: 20px;
  height: 20px;
  min-width: 20px;
  flex-shrink: 0;
}

.alert-banner-left .alert-text {
  font-size: 13.5px;
  font-weight: 600;
  color: #fecaca;
  letter-spacing: 0.2px;
  line-height: 1.4;
}

.alert-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

@keyframes slideDownAlert {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}



