/* ==========================================================================
   BAT Design System - site.css
   Business Administration Tool | Clean, minimal, professional - kein Firlefanz.
   ========================================================================== */

/* === 1. DESIGN TOKENS (CSS Custom Properties) ============================= */
:root {
  /* Colors: Primary (Indigo/Blue) */
  --bat-primary-50:  #eef2ff;  --bat-primary-100: #e0e7ff;
  --bat-primary-200: #c7d2fe;  --bat-primary-300: #a5b4fc;
  --bat-primary-400: #818cf8;  --bat-primary-500: #6366f1;
  --bat-primary-600: #4f46e5;  --bat-primary-700: #4338ca;
  --bat-primary-800: #3730a3;  --bat-primary-900: #312e81;
  /* Colors: Neutral (Gray) */
  --bat-gray-25:  #fcfcfd;  --bat-gray-50:  #f9fafb;
  --bat-gray-100: #f3f4f6;  --bat-gray-200: #e5e7eb;
  --bat-gray-300: #d1d5db;  --bat-gray-400: #9ca3af;
  --bat-gray-500: #6b7280;  --bat-gray-600: #4b5563;
  --bat-gray-700: #374151;  --bat-gray-800: #1f2937;
  --bat-gray-900: #111827;  --bat-gray-950: #030712;
  /* Colors: Semantic */
  --bat-success: #16a34a;  --bat-success-bg: #f0fdf4;
  --bat-warning: #d97706;  --bat-warning-bg: #fffbeb;
  --bat-danger:  #dc2626;  --bat-danger-bg:  #fef2f2;
  --bat-info:    #0891b2;  --bat-info-bg:    #ecfeff;
  /* Surfaces */
  --bat-bg-body:    var(--bat-gray-50);
  --bat-bg-surface: #ffffff;
  --bat-bg-muted:   var(--bat-gray-100);
  --bat-bg-sidebar: #ffffff;
  /* Rail (dark icon strip) */
  --bat-rail-bg: #1e1b4b;
  --bat-rail-width: 56px;
  --bat-rail-icon-color: #a5b4fc;
  --bat-rail-icon-active: #ffffff;
  --bat-rail-indicator: #818cf8;
  /* Sidebar (light detail panel) */
  --bat-sidebar-text-primary: #1e1b4b;
  --bat-sidebar-text-secondary: #6b7280;
  --bat-sidebar-text-muted: #9ca3af;
  --bat-sidebar-border: #e5e7eb;
  --bat-sidebar-hover-bg: #f9fafb;
  --bat-sidebar-active-bg: #f3f4f6;
  /* Text */
  --bat-text-primary:   var(--bat-gray-900);
  --bat-text-secondary: var(--bat-gray-500);
  --bat-text-muted:     var(--bat-gray-400);
  --bat-text-inverse:   #ffffff;
  --bat-text-link:      var(--bat-primary-600);
  /* Borders */
  --bat-border-color:      var(--bat-gray-200);
  --bat-border-light:      var(--bat-gray-100);
  --bat-border-radius:     0.375rem;
  --bat-border-radius-sm:  0.25rem;
  --bat-border-radius-lg:  0.5rem;
  /* Shadows */
  --bat-shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --bat-shadow-sm: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --bat-shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --bat-shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  /* Typography */
  --bat-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bat-font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
  --bat-font-size-xs:   0.75rem;   --bat-font-size-sm:   0.8125rem;
  --bat-font-size-base: 0.875rem;  --bat-font-size-md:   1rem;
  --bat-font-size-lg:   1.125rem;  --bat-font-size-xl:   1.25rem;
  --bat-font-size-2xl:  1.5rem;    --bat-line-height:    1.6;
  /* Spacing */
  --bat-space-xs: 0.25rem;  --bat-space-sm: 0.5rem;
  --bat-space-md: 1rem;     --bat-space-lg: 1.5rem;
  --bat-space-xl: 2rem;     --bat-space-2xl: 3rem;
  /* Layout */
  --bat-sidebar-width:      260px;
  --bat-sidebar-collapsed:   56px;
  --bat-topbar-height:       56px;
  --bat-content-max-width: 1400px;
  /* Transitions */
  --bat-transition-fast: 150ms ease;
  --bat-transition-base: 200ms ease;
  --bat-transition-slow: 300ms ease;
  /* Z-Index */
  --bat-z-sidebar: 1040;  --bat-z-topbar: 1030;
  --bat-z-overlay: 1035;  --bat-z-toast:  1080;
  --bat-z-modal:   1050;
}

/* === 2. RESET & BASE ====================================================== */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  font-family: var(--bat-font-sans);
  font-size: var(--bat-font-size-base);
  line-height: var(--bat-line-height);
  color: var(--bat-text-primary);
  background-color: var(--bat-bg-body);
  margin: 0; min-height: 100vh;
}
h1, h2, h3, h4, h5, h6 {
  font-weight: 600; line-height: 1.3;
  color: var(--bat-gray-900); margin-top: 0;
}
h1 { font-size: var(--bat-font-size-2xl); }
h2 { font-size: var(--bat-font-size-xl); }
h3 { font-size: var(--bat-font-size-lg); }
h4 { font-size: var(--bat-font-size-md); }
a { color: var(--bat-text-link); text-decoration: none; transition: color var(--bat-transition-fast); }
a:hover { color: var(--bat-primary-700); }
code, pre, kbd { font-family: var(--bat-font-mono); font-size: var(--bat-font-size-sm); }
code {
  padding: 0.125rem 0.375rem; background: var(--bat-gray-100);
  border-radius: var(--bat-border-radius-sm); color: var(--bat-primary-700);
}
pre {
  background: var(--bat-gray-900); color: var(--bat-gray-100);
  padding: var(--bat-space-md); border-radius: var(--bat-border-radius); overflow-x: auto;
}
pre code { background: none; color: inherit; padding: 0; }
::selection { background: var(--bat-primary-100); color: var(--bat-primary-900); }
/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bat-gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bat-gray-400); }

/* === 3. LAYOUT (Sidebar + Content Area) =================================== */
.bat-layout { display: flex; min-height: 100vh; }
.bat-content {
  flex: 1; min-width: 0; margin-left: 0;
  display: flex; flex-direction: column; min-height: 100vh;
  transition: margin-left var(--bat-transition-slow);
}
.bat-has-nav .bat-content { margin-left: calc(var(--bat-rail-width) + var(--bat-sidebar-width)); }
.bat-has-nav.bat-sidebar-collapsed .bat-content { margin-left: var(--bat-rail-width); }
.bat-content-main {
  flex: 1; padding: var(--bat-space-lg) var(--bat-space-xl);
  max-width: var(--bat-content-max-width); width: 100%;
}
.bat-content-full { max-width: 100%; }
/* Page header */
.bat-page-header { margin-bottom: var(--bat-space-lg); }
.bat-page-title { font-size: var(--bat-font-size-2xl); font-weight: 700; margin-bottom: var(--bat-space-xs); }
.bat-page-subtitle { color: var(--bat-text-secondary); font-size: var(--bat-font-size-base); margin-bottom: 0; }
.bat-breadcrumb {
  display: flex; align-items: center; gap: var(--bat-space-xs);
  font-size: var(--bat-font-size-sm); color: var(--bat-text-muted); margin-bottom: var(--bat-space-sm);
}
.bat-breadcrumb a { color: var(--bat-text-secondary); }
.bat-breadcrumb a:hover { color: var(--bat-primary-600); }
.bat-breadcrumb-separator::before { content: '/'; margin: 0 0.125rem; }

/* === 4. DUAL-RAIL NAVIGATION ============================================== */

/* --- 4a. Icon Rail (fixed, dark indigo, 56px) --- */
.bat-rail {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--bat-rail-width); background: var(--bat-rail-bg);
  display: flex; flex-direction: column; align-items: center;
  padding: 1rem 0; z-index: calc(var(--bat-z-sidebar) + 1);
}
.bat-rail-logo {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem; text-decoration: none;
}
.bat-rail-logo-text {
  font-weight: 800; font-size: 1.1rem; color: #fff;
  background: var(--bat-primary-600); width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--bat-border-radius);
}
.bat-rail-nav {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.375rem; flex: 1;
}
.bat-rail-btn {
  position: relative; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--bat-rail-icon-color);
  font-size: 1.1rem; border-radius: var(--bat-border-radius);
  cursor: pointer; transition: all var(--bat-transition-fast);
  text-decoration: none; padding: 0;
}
.bat-rail-btn:hover { background: rgba(255,255,255,.1); }
.bat-rail-btn:hover .bat-rail-badge { opacity: .85; }
/* Rail Tooltip — pure CSS, slides in from the right */
.bat-rail-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; left: calc(100% + 10px); top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: #1e1e2e; color: #fff; font-size: 0.75rem; font-weight: 500;
  padding: 0.35rem 0.65rem; border-radius: 6px; white-space: nowrap;
  pointer-events: none; opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  z-index: 9999; letter-spacing: 0.01em;
}
.bat-rail-btn[data-tooltip]:hover::after {
  opacity: 1; transform: translateY(-50%) translateX(0);
  transition-delay: 350ms;
}
.bat-rail-btn.active { background: rgba(255,255,255,.15); }
.bat-rail-btn.active::before {
  content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--bat-rail-indicator);
  border-radius: 0 2px 2px 0;
}
/* Rail badge (white frame with text — overrides all bat-badge-* colors in rail) */
.bat-rail-badge.bat-rail-badge {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: transparent !important; color: #fff !important; font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.02em; border-radius: 5px; text-transform: uppercase; line-height: 1;
  border: 2px solid rgba(255,255,255,.6);
  transition: all var(--bat-transition-fast);
}
.bat-rail-btn.active .bat-rail-badge.bat-rail-badge {
  background: #fff !important; color: var(--bat-rail-bg) !important; border-color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.bat-rail-bottom {
  margin-top: auto; display: flex; flex-direction: column;
  align-items: center; gap: 0.25rem;
}
/* Expand button: hidden by default, shown when sidebar collapsed */
.bat-rail-expand-btn { display: none; }
.bat-layout.bat-sidebar-collapsed .bat-rail-expand-btn { display: flex; }

/* --- 4b. Detail Sidebar (fixed, light/white, 260px) --- */
.bat-sidebar {
  position: fixed; top: 0; left: var(--bat-rail-width); bottom: 0;
  width: var(--bat-sidebar-width); background: var(--bat-bg-sidebar);
  border-right: 1px solid var(--bat-sidebar-border);
  z-index: var(--bat-z-sidebar); display: flex; flex-direction: column;
  overflow: hidden;
  transition: width var(--bat-transition-slow), transform var(--bat-transition-slow);
}
.bat-layout.bat-sidebar-collapsed .bat-sidebar { width: 0; overflow: hidden; }
/* User info section */
.bat-sidebar-user {
  height: var(--bat-topbar-height); padding: 0 1rem;
  border-bottom: 1px solid var(--bat-sidebar-border);
  flex-shrink: 0; display: flex; align-items: center; gap: 0.5rem;
}
.bat-sidebar-user-name {
  font-size: var(--bat-font-size-sm); font-weight: 600;
  color: var(--bat-sidebar-text-primary); margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bat-sidebar-user-role { font-size: var(--bat-font-size-xs); }
/* Role badges */
.bat-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.65rem; font-weight: 600; padding: 0.2em 0.65em;
  border-radius: 9999px; line-height: 1.4;
}
.bat-badge-developer   { background: var(--bat-danger-bg);  color: var(--bat-danger); }
.bat-badge-admin       { background: var(--bat-warning-bg); color: var(--bat-warning); }
.bat-badge-payroll     { background: var(--bat-info-bg);    color: var(--bat-info); }
.bat-badge-management  { background: var(--bat-primary-50); color: var(--bat-primary-700); }
.bat-badge-backoffice  { background: var(--bat-success-bg); color: var(--bat-success); }
.bat-badge-dispo       { background: #fef3c7;              color: #92400e; }
.bat-badge-subcontractor { background: var(--bat-gray-100); color: var(--bat-gray-700); }
.bat-badge-worker      { background: var(--bat-gray-100);   color: var(--bat-gray-600); }
/* Nav scroll area */
.bat-sidebar-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0.5rem 0;
}
.bat-sidebar-nav::-webkit-scrollbar { width: 4px; }
.bat-sidebar-nav::-webkit-scrollbar-thumb { background: var(--bat-gray-300); border-radius: 2px; }
/* Sidebar group */
.bat-sidebar-group { margin-bottom: 0.25rem; display: none; }
.bat-sidebar-group.active { display: block; }
/* Sub-heading within a group */
.bat-sidebar-subheading {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #000;
  padding: 0.75rem 1rem 0.25rem; white-space: nowrap;
}
.bat-sidebar-subheading:first-child { padding-top: 0.5rem; }
/* Sidebar link */
.bat-sidebar-link {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.4375rem 1rem; font-size: var(--bat-font-size-sm);
  color: var(--bat-sidebar-text-secondary); text-decoration: none;
  transition: all var(--bat-transition-fast);
  border-left: 3px solid transparent; white-space: nowrap;
}
.bat-sidebar-link:hover { background: var(--bat-sidebar-hover-bg); color: var(--bat-sidebar-text-primary); }
.bat-sidebar-link.active {
  background: var(--bat-sidebar-active-bg); color: var(--bat-sidebar-text-primary);
  border-left-color: var(--bat-primary-600); font-weight: 600;
}
.bat-sidebar-link i {
  width: 1.25rem; text-align: center; font-size: 1rem; flex-shrink: 0; opacity: 0.7;
}
.bat-sidebar-link:hover i, .bat-sidebar-link.active i { opacity: 1; }
/* Collapse button at bottom */
.bat-sidebar-collapse-btn {
  display: flex; align-items: center; gap: 0.625rem;
  width: 100%; padding: 0.625rem 1rem; border: none;
  background: transparent; color: var(--bat-sidebar-text-muted);
  font-size: 0.8rem; cursor: pointer;
  transition: all var(--bat-transition-fast);
  border-top: 1px solid var(--bat-sidebar-border); flex-shrink: 0;
}
.bat-sidebar-collapse-btn:hover { background: var(--bat-sidebar-hover-bg); color: var(--bat-sidebar-text-secondary); }
.bat-sidebar-collapse-btn i { width: 1.25rem; text-align: center; font-size: 1rem; }
.bat-layout.bat-sidebar-collapsed .bat-sidebar-collapse-btn { display: none; }
/* Sidebar footer */
.bat-sidebar-footer {
  padding: var(--bat-space-sm) var(--bat-space-md);
  border-top: 1px solid var(--bat-sidebar-border); flex-shrink: 0;
}
/* Overlay (mobile) */
.bat-sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: calc(var(--bat-z-sidebar) - 1); backdrop-filter: blur(2px);
}
.bat-sidebar-overlay.active { display: block; }

/* === 5. TOP BAR =========================================================== */
.bat-topbar {
  position: sticky; top: 0; height: var(--bat-topbar-height);
  background: var(--bat-bg-surface); border-bottom: 1px solid var(--bat-border-color);
  display: flex; align-items: center; padding: 0 var(--bat-space-xl);
  z-index: var(--bat-z-topbar); gap: var(--bat-space-md);
}
.bat-topbar-left   { display: flex; align-items: center; gap: var(--bat-space-md); }
.bat-topbar-center { flex: 1; }
.bat-topbar-right  { display: flex; align-items: center; gap: var(--bat-space-sm); margin-left: auto; }
.bat-topbar-menu-toggle {
  display: none; background: none; border: none;
  color: var(--bat-text-secondary); cursor: pointer; padding: var(--bat-space-xs);
}
/* Search */
.bat-topbar-search { position: relative; max-width: 320px; width: 100%; }
.bat-topbar-search input {
  width: 100%; padding: 0.375rem 0.75rem 0.375rem 2.25rem;
  border: 1px solid var(--bat-border-color); border-radius: var(--bat-border-radius);
  font-size: var(--bat-font-size-sm); background: var(--bat-bg-body); color: var(--bat-text-primary);
  transition: border-color var(--bat-transition-fast), box-shadow var(--bat-transition-fast);
}
.bat-topbar-search input:focus {
  outline: none; border-color: var(--bat-primary-300); box-shadow: 0 0 0 3px var(--bat-primary-50);
}
.bat-topbar-search .ti {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  color: var(--bat-text-muted); font-size: var(--bat-font-size-md);
}
/* Icon buttons */
.bat-topbar-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; border-radius: var(--bat-border-radius);
  background: transparent; color: var(--bat-text-secondary); cursor: pointer;
  position: relative; transition: all var(--bat-transition-fast);
}
.bat-topbar-btn:hover { background: var(--bat-gray-100); color: var(--bat-text-primary); }
.bat-topbar-btn .bat-indicator {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--bat-danger); border: 2px solid var(--bat-bg-surface);
}
/* User */
.bat-topbar-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; cursor: pointer; }
.bat-topbar-user {
  display: flex; align-items: center; gap: var(--bat-space-sm); cursor: pointer;
  padding: var(--bat-space-xs) var(--bat-space-sm); border-radius: var(--bat-border-radius);
  transition: background var(--bat-transition-fast);
}
.bat-topbar-user:hover { background: var(--bat-gray-100); }
.bat-topbar-user-name { font-size: var(--bat-font-size-sm); font-weight: 500; color: var(--bat-text-primary); line-height: 1.2; }
.bat-topbar-user-role { font-size: var(--bat-font-size-xs); color: var(--bat-text-muted); line-height: 1.2; }

/* === 6. BOOTSTRAP THEME OVERRIDES ========================================= */
/* Map BAT Design Tokens → Bootstrap 5.3 CSS variables for consistent look */
:root {
  /* Primary color → BAT Indigo */
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  /* Typography */
  --bs-body-font-family: var(--bat-font-sans);
  --bs-body-font-size: var(--bat-font-size-base);
  --bs-body-color: var(--bat-text-primary);
  --bs-body-bg: var(--bat-bg-body);
  /* Borders */
  --bs-border-radius: var(--bat-border-radius);
  --bs-border-radius-sm: var(--bat-border-radius-sm);
  --bs-border-radius-lg: var(--bat-border-radius-lg);
  --bs-border-color: var(--bat-border-color);
  /* Semantic colors */
  --bs-success: #16a34a;
  --bs-success-rgb: 22, 163, 74;
  --bs-warning: #d97706;
  --bs-warning-rgb: 217, 119, 6;
  --bs-danger: #dc2626;
  --bs-danger-rgb: 220, 38, 38;
  --bs-info: #0891b2;
  --bs-info-rgb: 8, 145, 178;
  /* Links */
  --bs-link-color: var(--bat-text-link);
  --bs-link-hover-color: var(--bat-primary-700);
}
/* Cards */
.card {
  border: 1px solid var(--bat-border-light);
  box-shadow: var(--bat-shadow-xs);
  border-radius: var(--bat-border-radius-lg);
}
.card-header {
  background: var(--bat-bg-surface);
  border-bottom: 1px solid var(--bat-border-light);
  font-weight: 600;
}
/* Buttons: Indigo primary */
.btn-primary {
  --bs-btn-bg: var(--bat-primary-600);
  --bs-btn-border-color: var(--bat-primary-600);
  --bs-btn-hover-bg: var(--bat-primary-700);
  --bs-btn-hover-border-color: var(--bat-primary-700);
  --bs-btn-active-bg: var(--bat-primary-800);
  --bs-btn-active-border-color: var(--bat-primary-800);
}
.btn-outline-primary {
  --bs-btn-color: var(--bat-primary-600);
  --bs-btn-border-color: var(--bat-primary-600);
  --bs-btn-hover-bg: var(--bat-primary-600);
  --bs-btn-hover-border-color: var(--bat-primary-600);
  --bs-btn-active-bg: var(--bat-primary-700);
}
/* Form inputs: BAT focus ring */
.form-control:focus, .form-select:focus {
  border-color: var(--bat-primary-400);
  box-shadow: 0 0 0 3px var(--bat-primary-50);
}
/* Tables */
.table { --bs-table-border-color: var(--bat-border-light); }
.table > thead > tr > th { font-weight: 600; font-size: var(--bat-font-size-sm); }
/* Badges */
.badge { font-weight: 500; }
/* Modals */
.modal-content {
  border: none;
  box-shadow: var(--bat-shadow-lg);
  border-radius: var(--bat-border-radius-lg);
}

/* === 7. TABULATOR OVERRIDES =============================================== */
/* Tabulator overrides */
.tabulator {
  border: 1px solid var(--bat-border-color) !important;
  border-radius: var(--bat-border-radius-lg) !important;
  font-family: var(--bat-font-sans) !important;
  font-size: var(--bat-font-size-sm) !important;
}
.tabulator .tabulator-header {
  background: var(--bat-gray-50) !important;
  border-bottom: 1px solid var(--bat-border-color) !important;
}
.tabulator .tabulator-header .tabulator-col {
  background: transparent !important; border-right: none !important;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
  padding: 0.625rem var(--bat-space-md) !important;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-title {
  color: var(--bat-gray-600) !important; font-weight: 600 !important;
  font-size: var(--bat-font-size-xs) !important;
  text-transform: uppercase !important; letter-spacing: 0.03em !important;
}
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row {
  border-bottom: 1px solid var(--bat-border-light) !important;
  background: var(--bat-bg-surface) !important;
}
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row:hover {
  background: var(--bat-primary-50) !important;
}
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {
  padding: 0.625rem var(--bat-space-md) !important; border-right: none !important;
}
.tabulator .tabulator-footer {
  background: var(--bat-gray-25) !important;
  border-top: 1px solid var(--bat-border-color) !important;
  padding: var(--bat-space-sm) var(--bat-space-md) !important;
}
.tabulator .tabulator-footer .tabulator-page {
  border-radius: var(--bat-border-radius-sm) !important;
  font-size: var(--bat-font-size-xs) !important;
}
.tabulator .tabulator-footer .tabulator-page.active {
  background: var(--bat-primary-600) !important; color: #fff !important;
}

/* === 8. FORMS (Tom Select + Grid) ========================================= */
/* Tom Select overrides */
.ts-wrapper .ts-control {
  border-color: var(--bat-border-color); font-size: var(--bat-font-size-base);
}
.ts-wrapper.focus .ts-control {
  border-color: var(--bat-primary-400); box-shadow: 0 0 0 3px var(--bat-primary-50);
}
/* Form grid (kept for layout utility) */
.bat-form-row { display: grid; gap: var(--bat-space-md); }
.bat-form-row-2 { grid-template-columns: repeat(2, 1fr); }
.bat-form-row-3 { grid-template-columns: repeat(3, 1fr); }
.bat-form-row-4 { grid-template-columns: repeat(4, 1fr); }

/* === 11. TOAST / NOTIFICATIONS ============================================ */
.bat-toast-container {
  position: fixed; top: var(--bat-space-lg); right: var(--bat-space-lg);
  z-index: var(--bat-z-toast); display: flex; flex-direction: column;
  gap: var(--bat-space-sm); max-width: 400px; pointer-events: none;
}
.bat-toast {
  display: flex; align-items: flex-start; gap: var(--bat-space-sm);
  padding: var(--bat-space-md); background: var(--bat-bg-surface);
  border: 1px solid var(--bat-border-color); border-radius: var(--bat-border-radius-lg);
  box-shadow: var(--bat-shadow-lg); pointer-events: all;
  animation: bat-toast-in var(--bat-transition-slow) ease-out; min-width: 300px;
}
.bat-toast-icon    { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.bat-toast-content { flex: 1; min-width: 0; }
.bat-toast-title   { font-weight: 600; font-size: var(--bat-font-size-sm); color: var(--bat-text-primary); }
.bat-toast-message { font-size: var(--bat-font-size-sm); color: var(--bat-text-secondary); margin-top: 0.125rem; }
.bat-toast-close {
  flex-shrink: 0; background: none; border: none; color: var(--bat-text-muted);
  cursor: pointer; padding: 0; font-size: var(--bat-font-size-lg); line-height: 1;
}
.bat-toast-close:hover { color: var(--bat-text-primary); }
/* Variants (left border accent) */
.bat-toast-success { border-left: 3px solid var(--bat-success); }
.bat-toast-warning { border-left: 3px solid var(--bat-warning); }
.bat-toast-danger  { border-left: 3px solid var(--bat-danger); }
.bat-toast-info    { border-left: 3px solid var(--bat-info); }
.bat-toast-success .bat-toast-icon { color: var(--bat-success); }
.bat-toast-warning .bat-toast-icon { color: var(--bat-warning); }
.bat-toast-danger  .bat-toast-icon { color: var(--bat-danger); }
.bat-toast-info    .bat-toast-icon { color: var(--bat-info); }
/* Animations */
.bat-toast-out { animation: bat-toast-out var(--bat-transition-base) ease-in forwards; }
@keyframes bat-toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes bat-toast-out {
  to { opacity: 0; transform: translateX(100%); }
}

/* === 12. UTILITIES ======================================================== */
/* Text color */
.bat-text-primary   { color: var(--bat-text-primary) !important; }
.bat-text-secondary { color: var(--bat-text-secondary) !important; }
.bat-text-muted     { color: var(--bat-text-muted) !important; }
.bat-text-success   { color: var(--bat-success) !important; }
.bat-text-warning   { color: var(--bat-warning) !important; }
.bat-text-danger    { color: var(--bat-danger) !important; }
.bat-text-info      { color: var(--bat-info) !important; }
/* Text size */
.bat-text-xs   { font-size: var(--bat-font-size-xs) !important; }
.bat-text-sm   { font-size: var(--bat-font-size-sm) !important; }
.bat-text-base { font-size: var(--bat-font-size-base) !important; }
.bat-text-md   { font-size: var(--bat-font-size-md) !important; }
.bat-text-lg   { font-size: var(--bat-font-size-lg) !important; }
/* Font */
.bat-text-mono     { font-family: var(--bat-font-mono) !important; }
.bat-font-semibold { font-weight: 600 !important; }
.bat-font-bold     { font-weight: 700 !important; }
.bat-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Gap helpers */
.bat-gap-xs { gap: var(--bat-space-xs) !important; }
.bat-gap-sm { gap: var(--bat-space-sm) !important; }
.bat-gap-md { gap: var(--bat-space-md) !important; }
.bat-gap-lg { gap: var(--bat-space-lg) !important; }
/* Divider */
.bat-divider { height: 1px; background: var(--bat-border-color); margin: var(--bat-space-md) 0; border: none; }
/* Spinner */
.bat-spinner {
  width: 20px; height: 20px; border: 2px solid var(--bat-gray-200);
  border-top-color: var(--bat-primary-600); border-radius: 50%;
  animation: bat-spin 600ms linear infinite;
}
.bat-spinner-sm { width: 14px; height: 14px; border-width: 1.5px; }
.bat-spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes bat-spin { to { transform: rotate(360deg); } }
/* Empty state */
.bat-empty-state { text-align: center; padding: var(--bat-space-2xl) var(--bat-space-lg); color: var(--bat-text-secondary); }
.bat-empty-state-icon { font-size: 2.5rem; color: var(--bat-gray-300); margin-bottom: var(--bat-space-md); }
.bat-empty-state-title { font-size: var(--bat-font-size-md); font-weight: 600; color: var(--bat-text-primary); margin-bottom: var(--bat-space-xs); }
/* Visually hidden */
.bat-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
/* Skeleton loading */
.bat-skeleton {
  background: linear-gradient(90deg, var(--bat-gray-100) 25%, var(--bat-gray-200) 50%, var(--bat-gray-100) 75%);
  background-size: 200% 100%; animation: bat-skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--bat-border-radius-sm);
}
@keyframes bat-skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* Fade */
.bat-fade-enter { opacity: 0; transition: opacity var(--bat-transition-base); }
.bat-fade-enter-active { opacity: 1; }
/* Number alignment */
.bat-num { font-variant-numeric: tabular-nums; text-align: right; }

/* === 13. RESPONSIVE ======================================================= */
/* Tablet (< 1200px): Collapse sidebar, show only rail */
@media (max-width: 1199.98px) {
  .bat-sidebar {
    transform: translateX(calc(-1 * var(--bat-sidebar-width)));
  }
  .bat-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.1);
  }
  .bat-sidebar-overlay.active { display: block; }
  .bat-content, .bat-has-nav .bat-content { margin-left: var(--bat-rail-width); }
  .bat-content-main { padding: var(--bat-space-md) var(--bat-space-lg); }
}
/* Mobile (< 768px): Rail → bottom bar, sidebar → drawer */
@media (max-width: 767.98px) {
  .bat-rail {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; height: 56px; flex-direction: row;
    justify-content: space-around; padding: 0 0.5rem;
    border-top: 1px solid rgba(255,255,255,.1);
  }
  .bat-rail-logo { display: none; }
  .bat-rail-nav { flex-direction: row; gap: 0; flex: 1; overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; }
  .bat-rail-nav::-webkit-scrollbar { display: none; }
  .bat-rail-btn { flex-shrink: 0; }
  .bat-rail-btn.active::before {
    left: 50%; top: -1px; bottom: auto; transform: translateX(-50%);
    width: 20px; height: 3px; border-radius: 0 0 2px 2px;
  }
  .bat-rail-bottom { display: none; }
  .bat-rail-btn[data-tooltip]::after { display: none; }
  .bat-sidebar {
    left: 0; width: 100%; max-width: 320px;
    transform: translateX(-100%);
  }
  .bat-sidebar.mobile-open { transform: translateX(0); box-shadow: var(--bat-shadow-lg); }
  .bat-content, .bat-has-nav .bat-content { margin-left: 0; padding-bottom: 72px; }
  .bat-content-main { padding: var(--bat-space-md); overflow-x: hidden; }
  .bat-topbar-menu-toggle { display: flex; }
  .bat-form-row-2, .bat-form-row-3, .bat-form-row-4 { grid-template-columns: 1fr; }
  .bat-toast-container { left: var(--bat-space-md); right: var(--bat-space-md); max-width: 100%; }
  .bat-toast { min-width: auto; }
  .bat-topbar { padding: 0 var(--bat-space-md); }
}
/* === 14. COMPAT: Legacy Vuexy class shims ================================= */
/* card-header with flex layout (used on DataTable pages) */
.card-header.flex-column { display: flex; }
.card-header.flex-md-row { flex-direction: column; }
@media (min-width: 768px) {
  .card-header.flex-md-row { flex-direction: row; align-items: center; justify-content: space-between; }
}
.head-label { flex: 1; }
.dt-action-buttons { margin-top: var(--bat-space-sm); }
@media (min-width: 768px) { .dt-action-buttons { margin-top: 0; } }

/* === 15. FLATPICKR: BatDateTimePicker Time-Bar ============================= */
/* Golden Standard – Kalender + Stunden (eckig) + Minuten (rund)               */

.fp-quarter-bar {
  padding: 10px 10px 12px;
  border-top: 1px solid #e6e6e6;
  background: #fafafa;
}

/* Stunden: eckig (4px radius) */
.fp-quarter-hours {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #dee2e6;
}

/* Minuten: zentriert */
.fp-quarter-mins {
  display: flex;
  gap: 6px;
  justify-content: center;
}

/* Basis-Button (Stunden = eckig) */
.fp-q-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 4px;
  font-size: .75rem;
  font-weight: 500;
  color: #495057;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  transition: all .15s ease;
}
.fp-q-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}
.fp-q-btn.active {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
  font-weight: 600;
}
.fp-q-btn.active:hover {
  background: #0b5ed7;
}

/* Minuten-Buttons: rund (Kreis) */
.fp-q-min {
  min-width: 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: .8125rem;
  font-weight: 600;
  flex: 0 0 auto;
}
.fp-q-min.active {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, .25);
}

/* Print */
@media print {
  .bat-rail, .bat-sidebar, .bat-topbar, .bat-toast-container, .bat-sidebar-overlay { display: none !important; }
  .bat-content { margin-left: 0 !important; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  body { background: #fff; color: #000; }
}
